forked from qt-creator/qt-creator
VcsPlugin: shift signalling of settings changes
To allow removing the QObject ineritance of IOptionPage Change-Id: Id230ee9230dd1bee094b19b5a22d61d37e650d27 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -127,11 +127,11 @@ public:
|
||||
connect(cacheResetButton, &QPushButton::clicked,
|
||||
Core::VcsManager::instance(), &Core::VcsManager::clearVersionControlCache);
|
||||
|
||||
setOnApply([&s, page] {
|
||||
setOnApply([&s] {
|
||||
if (s.isDirty()) {
|
||||
s.apply();
|
||||
s.writeSettings(Core::ICore::settings());
|
||||
emit page->settingsChanged();
|
||||
emit s.settingsChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace Internal {
|
||||
|
||||
class CommonVcsSettings : public Utils::AspectContainer
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CommonVcsSettings();
|
||||
|
||||
@@ -27,20 +29,18 @@ public:
|
||||
|
||||
Utils::BoolAspect lineWrap;
|
||||
Utils::IntegerAspect lineWrapWidth;
|
||||
|
||||
signals:
|
||||
void settingsChanged();
|
||||
};
|
||||
|
||||
class CommonOptionsPage final : public Core::IOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CommonOptionsPage();
|
||||
CommonOptionsPage();
|
||||
|
||||
CommonVcsSettings &settings() { return m_settings; }
|
||||
|
||||
signals:
|
||||
void settingsChanged();
|
||||
|
||||
private:
|
||||
CommonVcsSettings m_settings;
|
||||
};
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
explicit VcsPluginPrivate(VcsPlugin *plugin)
|
||||
: q(plugin)
|
||||
{
|
||||
QObject::connect(&m_settingsPage, &CommonOptionsPage::settingsChanged,
|
||||
QObject::connect(&m_settingsPage.settings(), &CommonVcsSettings::settingsChanged,
|
||||
[this] { slotSettingsChanged(); });
|
||||
slotSettingsChanged();
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void VcsPlugin::initialize()
|
||||
return result;
|
||||
});
|
||||
|
||||
connect(&d->m_settingsPage, &CommonOptionsPage::settingsChanged,
|
||||
connect(&d->m_settingsPage.settings(), &CommonVcsSettings::settingsChanged,
|
||||
this, &VcsPlugin::settingsChanged);
|
||||
|
||||
JsonWizardFactory::registerPageFactory(new Internal::VcsConfigurationPageFactory);
|
||||
|
||||
Reference in New Issue
Block a user