CMake: Some cosmetics to move closer to default style

Change-Id: If2c36eda6157e5dd78abf4f25029ecfd153e228a
Reviewed-by: pawelrutka <prutka13@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2018-03-16 12:53:33 +01:00
parent 07d8b7bfa4
commit cd1534a646
2 changed files with 9 additions and 16 deletions

View File

@@ -29,9 +29,7 @@
namespace CMakeProjectManager { namespace CMakeProjectManager {
namespace Internal { namespace Internal {
namespace {
const char PROJECT_TYPE_ICON[] = ":/cmakeproject/images/project_type_settings_icon.png"; const char PROJECT_TYPE_ICON[] = ":/cmakeproject/images/project_type_settings_icon.png";
}
CMakeSpecificSettingWidget::CMakeSpecificSettingWidget(QWidget *parent): CMakeSpecificSettingWidget::CMakeSpecificSettingWidget(QWidget *parent):
QWidget(parent) QWidget(parent)
@@ -55,10 +53,9 @@ CMakeSpecificSettings CMakeSpecificSettingWidget::settings() const
CMakeSpecificSettings set; CMakeSpecificSettings set;
int popupSetting = m_ui.newFileAddedCopyToCpliSettingGroup->checkedId(); int popupSetting = m_ui.newFileAddedCopyToCpliSettingGroup->checkedId();
set.setAfterAddFileSetting( (popupSetting == -1) ? AfterAddFileAction::ASK_USER : set.setAfterAddFileSetting(popupSetting == -1 ? AfterAddFileAction::ASK_USER
static_cast<AfterAddFileAction>(popupSetting)); : static_cast<AfterAddFileAction>(popupSetting));
return set; return set;
} }
void CMakeSpecificSettingWidget::setProjectPopupSetting(AfterAddFileAction mode) void CMakeSpecificSettingWidget::setProjectPopupSetting(AfterAddFileAction mode)
@@ -78,7 +75,7 @@ void CMakeSpecificSettingWidget::setProjectPopupSetting(AfterAddFileAction mode)
CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *settings, CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *settings,
QObject *parent): QObject *parent):
Core::IOptionsPage{parent}, m_settings{settings} Core::IOptionsPage(parent), m_settings(settings)
{ {
setCategory("ProjectTypeSettingsPage"); setCategory("ProjectTypeSettingsPage");
setDisplayName("Project-Type Settings"); setDisplayName("Project-Type Settings");
@@ -103,8 +100,7 @@ void CMakeSpecificSettingsPage::apply()
const CMakeSpecificSettings newSettings = m_widget->settings(); const CMakeSpecificSettings newSettings = m_widget->settings();
*m_settings = newSettings; *m_settings = newSettings;
m_settings->toSettings(Core::ICore::settings()); m_settings->toSettings(Core::ICore::settings());
} }
} } // Internal
} } // CMakeProjectManager

View File

@@ -25,16 +25,16 @@
#pragma once #pragma once
#include <coreplugin/dialogs/ioptionspage.h>
#include "cmakespecificsettings.h" #include "cmakespecificsettings.h"
#include "ui_cmakespecificsettingspage.h" #include "ui_cmakespecificsettingspage.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <QPointer> #include <QPointer>
namespace CMakeProjectManager { namespace CMakeProjectManager {
namespace Internal { namespace Internal {
class CMakeSpecificSettingWidget : public QWidget class CMakeSpecificSettingWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
@@ -50,7 +50,6 @@ private:
void setProjectPopupSetting(AfterAddFileAction mode); void setProjectPopupSetting(AfterAddFileAction mode);
}; };
class CMakeSpecificSettingsPage : public Core::IOptionsPage class CMakeSpecificSettingsPage : public Core::IOptionsPage
{ {
public: public:
@@ -65,7 +64,5 @@ private:
QPointer<CMakeSpecificSettingWidget> m_widget; QPointer<CMakeSpecificSettingWidget> m_widget;
}; };
} } // Internal
} } // CMakeProjectManager