Commit 4cf7742f authored by Eike Ziller's avatar Eike Ziller
Browse files

Welcome: Use Core::Id instead of enum



Change-Id: Id65eb262d02bb4db765abefa361d407837b45782
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent dfa76d74
......@@ -33,6 +33,8 @@
#include "utils_global.h"
#include <coreplugin/id.h>
#include <QObject>
QT_FORWARD_DECLARE_CLASS(QUrl)
......@@ -50,14 +52,6 @@ class QTCREATOR_UTILS_EXPORT IWelcomePage : public QObject
Q_PROPERTY(bool hasSearchBar READ hasSearchBar CONSTANT)
public:
enum Id {
GettingStarted = 0,
Develop = 1,
Examples = 2,
Tutorials = 3,
UserDefined = 32
};
IWelcomePage();
virtual ~IWelcomePage();
......@@ -66,7 +60,7 @@ public:
virtual int priority() const { return 0; }
virtual void facilitateQml(QQmlEngine *) {}
virtual bool hasSearchBar() const { return false; }
virtual Id id() const = 0;
virtual Core::Id id() const = 0;
};
}
......
......@@ -236,9 +236,9 @@ QUrl ProjectWelcomePage::pageLocation() const
return QUrl::fromLocalFile(resourcePath + QLatin1String("/welcomescreen/develop.qml"));
}
ProjectWelcomePage::Id ProjectWelcomePage::id() const
Core::Id ProjectWelcomePage::id() const
{
return Develop;
return "Develop";
}
void ProjectWelcomePage::reloadWelcomeScreenData()
......
......@@ -89,7 +89,7 @@ public:
QWidget *page() { return 0; }
QString title() const { return tr("Projects"); }
int priority() const { return 20; }
Id id() const;
Core::Id id() const;
void reloadWelcomeScreenData();
......
......@@ -275,9 +275,9 @@ void ExamplesWelcomePage::facilitateQml(QQmlEngine *engine)
rootContenxt->setContextProperty(QLatin1String("gettingStarted"), this);
}
ExamplesWelcomePage::Id ExamplesWelcomePage::id() const
Core::Id ExamplesWelcomePage::id() const
{
return m_showExamples ? Examples : Tutorials;
return m_showExamples ? "Examples" : "Tutorials";
}
void ExamplesWelcomePage::openHelpInExtraWindow(const QUrl &help)
......
......@@ -58,7 +58,7 @@ public:
int priority() const;
bool hasSearchBar() const;
void facilitateQml(QQmlEngine *);
Id id() const;
Core::Id id() const;
Q_INVOKABLE void openUrl(const QUrl &url);
public slots:
......
......@@ -216,7 +216,7 @@ void WelcomeMode::initPlugins()
});
QList<Utils::IWelcomePage*> plugins;
QHash<Utils::IWelcomePage::Id, Utils::IWelcomePage*> pluginHash;
QHash<Core::Id, Utils::IWelcomePage*> pluginHash;
//avoid duplicate ids - choose by priority
foreach (Utils::IWelcomePage* plugin, duplicatePlugins) {
......@@ -270,7 +270,7 @@ void WelcomeMode::initPlugins()
void WelcomeMode::welcomePluginAdded(QObject *obj)
{
QHash<Utils::IWelcomePage::Id, Utils::IWelcomePage*> pluginHash;
QHash<Core::Id, Utils::IWelcomePage*> pluginHash;
foreach (QObject *obj, m_pluginList) {
Utils::IWelcomePage *plugin = qobject_cast<Utils::IWelcomePage*>(obj);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment