forked from qt-creator/qt-creator
ProjectExplorer: Add a RunConfigurationFactory::canHandle(Target *)
All RunConfiguration factories had some kind of canHandle(Target *) implementation. Centralize this notion. Change-Id: Ie24a355e857bddfd76b866859b8c7a42ffc83840 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -91,6 +91,7 @@ static Core::Id idFromScript(const QString &target)
|
||||
|
||||
class PythonProject : public Project
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PythonProject(const Utils::FileName &filename);
|
||||
|
||||
@@ -279,6 +280,7 @@ public:
|
||||
{
|
||||
setObjectName("PythonRunConfigurationFactory");
|
||||
registerRunConfiguration<PythonRunConfiguration>();
|
||||
setSupportedProjectType<PythonProject>();
|
||||
}
|
||||
|
||||
QList<Core::Id> availableCreationIds(Target *parent, CreationMode mode) const override
|
||||
@@ -323,9 +325,6 @@ public:
|
||||
return false;
|
||||
return source->id().name().startsWith(PythonRunConfigurationPrefix);
|
||||
}
|
||||
|
||||
private:
|
||||
bool canHandle(Target *parent) const { return dynamic_cast<PythonProject *>(parent->project()); }
|
||||
};
|
||||
|
||||
PythonProject::PythonProject(const FileName &fileName) :
|
||||
|
||||
Reference in New Issue
Block a user