summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2012-05-22 11:17:13 +0200
committerEike Ziller <eike.ziller@nokia.com>2012-05-23 10:48:04 +0200
commitf77cd29e54f832cbb72533842acb4dda655540f1 (patch)
treee6557c80b3c1875fb0c7b215919b3fa5bee97d1c /src/plugins/projectexplorer
parent444445ceb3cef3f406ae6e68ee5c2505de2762cc (diff)
downloadqt-creator-f77cd29e54f832cbb72533842acb4dda655540f1.tar.gz
IOptionsPage: replace virtual fuctions by data members
Change-Id: I8297df85109b67b79f90c33263a5dc7b89efbb60 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r--src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp44
-rw-r--r--src/plugins/projectexplorer/devicesupport/devicesettingspage.h19
-rw-r--r--src/plugins/projectexplorer/projectexplorersettingspage.cpp30
-rw-r--r--src/plugins/projectexplorer/projectexplorersettingspage.h16
-rw-r--r--src/plugins/projectexplorer/toolchainoptionspage.cpp31
-rw-r--r--src/plugins/projectexplorer/toolchainoptionspage.h14
6 files changed, 34 insertions, 120 deletions
diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp
index 9c1345e653..caf1922b45 100644
--- a/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp
+++ b/src/plugins/projectexplorer/devicesupport/devicesettingspage.cpp
@@ -44,35 +44,11 @@ namespace Internal {
DeviceSettingsPage::DeviceSettingsPage(QObject *parent)
: Core::IOptionsPage(parent)
{
-}
-
-DeviceSettingsPage::~DeviceSettingsPage()
-{
-}
-
-QString DeviceSettingsPage::id() const
-{
- return pageId();
-}
-
-QString DeviceSettingsPage::displayName() const
-{
- return tr("Devices");
-}
-
-QString DeviceSettingsPage::category() const
-{
- return pageCategory();
-}
-
-QString DeviceSettingsPage::displayCategory() const
-{
- return QCoreApplication::translate("ProjectExplorer", "Devices");
-}
-
-QIcon DeviceSettingsPage::categoryIcon() const
-{
- return QIcon(QLatin1String(":/projectexplorer/images/MaemoDevice.png"));
+ setId(QLatin1String(Constants::DEVICE_SETTINGS_PAGE_ID));
+ setDisplayName(tr("Devices"));
+ setCategory(QLatin1String(Constants::DEVICE_SETTINGS_CATEGORY));
+ setDisplayCategory(QCoreApplication::translate("ProjectExplorer", "Devices"));
+ setCategoryIcon(QLatin1String(":/projectexplorer/images/MaemoDevice.png"));
}
bool DeviceSettingsPage::matches(const QString &searchKeyWord) const
@@ -97,15 +73,5 @@ void DeviceSettingsPage::finish()
{
}
-QString DeviceSettingsPage::pageId()
-{
- return QLatin1String(Constants::DEVICE_SETTINGS_PAGE_ID);
-}
-
-QString DeviceSettingsPage::pageCategory()
-{
- return QLatin1String(Constants::DEVICE_SETTINGS_CATEGORY);
-}
-
} // namespace Internal
} // namespace ProjectExplorer
diff --git a/src/plugins/projectexplorer/devicesupport/devicesettingspage.h b/src/plugins/projectexplorer/devicesupport/devicesettingspage.h
index 15e690ebea..2fb39cf7e3 100644
--- a/src/plugins/projectexplorer/devicesupport/devicesettingspage.h
+++ b/src/plugins/projectexplorer/devicesupport/devicesettingspage.h
@@ -35,27 +35,20 @@
namespace ProjectExplorer {
namespace Internal {
+
class DeviceSettingsWidget;
class DeviceSettingsPage : public Core::IOptionsPage
{
Q_OBJECT
+
public:
DeviceSettingsPage(QObject *parent = 0);
- ~DeviceSettingsPage();
-
- virtual QString id() const;
- virtual QString displayName() const;
- virtual QString category() const;
- virtual QString displayCategory() const;
- virtual QIcon categoryIcon() const;
- virtual bool matches(const QString &searchKeyWord) const;
- virtual QWidget *createPage(QWidget *parent);
- virtual void apply();
- virtual void finish();
- static QString pageId();
- static QString pageCategory();
+ bool matches(const QString &searchKeyWord) const;
+ QWidget *createPage(QWidget *parent);
+ void apply();
+ void finish();
private:
QString m_keywords;
diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.cpp b/src/plugins/projectexplorer/projectexplorersettingspage.cpp
index 48489c428b..50491deaab 100644
--- a/src/plugins/projectexplorer/projectexplorersettingspage.cpp
+++ b/src/plugins/projectexplorer/projectexplorersettingspage.cpp
@@ -153,32 +153,16 @@ QString ProjectExplorerSettingsWidget::searchKeywords() const
// ------------------ ProjectExplorerSettingsPage
ProjectExplorerSettingsPage::ProjectExplorerSettingsPage()
{
+ setId(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_ID));
+ setDisplayName(tr("General"));
+ setCategory(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY));
+ setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
+ Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY));
+ setCategoryIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON));
}
-QString ProjectExplorerSettingsPage::id() const
+ProjectExplorerSettingsPage::~ProjectExplorerSettingsPage()
{
- return QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_ID);
-}
-
-QString ProjectExplorerSettingsPage::displayName() const
-{
- return tr("General");
-}
-
-QString ProjectExplorerSettingsPage::category() const
-{
- return QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
-}
-
-QString ProjectExplorerSettingsPage::displayCategory() const
-{
- return QCoreApplication::translate("ProjectExplorer",
- Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY);
-}
-
-QIcon ProjectExplorerSettingsPage::categoryIcon() const
-{
- return QIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON));
}
QWidget *ProjectExplorerSettingsPage::createPage(QWidget *parent)
diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.h b/src/plugins/projectexplorer/projectexplorersettingspage.h
index d8d9277804..5bcabbdaf9 100644
--- a/src/plugins/projectexplorer/projectexplorersettingspage.h
+++ b/src/plugins/projectexplorer/projectexplorersettingspage.h
@@ -73,19 +73,15 @@ private:
class ProjectExplorerSettingsPage : public Core::IOptionsPage
{
Q_OBJECT
+
public:
ProjectExplorerSettingsPage();
+ ~ProjectExplorerSettingsPage();
- virtual QString id() const;
- virtual QString displayName() const;
- virtual QString category() const;
- virtual QString displayCategory() const;
- virtual QIcon categoryIcon() const;
-
- virtual QWidget *createPage(QWidget *parent);
- virtual void apply();
- virtual void finish();
- virtual bool matches(const QString &s) const;
+ QWidget *createPage(QWidget *parent);
+ void apply();
+ void finish();
+ bool matches(const QString &s) const;
private:
QString m_searchKeywords;
diff --git a/src/plugins/projectexplorer/toolchainoptionspage.cpp b/src/plugins/projectexplorer/toolchainoptionspage.cpp
index 5387a0e79e..afd7dd8345 100644
--- a/src/plugins/projectexplorer/toolchainoptionspage.cpp
+++ b/src/plugins/projectexplorer/toolchainoptionspage.cpp
@@ -472,32 +472,13 @@ void ToolChainModel::removeToolChain(ToolChain *tc)
ToolChainOptionsPage::ToolChainOptionsPage() :
m_ui(0), m_model(0), m_selectionModel(0), m_currentTcWidget(0)
-{ }
-
-QString ToolChainOptionsPage::id() const
-{
- return QLatin1String(Constants::TOOLCHAIN_SETTINGS_PAGE_ID);
-}
-
-QString ToolChainOptionsPage::displayName() const
-{
- return tr("Tool Chains");
-}
-
-QString ToolChainOptionsPage::category() const
-{
- return QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
-}
-
-QString ToolChainOptionsPage::displayCategory() const
-{
- return QCoreApplication::translate("ProjectExplorer",
- Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY);
-}
-
-QIcon ToolChainOptionsPage::categoryIcon() const
{
- return QIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON));
+ setId(QLatin1String(Constants::TOOLCHAIN_SETTINGS_PAGE_ID));
+ setDisplayName(tr("Tool Chains"));
+ setCategory(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY));
+ setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
+ Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY));
+ setCategoryIcon(QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON));
}
QWidget *ToolChainOptionsPage::createPage(QWidget *parent)
diff --git a/src/plugins/projectexplorer/toolchainoptionspage.h b/src/plugins/projectexplorer/toolchainoptionspage.h
index 67814b112f..2049154455 100644
--- a/src/plugins/projectexplorer/toolchainoptionspage.h
+++ b/src/plugins/projectexplorer/toolchainoptionspage.h
@@ -123,16 +123,10 @@ class ToolChainOptionsPage : public Core::IOptionsPage
public:
ToolChainOptionsPage();
- virtual QString id() const;
- virtual QString displayName() const;
- virtual QString category() const;
- virtual QString displayCategory() const;
- virtual QIcon categoryIcon() const;
-
- virtual QWidget *createPage(QWidget *parent);
- virtual void apply();
- virtual void finish();
- virtual bool matches(const QString &) const;
+ QWidget *createPage(QWidget *parent);
+ void apply();
+ void finish();
+ bool matches(const QString &) const;
private slots:
void toolChainSelectionChanged();