mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Misc small changes for code quality.
This commit is contained in:
parent
ada50c429a
commit
4dd67df1dd
8 changed files with 17 additions and 17 deletions
|
@ -37,7 +37,7 @@ namespace GreenshotConfluencePlugin {
|
||||||
Regex pageIdRegex = new Regex(@"pageId=(\d+)");
|
Regex pageIdRegex = new Regex(@"pageId=(\d+)");
|
||||||
Regex spacePageRegex = new Regex(@"\/display\/([^\/]+)\/([^#]+)");
|
Regex spacePageRegex = new Regex(@"\/display\/([^\/]+)\/([^#]+)");
|
||||||
foreach(string browserurl in GetBrowserUrls()) {
|
foreach(string browserurl in GetBrowserUrls()) {
|
||||||
string url = null;
|
string url;
|
||||||
try {
|
try {
|
||||||
url = Uri.UnescapeDataString(browserurl).Replace("+", " ");
|
url = Uri.UnescapeDataString(browserurl).Replace("+", " ");
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
@ -66,10 +66,11 @@ namespace GreenshotConfluencePlugin {
|
||||||
string displayKey = GetDisplayKeyValue(a);
|
string displayKey = GetDisplayKeyValue(a);
|
||||||
object enumValue = field.GetValue(null);
|
object enumValue = field.GetValue(null);
|
||||||
|
|
||||||
string displayString = null;
|
string displayString;
|
||||||
if (displayKey != null && Language.hasKey(displayKey)) {
|
if (displayKey != null && Language.hasKey(displayKey)) {
|
||||||
displayString = Language.GetString(displayKey);
|
displayString = Language.GetString(displayKey);
|
||||||
} if (displayKey != null) {
|
}
|
||||||
|
if (displayKey != null) {
|
||||||
displayString = displayKey;
|
displayString = displayKey;
|
||||||
} else {
|
} else {
|
||||||
displayString = enumValue.ToString();
|
displayString = enumValue.ToString();
|
||||||
|
|
|
@ -54,13 +54,13 @@ namespace GreenshotDropboxPlugin {
|
||||||
|
|
||||||
public override ExportInformation ExportCapture(bool manually, ISurface surface, ICaptureDetails captureDetails) {
|
public override ExportInformation ExportCapture(bool manually, ISurface surface, ICaptureDetails captureDetails) {
|
||||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||||
string uploadURL = null;
|
string uploadUrl;
|
||||||
bool uploaded = plugin.Upload(captureDetails, surface, out uploadURL);
|
bool uploaded = plugin.Upload(captureDetails, surface, out uploadUrl);
|
||||||
if (uploaded) {
|
if (uploaded) {
|
||||||
exportInformation.Uri = uploadURL;
|
exportInformation.Uri = uploadUrl;
|
||||||
exportInformation.ExportMade = true;
|
exportInformation.ExportMade = true;
|
||||||
if (config.AfterUploadLinkToClipBoard) {
|
if (config.AfterUploadLinkToClipBoard) {
|
||||||
ClipboardHelper.SetClipboardData(uploadURL);
|
ClipboardHelper.SetClipboardData(uploadUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
ProcessExport(exportInformation, surface);
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace ExternalCommand {
|
||||||
listView1.SmallImageList = imageList;
|
listView1.SmallImageList = imageList;
|
||||||
int imageNr = 0;
|
int imageNr = 0;
|
||||||
foreach(string commando in config.Commands) {
|
foreach(string commando in config.Commands) {
|
||||||
ListViewItem item = null;
|
ListViewItem item;
|
||||||
Image iconForExe = IconCache.IconForCommand(commando);
|
Image iconForExe = IconCache.IconForCommand(commando);
|
||||||
if(iconForExe != null) {
|
if(iconForExe != null) {
|
||||||
imageList.Images.Add(iconForExe);
|
imageList.Images.Add(iconForExe);
|
||||||
|
|
|
@ -58,9 +58,9 @@ namespace GreenshotImgurPlugin {
|
||||||
|
|
||||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||||
string uploadURL = null;
|
string uploadUrl;
|
||||||
exportInformation.ExportMade = plugin.Upload(captureDetails, surface, out uploadURL);
|
exportInformation.ExportMade = plugin.Upload(captureDetails, surface, out uploadUrl);
|
||||||
exportInformation.Uri = uploadURL;
|
exportInformation.Uri = uploadUrl;
|
||||||
ProcessExport(exportInformation, surface);
|
ProcessExport(exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,11 +54,11 @@ namespace GreenshotPicasaPlugin {
|
||||||
|
|
||||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
||||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||||
string uploadURL = null;
|
string uploadUrl;
|
||||||
bool uploaded = plugin.Upload(captureDetails, surface, out uploadURL);
|
bool uploaded = plugin.Upload(captureDetails, surface, out uploadUrl);
|
||||||
if (uploaded) {
|
if (uploaded) {
|
||||||
exportInformation.ExportMade = true;
|
exportInformation.ExportMade = true;
|
||||||
exportInformation.Uri = uploadURL;
|
exportInformation.Uri = uploadUrl;
|
||||||
}
|
}
|
||||||
ProcessExport(exportInformation, surface);
|
ProcessExport(exportInformation, surface);
|
||||||
return exportInformation;
|
return exportInformation;
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace GreenshotPlugin.Core {
|
||||||
private readonly IAccessible accessible;
|
private readonly IAccessible accessible;
|
||||||
private Accessible[] Children {
|
private Accessible[] Children {
|
||||||
get {
|
get {
|
||||||
int num = 0;
|
int num;
|
||||||
object[] res = GetAccessibleChildren(accessible, out num);
|
object[] res = GetAccessibleChildren(accessible, out num);
|
||||||
if (res == null) {
|
if (res == null) {
|
||||||
return new Accessible[0];
|
return new Accessible[0];
|
||||||
|
|
|
@ -62,9 +62,8 @@ namespace GreenshotPlugin.Core {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
IDictionary<string, object> value = ParseValue(charArray, ref index, ref success) as IDictionary<string, object>;
|
IDictionary<string, object> value = ParseValue(charArray, ref index, ref success) as IDictionary<string, object>;
|
||||||
return value;
|
return value;
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static IDictionary<string, object> ParseObject(char[] json, ref int index, ref bool success) {
|
protected static IDictionary<string, object> ParseObject(char[] json, ref int index, ref bool success) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue