summaryrefslogtreecommitdiff
path: root/src/plugins/perforce/perforcesettings.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2012-08-21 14:45:42 +0300
committerTobias Hunger <tobias.hunger@nokia.com>2012-08-21 15:31:51 +0200
commit7ffc4349f8f13c587e0d9de3842babe1fe1c2a78 (patch)
tree6958072e0ad21cf6ac3be81c5807abaaad324117 /src/plugins/perforce/perforcesettings.cpp
parent2e98952068850d9b71385fb64180a836829cdb05 (diff)
downloadqt-creator-7ffc4349f8f13c587e0d9de3842babe1fe1c2a78.tar.gz
VCS: Allow use of base name for executable
Actual path is found on startup and when setting is changed Change-Id: If2cb0735953b9fb64df7425230c98efb384d9287 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Diffstat (limited to 'src/plugins/perforce/perforcesettings.cpp')
-rw-r--r--src/plugins/perforce/perforcesettings.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp
index 414daf350e..2dcd24f9e5 100644
--- a/src/plugins/perforce/perforcesettings.cpp
+++ b/src/plugins/perforce/perforcesettings.cpp
@@ -57,13 +57,12 @@ enum { defaultTimeOutS = 30, defaultLogCount = 1000 };
static QString defaultCommand()
{
- Utils::Environment env = Utils::Environment::systemEnvironment();
QString rc;
rc = QLatin1String("p4");
#if defined(Q_OS_WIN32)
rc.append(QLatin1String(".exe"));
#endif
- return env.searchInPath(rc);
+ return rc;
}
namespace Perforce {
@@ -115,6 +114,7 @@ void PerforceSettings::fromSettings(QSettings *settings)
{
settings->beginGroup(QLatin1String(groupC));
m_settings.p4Command = settings->value(QLatin1String(commandKeyC), defaultCommand()).toString();
+ m_settings.p4BinaryPath = Utils::Environment::systemEnvironment().searchInPath(m_settings.p4Command);
m_settings.defaultEnv = settings->value(QLatin1String(defaultKeyC), true).toBool();
m_settings.p4Port = settings->value(QLatin1String(portKeyC), QString()).toString();
m_settings.p4Client = settings->value(QLatin1String(clientKeyC), QString()).toString();
@@ -159,6 +159,11 @@ QString PerforceSettings::p4Command() const
return m_settings.p4Command;
}
+QString PerforceSettings::p4BinaryPath() const
+{
+ return m_settings.p4BinaryPath;
+}
+
QString PerforceSettings::p4Port() const
{
return m_settings.p4Port;