forked from qt-creator/qt-creator
Move splitString() method to base ToolChainConfigWidget
Change-Id: I382b5ad33e167356be19260454934940ae6d2d96 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -868,21 +868,5 @@ void KeilToolChainConfigWidget::handlePlatformCodeGenFlagsChange()
|
||||
handleCompilerCommandChange();
|
||||
}
|
||||
|
||||
QStringList KeilToolChainConfigWidget::splitString(const QString &s) const
|
||||
{
|
||||
QtcProcess::SplitError splitError;
|
||||
const OsType osType = HostOsInfo::hostOs();
|
||||
QStringList res = QtcProcess::splitArgs(s, osType, false, &splitError);
|
||||
if (splitError != QtcProcess::SplitOk){
|
||||
res = QtcProcess::splitArgs(s + '\\', osType, false, &splitError);
|
||||
if (splitError != QtcProcess::SplitOk){
|
||||
res = QtcProcess::splitArgs(s + '"', osType, false, &splitError);
|
||||
if (splitError != QtcProcess::SplitOk)
|
||||
res = QtcProcess::splitArgs(s + '\'', osType, false, &splitError);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace BareMetal
|
||||
|
@@ -133,7 +133,6 @@ private:
|
||||
void setFromToolChain();
|
||||
void handleCompilerCommandChange();
|
||||
void handlePlatformCodeGenFlagsChange();
|
||||
QStringList splitString(const QString &s) const;
|
||||
|
||||
Utils::PathChooser *m_compilerCommand = nullptr;
|
||||
ProjectExplorer::AbiWidget *m_abiWidget = nullptr;
|
||||
|
@@ -1332,22 +1332,6 @@ void GccToolChainConfigWidget::makeReadOnlyImpl()
|
||||
m_isReadOnly = true;
|
||||
}
|
||||
|
||||
QStringList GccToolChainConfigWidget::splitString(const QString &s)
|
||||
{
|
||||
QtcProcess::SplitError splitError;
|
||||
const OsType osType = HostOsInfo::hostOs();
|
||||
QStringList res = QtcProcess::splitArgs(s, osType, false, &splitError);
|
||||
if (splitError != QtcProcess::SplitOk){
|
||||
res = QtcProcess::splitArgs(s + '\\', osType, false, &splitError);
|
||||
if (splitError != QtcProcess::SplitOk){
|
||||
res = QtcProcess::splitArgs(s + '"', osType, false, &splitError);
|
||||
if (splitError != QtcProcess::SplitOk)
|
||||
res = QtcProcess::splitArgs(s + '\'', osType, false, &splitError);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
void GccToolChainConfigWidget::handleCompilerCommandChange()
|
||||
{
|
||||
if (!m_abiWidget)
|
||||
|
@@ -77,7 +77,6 @@ class GccToolChainConfigWidget : public ToolChainConfigWidget
|
||||
|
||||
public:
|
||||
explicit GccToolChainConfigWidget(GccToolChain *tc);
|
||||
static QStringList splitString(const QString &s);
|
||||
|
||||
protected:
|
||||
void handleCompilerCommandChange();
|
||||
|
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QString>
|
||||
|
||||
@@ -125,4 +126,20 @@ void ToolChainConfigWidget::clearErrorMessage()
|
||||
m_errorLabel->setVisible(false);
|
||||
}
|
||||
|
||||
QStringList ToolChainConfigWidget::splitString(const QString &s)
|
||||
{
|
||||
Utils::QtcProcess::SplitError splitError;
|
||||
const Utils::OsType osType = Utils::HostOsInfo::hostOs();
|
||||
QStringList res = Utils::QtcProcess::splitArgs(s, osType, false, &splitError);
|
||||
if (splitError != Utils::QtcProcess::SplitOk){
|
||||
res = Utils::QtcProcess::splitArgs(s + '\\', osType, false, &splitError);
|
||||
if (splitError != Utils::QtcProcess::SplitOk){
|
||||
res = Utils::QtcProcess::splitArgs(s + '"', osType, false, &splitError);
|
||||
if (splitError != Utils::QtcProcess::SplitOk)
|
||||
res = Utils::QtcProcess::splitArgs(s + '\'', osType, false, &splitError);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
@@ -71,6 +71,7 @@ protected:
|
||||
virtual void makeReadOnlyImpl() = 0;
|
||||
|
||||
void addErrorLabel();
|
||||
static QStringList splitString(const QString &s);
|
||||
QFormLayout *m_mainLayout;
|
||||
QLineEdit *m_nameLineEdit;
|
||||
|
||||
|
Reference in New Issue
Block a user