diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-08-14 09:54:12 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-08-14 09:54:12 +0200 |
commit | e419da059974933deec16a597f5888ade27d8617 (patch) | |
tree | b9840bf434a6256a90b81b43b773fc67d0d6910d /opentrack-compat/process-list.hpp | |
parent | 1ebfd95dce50db4fa9523a26aba1f80e4ff5db52 (diff) |
run basename on Linux process detector
Diffstat (limited to 'opentrack-compat/process-list.hpp')
-rwxr-xr-x | opentrack-compat/process-list.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/opentrack-compat/process-list.hpp b/opentrack-compat/process-list.hpp index 6b139739..7dd206ab 100755 --- a/opentrack-compat/process-list.hpp +++ b/opentrack-compat/process-list.hpp @@ -141,7 +141,12 @@ static QStringList get_all_executable_names() // note, wine sets argv[0] so no parsing like in OSX case auto proc = procs[i]; if (proc->cmdline && proc->cmdline[0]) - ret.append(proc->cmdline[0]); + { + QString tmp(proc->cmdline[0]); + const int idx = std::max(tmp.lastIndexOf('\\'), tmp.lastIndexOf('/')); + tmp = tmp.mid(idx == -1 ? 0 : idx+1); + ret.append(tmp); + } freeproc(procs[i]); } free(procs); |