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();
|
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 Internal
|
||||||
} // namespace BareMetal
|
} // namespace BareMetal
|
||||||
|
@@ -133,7 +133,6 @@ private:
|
|||||||
void setFromToolChain();
|
void setFromToolChain();
|
||||||
void handleCompilerCommandChange();
|
void handleCompilerCommandChange();
|
||||||
void handlePlatformCodeGenFlagsChange();
|
void handlePlatformCodeGenFlagsChange();
|
||||||
QStringList splitString(const QString &s) const;
|
|
||||||
|
|
||||||
Utils::PathChooser *m_compilerCommand = nullptr;
|
Utils::PathChooser *m_compilerCommand = nullptr;
|
||||||
ProjectExplorer::AbiWidget *m_abiWidget = nullptr;
|
ProjectExplorer::AbiWidget *m_abiWidget = nullptr;
|
||||||
|
@@ -1332,22 +1332,6 @@ void GccToolChainConfigWidget::makeReadOnlyImpl()
|
|||||||
m_isReadOnly = true;
|
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()
|
void GccToolChainConfigWidget::handleCompilerCommandChange()
|
||||||
{
|
{
|
||||||
if (!m_abiWidget)
|
if (!m_abiWidget)
|
||||||
|
@@ -77,7 +77,6 @@ class GccToolChainConfigWidget : public ToolChainConfigWidget
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GccToolChainConfigWidget(GccToolChain *tc);
|
explicit GccToolChainConfigWidget(GccToolChain *tc);
|
||||||
static QStringList splitString(const QString &s);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void handleCompilerCommandChange();
|
void handleCompilerCommandChange();
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <utils/detailswidget.h>
|
#include <utils/detailswidget.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
@@ -125,4 +126,20 @@ void ToolChainConfigWidget::clearErrorMessage()
|
|||||||
m_errorLabel->setVisible(false);
|
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
|
} // namespace ProjectExplorer
|
||||||
|
@@ -71,6 +71,7 @@ protected:
|
|||||||
virtual void makeReadOnlyImpl() = 0;
|
virtual void makeReadOnlyImpl() = 0;
|
||||||
|
|
||||||
void addErrorLabel();
|
void addErrorLabel();
|
||||||
|
static QStringList splitString(const QString &s);
|
||||||
QFormLayout *m_mainLayout;
|
QFormLayout *m_mainLayout;
|
||||||
QLineEdit *m_nameLineEdit;
|
QLineEdit *m_nameLineEdit;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user