forked from qt-creator/qt-creator
qds: remove redundant "QtStudio" feature
Nowadays, the decision which wizards will be shown are done throw the StudioWelcome plugin if it is initialized or not. Change-Id: Ief95fa8f813408522ac43c31dd6f4ffb069338d0 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
b82bb52183
commit
f9cceb6267
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Custom Button",
|
"trDisplayName": "Custom Button",
|
||||||
"trDisplayCategory": "Qt Quick Controls",
|
"trDisplayCategory": "Qt Quick Controls",
|
||||||
"icon": "custom_button.png",
|
"icon": "custom_button.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Custom CheckBox",
|
"trDisplayName": "Custom CheckBox",
|
||||||
"trDisplayCategory": "Qt Quick Controls",
|
"trDisplayCategory": "Qt Quick Controls",
|
||||||
"icon": "custom_checkbox.png",
|
"icon": "custom_checkbox.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Custom Dial",
|
"trDisplayName": "Custom Dial",
|
||||||
"trDisplayCategory": "Qt Quick Controls",
|
"trDisplayCategory": "Qt Quick Controls",
|
||||||
"icon": "custom_dial.png",
|
"icon": "custom_dial.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Custom Slider",
|
"trDisplayName": "Custom Slider",
|
||||||
"trDisplayCategory": "Qt Quick Controls",
|
"trDisplayCategory": "Qt Quick Controls",
|
||||||
"icon": "custom_slider.png",
|
"icon": "custom_slider.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Custom SpinBox",
|
"trDisplayName": "Custom SpinBox",
|
||||||
"trDisplayCategory": "Qt Quick Controls",
|
"trDisplayCategory": "Qt Quick Controls",
|
||||||
"icon": "custom_spinbox.png",
|
"icon": "custom_spinbox.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Custom Switch",
|
"trDisplayName": "Custom Switch",
|
||||||
"trDisplayCategory": "Qt Quick Controls",
|
"trDisplayCategory": "Qt Quick Controls",
|
||||||
"icon": "custom_switch.png",
|
"icon": "custom_switch.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Flow Item",
|
"trDisplayName": "Flow Item",
|
||||||
"trDisplayCategory": "Qt Quick Files",
|
"trDisplayCategory": "Qt Quick Files",
|
||||||
"icon": "flow_item.png",
|
"icon": "flow_item.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Flow View",
|
"trDisplayName": "Flow View",
|
||||||
"trDisplayCategory": "Qt Quick Files",
|
"trDisplayCategory": "Qt Quick Files",
|
||||||
"icon": "flow_view.png",
|
"icon": "flow_view.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Java Script File",
|
"trDisplayName": "Java Script File",
|
||||||
"trDisplayCategory": "Java Script",
|
"trDisplayCategory": "Java Script",
|
||||||
"icon": "file_javascript.png",
|
"icon": "file_javascript.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "ListModel",
|
"trDisplayName": "ListModel",
|
||||||
"trDisplayCategory": "QML Files",
|
"trDisplayCategory": "QML Files",
|
||||||
"icon": "data_listmodel.png",
|
"icon": "data_listmodel.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Pane",
|
"trDisplayName": "Pane",
|
||||||
"trDisplayCategory": "Qt Quick Controls",
|
"trDisplayCategory": "Qt Quick Controls",
|
||||||
"icon": "custom_panes.png",
|
"icon": "custom_panes.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Qt Quick File",
|
"trDisplayName": "Qt Quick File",
|
||||||
"trDisplayCategory": "Qt Quick Files",
|
"trDisplayCategory": "Qt Quick Files",
|
||||||
"icon": "file_qml.png",
|
"icon": "file_qml.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Qt Quick Views",
|
"trDisplayName": "Qt Quick Views",
|
||||||
"trDisplayCategory": "Qt Quick Files",
|
"trDisplayCategory": "Qt Quick Files",
|
||||||
"icon": "data_gridmodel.png",
|
"icon": "data_gridmodel.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
"trDisplayName": "Qt Quick UI File",
|
"trDisplayName": "Qt Quick UI File",
|
||||||
"trDisplayCategory": "Qt Quick Files",
|
"trDisplayCategory": "Qt Quick Files",
|
||||||
"icon": "file_ui.png",
|
"icon": "file_ui.png",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
"trDescription": "Creates a UI file (.ui.qml) with a Stacked Layout as the root component.",
|
"trDescription": "Creates a UI file (.ui.qml) with a Stacked Layout as the root component.",
|
||||||
"trDisplayName": "Stacked Layout",
|
"trDisplayName": "Stacked Layout",
|
||||||
"trDisplayCategory": "Qt Quick Controls",
|
"trDisplayCategory": "Qt Quick Controls",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"icon": "custom_stacked_view.png",
|
"icon": "custom_stacked_view.png",
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
"trDescription": "Creates a UI file (.ui.qml) with a Swipe View as the root component.",
|
"trDescription": "Creates a UI file (.ui.qml) with a Swipe View as the root component.",
|
||||||
"trDisplayName": "Swipe View",
|
"trDisplayName": "Swipe View",
|
||||||
"trDisplayCategory": "Qt Quick Controls",
|
"trDisplayCategory": "Qt Quick Controls",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"icon": "custom_swipe_view.png",
|
"icon": "custom_swipe_view.png",
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"icon": "desktop_blank.png",
|
"icon": "desktop_blank.png",
|
||||||
"fontIconName": "wizardsGeneric",
|
"fontIconName": "wizardsGeneric",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"icon": "desktop_blank.png",
|
"icon": "desktop_blank.png",
|
||||||
"fontIconName": "wizardsMcuEmpty",
|
"fontIconName": "wizardsMcuEmpty",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"icon": "desktop_blank.png",
|
"icon": "desktop_blank.png",
|
||||||
"fontIconName": "wizardsGeneric",
|
"fontIconName": "wizardsGeneric",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"icon": "desktop_launcher.png",
|
"icon": "desktop_launcher.png",
|
||||||
"fontIconName": "wizardsDesktop",
|
"fontIconName": "wizardsDesktop",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"icon": "mobile_scroll.png",
|
"icon": "mobile_scroll.png",
|
||||||
"fontIconName": "wizardsMobile",
|
"fontIconName": "wizardsMobile",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"icon": "mobile_stack.png",
|
"icon": "mobile_stack.png",
|
||||||
"fontIconName": "wizardsMobile",
|
"fontIconName": "wizardsMobile",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"icon": "mobile_swipe.png",
|
"icon": "mobile_swipe.png",
|
||||||
"fontIconName": "wizardsMobile",
|
"fontIconName": "wizardsMobile",
|
||||||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlProjectManager') >= 0}",
|
||||||
"featuresRequired": [ "QtStudio" ],
|
|
||||||
"platformIndependent": true,
|
"platformIndependent": true,
|
||||||
|
|
||||||
"options":
|
"options":
|
||||||
|
|||||||
@@ -70,8 +70,7 @@ void WizardFactories::filter()
|
|||||||
{
|
{
|
||||||
QList<JsonWizardFactory *> acceptedFactories = Utils::filtered(m_factories, [&](auto *wizard) {
|
QList<JsonWizardFactory *> acceptedFactories = Utils::filtered(m_factories, [&](auto *wizard) {
|
||||||
return wizard->isAvailable(m_platform)
|
return wizard->isAvailable(m_platform)
|
||||||
&& wizard->kind() == JsonWizardFactory::ProjectWizard
|
&& wizard->kind() == JsonWizardFactory::ProjectWizard;
|
||||||
&& wizard->requiredFeatures().contains("QtStudio");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
m_factories = acceptedFactories;
|
m_factories = acceptedFactories;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
),
|
),
|
||||||
(override));
|
(override));
|
||||||
|
|
||||||
MOCK_METHOD((std::pair<int, QStringList>), screenSizeInfoFromPage, (const QString &), (const));
|
MOCK_METHOD((std::pair<int, QStringList>), screenSizeInfoFromPage, (const QString &), (const, override));
|
||||||
|
|
||||||
MOCK_METHOD(bool, isAvailable, (Utils::Id), (const, override));
|
MOCK_METHOD(bool, isAvailable, (Utils::Id), (const, override));
|
||||||
};
|
};
|
||||||
@@ -69,13 +69,13 @@ protected:
|
|||||||
WizardFactories::setIconUnicodeCallback(oldIconUnicodeFunc);
|
WizardFactories::setIconUnicodeCallback(oldIconUnicodeFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
IWizardFactory *aWizardFactory(IWizardFactory::WizardKind kind, bool requiresQtStudio = true,
|
IWizardFactory *aWizardFactory(IWizardFactory::WizardKind kind,
|
||||||
const QPair<QString, bool> &availableOnPlatform = {})
|
const QPair<QString, bool> &availableOnPlatform = {})
|
||||||
{
|
{
|
||||||
MockWizardFactory *factory = new MockWizardFactory;
|
MockWizardFactory *factory = new MockWizardFactory;
|
||||||
m_factories.push_back(std::unique_ptr<IWizardFactory>(factory));
|
m_factories.push_back(std::unique_ptr<IWizardFactory>(factory));
|
||||||
|
|
||||||
configureFactory(*factory, kind, requiresQtStudio, availableOnPlatform);
|
configureFactory(*factory, kind, availableOnPlatform);
|
||||||
|
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ protected:
|
|||||||
MockWizardFactory *factory = new MockWizardFactory;
|
MockWizardFactory *factory = new MockWizardFactory;
|
||||||
m_factories.push_back(std::unique_ptr<IWizardFactory>(factory));
|
m_factories.push_back(std::unique_ptr<IWizardFactory>(factory));
|
||||||
|
|
||||||
configureFactory(*factory, IWizardFactory::ProjectWizard, /*req QtStudio*/true,
|
configureFactory(*factory, IWizardFactory::ProjectWizard,
|
||||||
{platform, true}, sizes);
|
{platform, true}, sizes);
|
||||||
|
|
||||||
if (!name.isEmpty())
|
if (!name.isEmpty())
|
||||||
@@ -102,7 +102,6 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void configureFactory(MockWizardFactory &factory, IWizardFactory::WizardKind kind,
|
void configureFactory(MockWizardFactory &factory, IWizardFactory::WizardKind kind,
|
||||||
bool requiresQtStudio = true,
|
|
||||||
const QPair<QString, bool> &availableOnPlatform = {},
|
const QPair<QString, bool> &availableOnPlatform = {},
|
||||||
const std::pair<int, QStringList> &sizes = {})
|
const std::pair<int, QStringList> &sizes = {})
|
||||||
{
|
{
|
||||||
@@ -117,14 +116,6 @@ protected:
|
|||||||
<< "Expected to create a File Wizard factory";
|
<< "Expected to create a File Wizard factory";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requiresQtStudio) {
|
|
||||||
QSet<Utils::Id> features{"QtStudio"};
|
|
||||||
factory.setRequiredFeatures(features);
|
|
||||||
} else {
|
|
||||||
QSet<Utils::Id> features{"some", "other", "features"};
|
|
||||||
factory.setRequiredFeatures(features);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!availableOnPlatform.first.isEmpty()) {
|
if (!availableOnPlatform.first.isEmpty()) {
|
||||||
const QString platform = availableOnPlatform.first;
|
const QString platform = availableOnPlatform.first;
|
||||||
bool value = availableOnPlatform.second;
|
bool value = availableOnPlatform.second;
|
||||||
@@ -195,7 +186,7 @@ TEST_F(QdsWizardFactories, haveEmptyListOfWizardFactories)
|
|||||||
TEST_F(QdsWizardFactories, filtersOutNonProjectWizardFactories)
|
TEST_F(QdsWizardFactories, filtersOutNonProjectWizardFactories)
|
||||||
{
|
{
|
||||||
WizardFactories wf = makeWizardFactoriesHandler(
|
WizardFactories wf = makeWizardFactoriesHandler(
|
||||||
{aWizardFactory(IWizardFactory::FileWizard, /*req QtStudio*/ true, {platform, true})},
|
{aWizardFactory(IWizardFactory::FileWizard, {platform, true})},
|
||||||
/*get wizards supporting platform*/ platform
|
/*get wizards supporting platform*/ platform
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -207,7 +198,7 @@ TEST_F(QdsWizardFactories, filtersOutNonProjectWizardFactories)
|
|||||||
TEST_F(QdsWizardFactories, filtersOutWizardFactoriesUnavailableForPlatform)
|
TEST_F(QdsWizardFactories, filtersOutWizardFactoriesUnavailableForPlatform)
|
||||||
{
|
{
|
||||||
WizardFactories wf = makeWizardFactoriesHandler(
|
WizardFactories wf = makeWizardFactoriesHandler(
|
||||||
{aWizardFactory(IWizardFactory::ProjectWizard, /*req QtStudio*/ true, {"Non-Desktop", false})},
|
{aWizardFactory(IWizardFactory::ProjectWizard, {"Non-Desktop", false})},
|
||||||
/*get wizards supporting platform*/ "Non-Desktop"
|
/*get wizards supporting platform*/ "Non-Desktop"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -216,19 +207,6 @@ TEST_F(QdsWizardFactories, filtersOutWizardFactoriesUnavailableForPlatform)
|
|||||||
ASSERT_THAT(presets, IsEmpty());
|
ASSERT_THAT(presets, IsEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(QdsWizardFactories, filtersOutWizardFactoriesThatDontRequireQtStudio)
|
|
||||||
{
|
|
||||||
WizardFactories wf = makeWizardFactoriesHandler(
|
|
||||||
{
|
|
||||||
aWizardFactory(IWizardFactory::FileWizard, /*require QtStudio*/ false, {platform, true})
|
|
||||||
},
|
|
||||||
/*get wizards supporting platform*/ platform);
|
|
||||||
|
|
||||||
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
|
||||||
|
|
||||||
ASSERT_THAT(presets, IsEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(QdsWizardFactories, doesNotFilterOutAGoodWizardFactory)
|
TEST_F(QdsWizardFactories, doesNotFilterOutAGoodWizardFactory)
|
||||||
{
|
{
|
||||||
WizardFactories wf = makeWizardFactoriesHandler({aGoodWizardFactory()}, platform);
|
WizardFactories wf = makeWizardFactoriesHandler({aGoodWizardFactory()}, platform);
|
||||||
|
|||||||
Reference in New Issue
Block a user