forked from qt-creator/qt-creator
Compile autotools-plugin with QT_NO_CAST_FROM_ASCII.
Change-Id: If8928c5d2d878339aa3a7808655f8125e0a012cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
@@ -84,7 +84,7 @@ bool AutogenStepFactory::canCreate(BuildStepList *parent, const QString &id) con
|
|||||||
if (parent->target()->project()->id() != QLatin1String(Constants::AUTOTOOLS_PROJECT_ID))
|
if (parent->target()->project()->id() != QLatin1String(Constants::AUTOTOOLS_PROJECT_ID))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
if (parent->id() != QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_BUILD))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return QLatin1String(AUTOGEN_STEP_ID) == id;
|
return QLatin1String(AUTOGEN_STEP_ID) == id;
|
||||||
@@ -282,7 +282,7 @@ void AutogenStepConfigWidget::updateDetails()
|
|||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(bc->macroExpander());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(bc->environment());
|
||||||
param.setWorkingDirectory(bc->buildDirectory());
|
param.setWorkingDirectory(bc->buildDirectory());
|
||||||
param.setCommand("autogen.sh");
|
param.setCommand(QLatin1String("autogen.sh"));
|
||||||
param.setArguments(m_autogenStep->additionalArguments());
|
param.setArguments(m_autogenStep->additionalArguments());
|
||||||
m_summaryText = param.summary(displayName());
|
m_summaryText = param.summary(displayName());
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
|
@@ -83,7 +83,7 @@ bool AutoreconfStepFactory::canCreate(BuildStepList *parent, const QString &id)
|
|||||||
if (parent->target()->project()->id() != QLatin1String(Constants::AUTOTOOLS_PROJECT_ID))
|
if (parent->target()->project()->id() != QLatin1String(Constants::AUTOTOOLS_PROJECT_ID))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
if (parent->id() != QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_BUILD))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return QLatin1String(AUTORECONF_STEP_ID) == id;
|
return QLatin1String(AUTORECONF_STEP_ID) == id;
|
||||||
@@ -166,7 +166,7 @@ bool AutoreconfStep::init()
|
|||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(bc->macroExpander());
|
||||||
pp->setEnvironment(bc->environment());
|
pp->setEnvironment(bc->environment());
|
||||||
pp->setWorkingDirectory(bc->buildDirectory());
|
pp->setWorkingDirectory(bc->buildDirectory());
|
||||||
pp->setCommand("autoreconf");
|
pp->setCommand(QLatin1String("autoreconf"));
|
||||||
pp->setArguments(additionalArguments());
|
pp->setArguments(additionalArguments());
|
||||||
|
|
||||||
return AbstractProcessStep::init();
|
return AbstractProcessStep::init();
|
||||||
@@ -276,7 +276,7 @@ void AutoreconfStepConfigWidget::updateDetails()
|
|||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(bc->macroExpander());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(bc->environment());
|
||||||
param.setWorkingDirectory(bc->buildDirectory());
|
param.setWorkingDirectory(bc->buildDirectory());
|
||||||
param.setCommand("autoreconf");
|
param.setCommand(QLatin1String("autoreconf"));
|
||||||
param.setArguments(m_autoreconfStep->additionalArguments());
|
param.setArguments(m_autoreconfStep->additionalArguments());
|
||||||
m_summaryText = param.summary(displayName());
|
m_summaryText = param.summary(displayName());
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
|
@@ -170,7 +170,7 @@ AutotoolsBuildConfiguration *AutotoolsBuildConfigurationFactory::create(Target *
|
|||||||
bc->setDisplayName(buildConfigurationName);
|
bc->setDisplayName(buildConfigurationName);
|
||||||
|
|
||||||
t->addBuildConfiguration(bc);
|
t->addBuildConfiguration(bc);
|
||||||
t->addDeployConfiguration(t->createDeployConfiguration(DEFAULT_DEPLOYCONFIGURATION_ID));
|
t->addDeployConfiguration(t->createDeployConfiguration(QLatin1String(DEFAULT_DEPLOYCONFIGURATION_ID)));
|
||||||
// User needs to choose where the executable file is.
|
// User needs to choose where the executable file is.
|
||||||
// TODO: Parse the file in *Anjuta style* to be able to add custom RunConfigurations.
|
// TODO: Parse the file in *Anjuta style* to be able to add custom RunConfigurations.
|
||||||
t->addRunConfiguration(new CustomExecutableRunConfiguration(t));
|
t->addRunConfiguration(new CustomExecutableRunConfiguration(t));
|
||||||
@@ -181,7 +181,7 @@ AutotoolsBuildConfiguration *AutotoolsBuildConfigurationFactory::create(Target *
|
|||||||
AutotoolsBuildConfiguration *AutotoolsBuildConfigurationFactory::createDefaultConfiguration(AutotoolsTarget *target) const
|
AutotoolsBuildConfiguration *AutotoolsBuildConfigurationFactory::createDefaultConfiguration(AutotoolsTarget *target) const
|
||||||
{
|
{
|
||||||
AutotoolsBuildConfiguration *bc = new AutotoolsBuildConfiguration(target);
|
AutotoolsBuildConfiguration *bc = new AutotoolsBuildConfiguration(target);
|
||||||
BuildStepList *buildSteps = bc->stepList(BUILDSTEPS_BUILD);
|
BuildStepList *buildSteps = bc->stepList(QLatin1String(BUILDSTEPS_BUILD));
|
||||||
|
|
||||||
// ### Build Steps Build ###
|
// ### Build Steps Build ###
|
||||||
// autogen.sh or autoreconf
|
// autogen.sh or autoreconf
|
||||||
@@ -205,7 +205,7 @@ AutotoolsBuildConfiguration *AutotoolsBuildConfigurationFactory::createDefaultCo
|
|||||||
makeStep->setBuildTarget(QLatin1String("all"), /*on =*/ true);
|
makeStep->setBuildTarget(QLatin1String("all"), /*on =*/ true);
|
||||||
|
|
||||||
// ### Build Steps Clean ###
|
// ### Build Steps Clean ###
|
||||||
BuildStepList *cleanSteps = bc->stepList(BUILDSTEPS_CLEAN);
|
BuildStepList *cleanSteps = bc->stepList(QLatin1String(BUILDSTEPS_CLEAN));
|
||||||
MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
|
MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
|
||||||
cleanMakeStep->setAdditionalArguments(QLatin1String("clean"));
|
cleanMakeStep->setAdditionalArguments(QLatin1String("clean"));
|
||||||
cleanMakeStep->setClean(true);
|
cleanMakeStep->setClean(true);
|
||||||
|
@@ -312,7 +312,7 @@ void AutotoolsProject::makefileParsingFinished()
|
|||||||
|
|
||||||
// Add configure.ac file to project and watch for changes.
|
// Add configure.ac file to project and watch for changes.
|
||||||
const QLatin1String configureAc(QLatin1String("configure.ac"));
|
const QLatin1String configureAc(QLatin1String("configure.ac"));
|
||||||
const QFile configureAcFile(fileInfo.absolutePath() + QChar('/') + configureAc);
|
const QFile configureAcFile(fileInfo.absolutePath() + QLatin1Char('/') + configureAc);
|
||||||
if (configureAcFile.exists()) {
|
if (configureAcFile.exists()) {
|
||||||
files.append(configureAc);
|
files.append(configureAc);
|
||||||
const QString configureAcFilePath = dir.absoluteFilePath(configureAc);
|
const QString configureAcFilePath = dir.absoluteFilePath(configureAc);
|
||||||
@@ -363,13 +363,10 @@ void AutotoolsProject::buildFileNodeTree(const QDir &directory,
|
|||||||
if (file.contains(QLatin1String(".moc")))
|
if (file.contains(QLatin1String(".moc")))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString subDir = baseDir + QChar('/') + file;
|
QString subDir = baseDir + QLatin1Char('/') + file;
|
||||||
for (int i = subDir.length() - 1; i >= 0; --i) {
|
const int lastSlashPos = subDir.lastIndexOf(QLatin1Char('/'));
|
||||||
if (subDir.at(i) == QChar('/')) {
|
if (lastSlashPos != -1)
|
||||||
subDir = subDir.left(i);
|
subDir.truncate(lastSlashPos);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add folder nodes, that are not already available
|
// Add folder nodes, that are not already available
|
||||||
oldParentFolder = parentFolder;
|
oldParentFolder = parentFolder;
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = AutotoolsProjectManager
|
TARGET = AutotoolsProjectManager
|
||||||
#PROVIDER = Openismus
|
#PROVIDER = Openismus
|
||||||
|
DEFINES += QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
include(autotoolsprojectmanager_dependencies.pri)
|
include(autotoolsprojectmanager_dependencies.pri)
|
||||||
|
@@ -146,10 +146,10 @@ AutotoolsTarget *AutotoolsTargetFactory::create(Project *parent, const QString &
|
|||||||
// Add default build configuration:
|
// Add default build configuration:
|
||||||
AutotoolsBuildConfigurationFactory *bcf = t->buildConfigurationFactory();
|
AutotoolsBuildConfigurationFactory *bcf = t->buildConfigurationFactory();
|
||||||
AutotoolsBuildConfiguration *bc = bcf->createDefaultConfiguration(t);
|
AutotoolsBuildConfiguration *bc = bcf->createDefaultConfiguration(t);
|
||||||
bc->setDisplayName("Default Build");
|
bc->setDisplayName(tr("Default Build"));
|
||||||
|
|
||||||
t->addBuildConfiguration(bc);
|
t->addBuildConfiguration(bc);
|
||||||
t->addDeployConfiguration(t->createDeployConfiguration(ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID));
|
t->addDeployConfiguration(t->createDeployConfiguration(QLatin1String(ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID)));
|
||||||
// User needs to choose where the executable file is.
|
// User needs to choose where the executable file is.
|
||||||
// TODO: Parse the file in *Anjuta style* to be able to add custom RunConfigurations.
|
// TODO: Parse the file in *Anjuta style* to be able to add custom RunConfigurations.
|
||||||
t->addRunConfiguration(new CustomExecutableRunConfiguration(t));
|
t->addRunConfiguration(new CustomExecutableRunConfiguration(t));
|
||||||
|
@@ -84,7 +84,7 @@ bool ConfigureStepFactory::canCreate(BuildStepList *parent, const QString &id) c
|
|||||||
if (parent->target()->project()->id() != QLatin1String(Constants::AUTOTOOLS_PROJECT_ID))
|
if (parent->target()->project()->id() != QLatin1String(Constants::AUTOTOOLS_PROJECT_ID))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
if (parent->id() != QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_BUILD))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return QLatin1String(CONFIGURE_STEP_ID) == id;
|
return QLatin1String(CONFIGURE_STEP_ID) == id;
|
||||||
@@ -167,7 +167,7 @@ bool ConfigureStep::init()
|
|||||||
pp->setMacroExpander(bc->macroExpander());
|
pp->setMacroExpander(bc->macroExpander());
|
||||||
pp->setEnvironment(bc->environment());
|
pp->setEnvironment(bc->environment());
|
||||||
pp->setWorkingDirectory(bc->buildDirectory());
|
pp->setWorkingDirectory(bc->buildDirectory());
|
||||||
pp->setCommand("configure");
|
pp->setCommand(QLatin1String("configure"));
|
||||||
pp->setArguments(additionalArguments());
|
pp->setArguments(additionalArguments());
|
||||||
|
|
||||||
return AbstractProcessStep::init();
|
return AbstractProcessStep::init();
|
||||||
@@ -280,7 +280,7 @@ void ConfigureStepConfigWidget::updateDetails()
|
|||||||
param.setMacroExpander(bc->macroExpander());
|
param.setMacroExpander(bc->macroExpander());
|
||||||
param.setEnvironment(bc->environment());
|
param.setEnvironment(bc->environment());
|
||||||
param.setWorkingDirectory(bc->buildDirectory());
|
param.setWorkingDirectory(bc->buildDirectory());
|
||||||
param.setCommand("configure");
|
param.setCommand(QLatin1String("configure"));
|
||||||
param.setArguments(m_configureStep->additionalArguments());
|
param.setArguments(m_configureStep->additionalArguments());
|
||||||
m_summaryText = param.summary(displayName());
|
m_summaryText = param.summary(displayName());
|
||||||
emit updateSummary();
|
emit updateSummary();
|
||||||
|
@@ -134,7 +134,7 @@ MakefileParser::TopTarget MakefileParser::topTarget() const
|
|||||||
TopTarget topTarget = Undefined;
|
TopTarget topTarget = Undefined;
|
||||||
|
|
||||||
const QString line = m_line.simplified();
|
const QString line = m_line.simplified();
|
||||||
if (!line.isEmpty() && !line.startsWith(QChar('#'))) {
|
if (!line.isEmpty() && !line.startsWith(QLatin1Char('#'))) {
|
||||||
// TODO: Check how many fixed strings like AM_DEFAULT_SOURCE_EXT will
|
// TODO: Check how many fixed strings like AM_DEFAULT_SOURCE_EXT will
|
||||||
// be needed vs. variable strings like _SOURCES. Dependent on this a
|
// be needed vs. variable strings like _SOURCES. Dependent on this a
|
||||||
// more clever way than this (expensive) if-cascading might be done.
|
// more clever way than this (expensive) if-cascading might be done.
|
||||||
@@ -236,7 +236,7 @@ void MakefileParser::parseSubDirs()
|
|||||||
QStringList::iterator it = subDirs.begin();
|
QStringList::iterator it = subDirs.begin();
|
||||||
while (it != subDirs.end()) {
|
while (it != subDirs.end()) {
|
||||||
// Erase all entries that represent a '.'
|
// Erase all entries that represent a '.'
|
||||||
if ((*it) == QChar('.')) {
|
if ((*it) == QLatin1String(".")) {
|
||||||
hasDotSubDir = true;
|
hasDotSubDir = true;
|
||||||
it = subDirs.erase(it);
|
it = subDirs.erase(it);
|
||||||
} else {
|
} else {
|
||||||
@@ -256,7 +256,7 @@ void MakefileParser::parseSubDirs()
|
|||||||
// Delegate the parsing of all sub directories to a local
|
// Delegate the parsing of all sub directories to a local
|
||||||
// makefile parser and merge the results
|
// makefile parser and merge the results
|
||||||
foreach (const QString& subDir, subDirs) {
|
foreach (const QString& subDir, subDirs) {
|
||||||
const QChar slash('/');
|
const QChar slash = QLatin1Char('/');
|
||||||
const QString subDirMakefile = path + slash + subDir
|
const QString subDirMakefile = path + slash + subDir
|
||||||
+ slash + makefileName;
|
+ slash + makefileName;
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ QStringList MakefileParser::directorySources(const QString &directory,
|
|||||||
extensions);
|
extensions);
|
||||||
const QString dirPath = info.fileName();
|
const QString dirPath = info.fileName();
|
||||||
foreach (const QString& subDirSource, subDirSources)
|
foreach (const QString& subDirSource, subDirSources)
|
||||||
list.append(dirPath + QChar('/') + subDirSource);
|
list.append(dirPath + QLatin1Char('/') + subDirSource);
|
||||||
} else {
|
} else {
|
||||||
// Check whether the file matches to an extension
|
// Check whether the file matches to an extension
|
||||||
foreach (const QString& extension, extensions) {
|
foreach (const QString& extension, extensions) {
|
||||||
@@ -339,7 +339,7 @@ QStringList MakefileParser::targetValues(bool *hasVariables)
|
|||||||
if (hasVariables != 0)
|
if (hasVariables != 0)
|
||||||
*hasVariables = false;
|
*hasVariables = false;
|
||||||
|
|
||||||
const int index = m_line.indexOf(QChar('='));
|
const int index = m_line.indexOf(QLatin1Char('='));
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
m_success = false;
|
m_success = false;
|
||||||
return QStringList();
|
return QStringList();
|
||||||
@@ -354,7 +354,7 @@ QStringList MakefileParser::targetValues(bool *hasVariables)
|
|||||||
// Get all values of a line separated by spaces.
|
// Get all values of a line separated by spaces.
|
||||||
// Values representing a variable like $(value) get
|
// Values representing a variable like $(value) get
|
||||||
// removed currently.
|
// removed currently.
|
||||||
QStringList lineValues = m_line.split(QChar(' '));
|
QStringList lineValues = m_line.split(QLatin1Char(' '));
|
||||||
QStringList::iterator it = lineValues.begin();
|
QStringList::iterator it = lineValues.begin();
|
||||||
while (it != lineValues.end()) {
|
while (it != lineValues.end()) {
|
||||||
if ((*it).startsWith(QLatin1String("$("))) {
|
if ((*it).startsWith(QLatin1String("$("))) {
|
||||||
@@ -368,7 +368,7 @@ QStringList MakefileParser::targetValues(bool *hasVariables)
|
|||||||
|
|
||||||
endReached = lineValues.isEmpty();
|
endReached = lineValues.isEmpty();
|
||||||
if (!endReached) {
|
if (!endReached) {
|
||||||
const QChar backSlash('\\');
|
const QChar backSlash = QLatin1Char('\\');
|
||||||
QString last = lineValues.last();
|
QString last = lineValues.last();
|
||||||
if (last.endsWith(backSlash)) {
|
if (last.endsWith(backSlash)) {
|
||||||
// The last value contains a backslash. Remove the
|
// The last value contains a backslash. Remove the
|
||||||
|
@@ -87,7 +87,7 @@ bool MakeStepFactory::canCreate(BuildStepList *parent, const QString &id) const
|
|||||||
if (parent->target()->project()->id() != QLatin1String(AUTOTOOLS_PROJECT_ID))
|
if (parent->target()->project()->id() != QLatin1String(AUTOTOOLS_PROJECT_ID))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (parent->id() != BUILDSTEPS_BUILD)
|
if (parent->id() != QLatin1String(BUILDSTEPS_BUILD))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return QLatin1String(MAKE_STEP_ID) == id;
|
return QLatin1String(MAKE_STEP_ID) == id;
|
||||||
|
Reference in New Issue
Block a user