forked from qt-creator/qt-creator
Always pass Core::Id by value.
Currently we pass in some places by value, elsewhere by const ref and for some weird reason also by const value in a lot of places. The latter is particularly annoying, as it is also used in interfaces and therefore forces all implementors to do the same, since leaving the "const" off is causing compiler warnings with MSVC. Change-Id: I65b87dc3cce0986b8a55ff6119cb752361027803 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -46,7 +46,7 @@ CMakeFileCompletionAssistProvider::CMakeFileCompletionAssistProvider(CMakeSettin
|
||||
CMakeFileCompletionAssistProvider::~CMakeFileCompletionAssistProvider()
|
||||
{}
|
||||
|
||||
bool CMakeFileCompletionAssistProvider::supportsEditor(const Core::Id &editorId) const
|
||||
bool CMakeFileCompletionAssistProvider::supportsEditor(Core::Id editorId) const
|
||||
{
|
||||
return editorId == CMakeProjectManager::Constants::CMAKE_EDITOR_ID;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
CMakeFileCompletionAssistProvider(CMakeSettingsPage *settingsPage);
|
||||
~CMakeFileCompletionAssistProvider();
|
||||
|
||||
bool supportsEditor(const Core::Id &editorId) const;
|
||||
bool supportsEditor(Core::Id editorId) const;
|
||||
TextEditor::IAssistProcessor *createProcessor() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -365,7 +365,7 @@ QList<Core::Id> CMakeRunConfigurationFactory::availableCreationIds(Target *paren
|
||||
}
|
||||
|
||||
// used to translate the ids to names to display to the user
|
||||
QString CMakeRunConfigurationFactory::displayNameForId(const Core::Id id) const
|
||||
QString CMakeRunConfigurationFactory::displayNameForId(Core::Id id) const
|
||||
{
|
||||
return buildTargetFromId(id);
|
||||
}
|
||||
@@ -377,7 +377,7 @@ bool CMakeRunConfigurationFactory::canHandle(Target *parent) const
|
||||
return qobject_cast<CMakeProject *>(parent->project());
|
||||
}
|
||||
|
||||
bool CMakeRunConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
||||
bool CMakeRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
|
||||
{
|
||||
if (!canHandle(parent))
|
||||
return false;
|
||||
@@ -385,7 +385,7 @@ bool CMakeRunConfigurationFactory::canCreate(Target *parent, const Core::Id id)
|
||||
return project->hasBuildTarget(buildTargetFromId(id));
|
||||
}
|
||||
|
||||
RunConfiguration *CMakeRunConfigurationFactory::doCreate(Target *parent, const Core::Id id)
|
||||
RunConfiguration *CMakeRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
|
||||
{
|
||||
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
|
||||
const QString title(buildTargetFromId(id));
|
||||
|
||||
@@ -133,13 +133,13 @@ public:
|
||||
explicit CMakeRunConfigurationFactory(QObject *parent = 0);
|
||||
~CMakeRunConfigurationFactory();
|
||||
|
||||
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
|
||||
bool canCreate(ProjectExplorer::Target *parent, Core::Id id) const;
|
||||
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
|
||||
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const;
|
||||
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product);
|
||||
|
||||
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
|
||||
QString displayNameForId(const Core::Id id) const;
|
||||
QString displayNameForId(Core::Id id) const;
|
||||
|
||||
static Core::Id idFromBuildTarget(const QString &target);
|
||||
static QString buildTargetFromId(Core::Id id);
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
private:
|
||||
bool canHandle(ProjectExplorer::Target *parent) const;
|
||||
|
||||
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id);
|
||||
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id);
|
||||
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
|
||||
const QVariantMap &map);
|
||||
};
|
||||
|
||||
@@ -70,7 +70,7 @@ MakeStep::MakeStep(BuildStepList *bsl) :
|
||||
ctor();
|
||||
}
|
||||
|
||||
MakeStep::MakeStep(BuildStepList *bsl, const Core::Id id) :
|
||||
MakeStep::MakeStep(BuildStepList *bsl, Core::Id id) :
|
||||
AbstractProcessStep(bsl, id), m_clean(false)
|
||||
{
|
||||
ctor();
|
||||
@@ -452,14 +452,14 @@ MakeStepFactory::~MakeStepFactory()
|
||||
{
|
||||
}
|
||||
|
||||
bool MakeStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
|
||||
bool MakeStepFactory::canCreate(BuildStepList *parent, Core::Id id) const
|
||||
{
|
||||
if (parent->target()->project()->id() == Constants::CMAKEPROJECT_ID)
|
||||
return id == MS_ID;
|
||||
return false;
|
||||
}
|
||||
|
||||
BuildStep *MakeStepFactory::create(BuildStepList *parent, const Core::Id id)
|
||||
BuildStep *MakeStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||
{
|
||||
if (!canCreate(parent, id))
|
||||
return 0;
|
||||
@@ -506,7 +506,7 @@ QList<Core::Id> MakeStepFactory::availableCreationIds(ProjectExplorer::BuildStep
|
||||
return QList<Core::Id>();
|
||||
}
|
||||
|
||||
QString MakeStepFactory::displayNameForId(const Core::Id id) const
|
||||
QString MakeStepFactory::displayNameForId(Core::Id id) const
|
||||
{
|
||||
if (id == MS_ID)
|
||||
return tr("Make", "Display name for CMakeProjectManager::MakeStep id.");
|
||||
|
||||
@@ -95,7 +95,7 @@ protected:
|
||||
void processFinished(int exitCode, QProcess::ExitStatus status);
|
||||
|
||||
MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs);
|
||||
MakeStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id);
|
||||
MakeStep(ProjectExplorer::BuildStepList *bsl, Core::Id id);
|
||||
|
||||
bool fromMap(const QVariantMap &map);
|
||||
|
||||
@@ -145,15 +145,15 @@ public:
|
||||
explicit MakeStepFactory(QObject *parent = 0);
|
||||
virtual ~MakeStepFactory();
|
||||
|
||||
bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
|
||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
||||
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const;
|
||||
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
||||
bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
|
||||
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
|
||||
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
||||
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
|
||||
|
||||
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
||||
QString displayNameForId(const Core::Id id) const;
|
||||
QString displayNameForId(Core::Id id) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user