mirror of
https://github.com/greenshot/greenshot
synced 2025-08-13 18:27:03 -07:00
Fixed bug #3599278, which most likely is due to a corrupt/invalid configuration.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2408 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
5a93c10c79
commit
e64b5bfd9f
1 changed files with 5 additions and 4 deletions
|
@ -73,20 +73,21 @@ namespace Greenshot.Processors {
|
||||||
public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails) {
|
public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails) {
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
string title = captureDetails.Title;
|
string title = captureDetails.Title;
|
||||||
LOG.Debug("Title before: " + title);
|
if (!string.IsNullOrEmpty(title)) {
|
||||||
if (title != null && title.Length > 0) {
|
|
||||||
title = title.Trim();
|
title = title.Trim();
|
||||||
foreach(string titleIdentifier in config.ActiveTitleFixes) {
|
foreach(string titleIdentifier in config.ActiveTitleFixes) {
|
||||||
string regexpString = config.TitleFixMatcher[titleIdentifier];
|
string regexpString = config.TitleFixMatcher[titleIdentifier];
|
||||||
string replaceString = config.TitleFixReplacer[titleIdentifier];
|
string replaceString = config.TitleFixReplacer[titleIdentifier];
|
||||||
if (regexpString != null && regexpString.Length > 0) {
|
if (replaceString == null) {
|
||||||
|
replaceString = "";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(regexpString)) {
|
||||||
Regex regex = new Regex(regexpString);
|
Regex regex = new Regex(regexpString);
|
||||||
title = regex.Replace(title, replaceString);
|
title = regex.Replace(title, replaceString);
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG.Debug("Title after: " + title);
|
|
||||||
captureDetails.Title = title;
|
captureDetails.Title = title;
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue