summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xqtc18
1 files changed, 14 insertions, 4 deletions
diff --git a/qtc b/qtc
index 93c5d24c2475..274ad5a13869 100755
--- a/qtc
+++ b/qtc
@@ -1,19 +1,29 @@
#!/usr/bin/env bash
+#set -x
+
+qtcreator_bin=qtcreator
+
if [[ "$(uname -s)" = "Darwin" ]]; then
open -a "Qt Creator" $@
else
- pid=$(pidof qtcreator-bin)
+ # As of Qt Creator 4
+ pid=$(pidof $qtcreator_bin)
+ if [[ "${pid}" = "" ]]; then
+ # Check for legacy versions
+ qtcreator_bin=qtcreator-bin
+ pid=$(pidof $qtcreator_bin)
+ fi
# find existing creator instance
if [[ "${pid}" != "" ]]; then
- creatorbin=$(ls -l /proc/${pid}/exe | awk '{ print $11 }')
- ${creatorbin} -client $@
+ resident_qtcreator_bin=$(ls -l /proc/${pid}/exe | awk '{ print $11 }')
+ ${resident_qtcreator_bin} -client $@
exit 0
fi
# failing that run the creator in your path
- qtcreator $@
+ $qtcreator_bin $@
fi
exit 0