Commit 78b06e7c authored by Tobias Hunger's avatar Tobias Hunger
Browse files

P4: Do not complain about P4 when it is not installed

Remove warning message about P4 when that is not installed.

Task-number: QTCREATORBUG-3382
parent 49710f39
......@@ -36,6 +36,7 @@
#include "perforceconstants.h"
#include <utils/qtcassert.h>
#include <utils/environment.h>
#include <QtCore/QSettings>
#include <QtCore/QStringList>
......@@ -58,12 +59,13 @@ 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 rc;
return env.searchInPath(rc);
}
namespace Perforce {
......
......@@ -91,7 +91,10 @@ public:
PerforceSettings();
~PerforceSettings();
inline bool isValid() const { return !m_topLevel.isEmpty(); }
inline bool isValid() const
{
return !m_topLevel.isEmpty() && !m_settings.p4Command.isEmpty();
}
void fromSettings(QSettings *settings);
void toSettings(QSettings *) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment