forked from qt-creator/qt-creator
Windows compile fix.
e8b5c6dfcca3fc139049136b42459e7840efed7 :
Provide terminal emulator functionality in ConsoleProcess for
Windows as well.
e833b794b3 :
Use Core::Id().
Change-Id: Idad2bd2180e9a5dd2d1266496e340726435835d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "consoleprocess_p.h"
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
ConsoleProcess::~ConsoleProcess()
|
||||
@@ -137,4 +139,19 @@ QString ConsoleProcess::msgCannotExecute(const QString & p, const QString &why)
|
||||
return tr("Cannot execute '%1': %2").arg(p, why);
|
||||
}
|
||||
|
||||
QString ConsoleProcess::terminalEmulator(const QSettings *settings)
|
||||
{
|
||||
if (settings) {
|
||||
const QString value = settings->value(QLatin1String("General/TerminalEmulator")).toString();
|
||||
if (!value.isEmpty())
|
||||
return value;
|
||||
}
|
||||
return defaultTerminalEmulator();
|
||||
}
|
||||
|
||||
void ConsoleProcess::setTerminalEmulator(QSettings *settings, const QString &term)
|
||||
{
|
||||
return settings->setValue(QLatin1String("General/TerminalEmulator"), term);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -85,11 +85,12 @@ public:
|
||||
static QString createWinCommandline(const QString &program, const QString &args);
|
||||
#else
|
||||
void setSettings(QSettings *settings);
|
||||
#endif
|
||||
|
||||
static QString defaultTerminalEmulator();
|
||||
static QStringList availableTerminalEmulators();
|
||||
static QString terminalEmulator(const QSettings *settings);
|
||||
static void setTerminalEmulator(QSettings *settings, const QString &term);
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void processError(const QString &error);
|
||||
|
||||
@@ -335,18 +335,4 @@ QStringList ConsoleProcess::availableTerminalEmulators()
|
||||
return result;
|
||||
}
|
||||
|
||||
QString ConsoleProcess::terminalEmulator(const QSettings *settings)
|
||||
{
|
||||
if (settings) {
|
||||
const QString value = settings->value(QLatin1String("General/TerminalEmulator")).toString();
|
||||
if (!value.isEmpty())
|
||||
return value;
|
||||
}
|
||||
return defaultTerminalEmulator();
|
||||
}
|
||||
|
||||
void ConsoleProcess::setTerminalEmulator(QSettings *settings, const QString &term)
|
||||
{
|
||||
return settings->setValue(QLatin1String("General/TerminalEmulator"), term);
|
||||
}
|
||||
} // namespace Utils
|
||||
|
||||
@@ -358,4 +358,14 @@ QString ConsoleProcess::createWinCommandline(const QString &program, const QStri
|
||||
return programName;
|
||||
}
|
||||
|
||||
QString ConsoleProcess::defaultTerminalEmulator()
|
||||
{
|
||||
return QString::fromLocal8Bit(qgetenv("COMSPEC"));
|
||||
}
|
||||
|
||||
QStringList ConsoleProcess::availableTerminalEmulators()
|
||||
{
|
||||
return QStringList(ConsoleProcess::defaultTerminalEmulator());
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
@@ -124,7 +124,7 @@ void FileUtils::openTerminal(const QString &path)
|
||||
QString terminalEmulator;
|
||||
QStringList args;
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
terminalEmulator = QString::fromLocal8Bit(qgetenv("COMSPEC"));
|
||||
terminalEmulator = ConsoleProcess::defaultTerminalEmulator();
|
||||
} else if (HostOsInfo::isMacHost()) {
|
||||
terminalEmulator = ICore::resourcePath()
|
||||
+ QLatin1String("/scripts/openTerminal.command");
|
||||
|
||||
@@ -5378,7 +5378,7 @@ bool GdbEngine::prepareCommand()
|
||||
// perr == BadQuoting is never returned on Windows
|
||||
// FIXME? QTCREATORBUG-2809
|
||||
handleAdapterStartFailed(QCoreApplication::translate("DebuggerEngine", // Same message in CdbEngine
|
||||
"Debugging complex command lines is currently not supported on Windows."), QString());
|
||||
"Debugging complex command lines is currently not supported on Windows."), Core::Id());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user