forked from qt-creator/qt-creator
Do not offer CMake-specific wizards if that plugin is not enabled.
Rationale:
a) For people not interested in CMake, the wizards unnecessarily
clutter the UI. If unhandled, this problem would get worse the more
build systems we support.
b) If such a wizard is actually used in the absence of the plugin,
nothing visible will happen after it has finished, which is guaranteed
to confuse users.
Change-Id: I070409d3185b11d2e04e33927a97843e60c657ff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "cmakelocatorfilter.h"
|
||||
#include "cmakefilecompletionassist.h"
|
||||
|
||||
#include <coreplugin/featureprovider.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
@@ -47,6 +48,16 @@
|
||||
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
|
||||
class CMakeFeatureProvider : public Core::IFeatureProvider
|
||||
{
|
||||
Core::FeatureSet availableFeatures(const QString & /* platform */) const {
|
||||
return Core::FeatureSet(Core::Id(CMakeProjectManager::Constants::CMAKE_SUPPORT_FEATURE));
|
||||
}
|
||||
|
||||
QStringList availablePlatforms() const { return QStringList(); }
|
||||
QString displayNameForPlatform(const QString & /* platform */) const { return QString(); }
|
||||
};
|
||||
|
||||
CMakeProjectPlugin::CMakeProjectPlugin()
|
||||
{
|
||||
}
|
||||
@@ -70,6 +81,7 @@ bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *
|
||||
addAutoReleasedObject(new CMakeEditorFactory(manager));
|
||||
addAutoReleasedObject(new CMakeLocatorFilter);
|
||||
addAutoReleasedObject(new CMakeFileCompletionAssistProvider(cmp));
|
||||
addAutoReleasedObject(new CMakeFeatureProvider);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user