diff ui/processhelp_win.cpp @ 608:81a44b93229e

Be more permissive with process names. Case insenstive and with suffix or not.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 18 Jun 2014 11:22:15 +0200
parents 91dd38a71783
children 175370634226
line wrap: on
line diff
--- a/ui/processhelp_win.cpp	Wed Jun 18 11:21:13 2014 +0200
+++ b/ui/processhelp_win.cpp	Wed Jun 18 11:22:15 2014 +0200
@@ -102,8 +102,12 @@
 
     pids.clear();
 
+    const QString processNameLower = processName.toLower().replace(".exe", "");
+    const QString processNameExe = processNameLower + ".exe";
+
     do {
-        if (QString::fromWCharArray(pe32.szExeFile) == processName) {
+        const QString exeFile = QString::fromWCharArray(pe32.szExeFile).toLower();
+        if (exeFile == processNameLower || exeFile == processNameExe) {
             PSID user_sid = getProcessOwner(GetCurrentProcess());
             if (user_sid) {
                 // Also check that we are the owner of that process

http://wald.intevation.org/projects/trustbridge/