forked from qt-creator/qt-creator
Utils: Introduce HostOsInfo class.
The class' member functions are intended to be used instead of the Q_OS_* macros in all contexts where the latter are not syntactically required. This lowers the likelihood of changes made on one platform breaking the build on another, e.g. due to the code model missing symbols in #ifdef'ed out code when refactoring. Change-Id: I4a54788591b4c8f8d589b8368a6c683d4155c9fa Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
|
||||
#include "commonvcssettings.h"
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
#include <QSettings>
|
||||
#include <QDebug>
|
||||
|
||||
@@ -52,11 +54,9 @@ static inline QString sshPasswordPromptDefault()
|
||||
const QByteArray envSetting = qgetenv("SSH_ASKPASS");
|
||||
if (!envSetting.isEmpty())
|
||||
return QString::fromLocal8Bit(envSetting);
|
||||
#ifdef Q_OS_WIN
|
||||
return QLatin1String("win-ssh-askpass");
|
||||
#else
|
||||
if (Utils::HostOsInfo::isWindowsHost())
|
||||
return QLatin1String("win-ssh-askpass");
|
||||
return QLatin1String("ssh-askpass");
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace VcsBase {
|
||||
|
||||
Reference in New Issue
Block a user