From 2c1a56e868e80424d0dbf12aa36a0476fbdb7530 Mon Sep 17 00:00:00 2001 From: RKrom Date: Wed, 27 Feb 2013 17:19:52 +0000 Subject: [PATCH] Added title in Imgur upload as optional to the configuration git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2510 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotImgurPlugin/ImgurConfiguration.cs | 4 ++++ GreenshotImgurPlugin/ImgurUtils.cs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/GreenshotImgurPlugin/ImgurConfiguration.cs b/GreenshotImgurPlugin/ImgurConfiguration.cs index ba735859f..93ff9193c 100644 --- a/GreenshotImgurPlugin/ImgurConfiguration.cs +++ b/GreenshotImgurPlugin/ImgurConfiguration.cs @@ -47,6 +47,10 @@ namespace GreenshotImgurPlugin { public string ImgurToken; [IniProperty("ImgurTokenSecret", Description = "The Imgur token secret", Encrypted=true, ExcludeIfNull=true)] public string ImgurTokenSecret; + [IniProperty("AddTitle", Description = "Is the title passed on to Imgur", DefaultValue = "True")] + public bool AddTitle; + [IniProperty("AddFilename", Description = "Is the filename passed on to Imgur", DefaultValue = "True")] + public bool AddFilename; [IniProperty("ImgurUploadHistory", Description="Imgur upload history (ImgurUploadHistory.hash=deleteHash)")] public Dictionary ImgurUploadHistory; diff --git a/GreenshotImgurPlugin/ImgurUtils.cs b/GreenshotImgurPlugin/ImgurUtils.cs index e90278128..ab380d4cb 100644 --- a/GreenshotImgurPlugin/ImgurUtils.cs +++ b/GreenshotImgurPlugin/ImgurUtils.cs @@ -103,11 +103,11 @@ namespace GreenshotImgurPlugin { IDictionary uploadParameters = new Dictionary(); IDictionary otherParameters = new Dictionary(); // add title - if (title != null) { + if (title != null && config.AddTitle) { otherParameters.Add("title", title); } // add filename - if (filename != null) { + if (filename != null && config.AddFilename) { otherParameters.Add("name", filename); } string responseString = null;