Implement KCModule::load
parent
891af9cf54
commit
e3c944feb2
|
@ -38,6 +38,7 @@ public:
|
|||
|
||||
public Q_SLOTS:
|
||||
void save() override;
|
||||
void load() override;
|
||||
|
||||
private:
|
||||
QScopedPointer<KWin::Compositing::EffectView> m_view;
|
||||
|
@ -73,6 +74,12 @@ void KWinCompositingKCM::save()
|
|||
KCModule::save();
|
||||
}
|
||||
|
||||
void KWinCompositingKCM::load()
|
||||
{
|
||||
m_view->load();
|
||||
KCModule::load();
|
||||
}
|
||||
|
||||
K_PLUGIN_FACTORY(KWinCompositingConfigFactory,
|
||||
registerPlugin<KWinCompositingKCM>();
|
||||
)
|
||||
|
|
|
@ -162,6 +162,8 @@ void EffectModel::loadEffects()
|
|||
KConfigGroup kwinConfig(KSharedConfig::openConfig("kwinrc"), "Plugins");
|
||||
|
||||
beginResetModel();
|
||||
m_effectsChanged.clear();
|
||||
m_effectsList.clear();
|
||||
KService::List offers = KServiceTypeTrader::self()->query("KWin/Effect");
|
||||
for(KService::Ptr service : offers) {
|
||||
const QString effectPluginPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kde5/services/"+ service->entryPath(), QStandardPaths::LocateFile);
|
||||
|
@ -356,6 +358,11 @@ void EffectFilterModel::enableWidnowManagement(bool enabled)
|
|||
m_effectModel->enableWidnowManagement(enabled);
|
||||
}
|
||||
|
||||
void EffectFilterModel::load()
|
||||
{
|
||||
m_effectModel->loadEffects();
|
||||
}
|
||||
|
||||
EffectView::EffectView(QWindow *parent)
|
||||
: QQuickView(parent)
|
||||
{
|
||||
|
@ -385,5 +392,15 @@ void EffectView::save()
|
|||
}
|
||||
}
|
||||
|
||||
void EffectView::load()
|
||||
{
|
||||
if (auto *model = rootObject()->findChild<EffectFilterModel*>(QStringLiteral("filterModel"))) {
|
||||
model->load();
|
||||
}
|
||||
if (auto *compositing = rootObject()->findChild<Compositing*>(QStringLiteral("compositing"))) {
|
||||
compositing->reset();
|
||||
}
|
||||
}
|
||||
|
||||
}//end namespace Compositing
|
||||
}//end namespace KWin
|
||||
|
|
|
@ -81,9 +81,9 @@ public:
|
|||
void syncEffectsToKWin();
|
||||
void syncConfig();
|
||||
void enableWidnowManagement(bool enabled);
|
||||
void loadEffects();
|
||||
|
||||
private:
|
||||
void loadEffects();
|
||||
void handleDesktopSwitching(int row);
|
||||
void handleWindowManagement(int row, bool enabled);
|
||||
int findRowByServiceName(const QString &serviceName);
|
||||
|
@ -103,6 +103,7 @@ public:
|
|||
Q_INVOKABLE QColor backgroundViewColor() { return KColorScheme(QPalette::Active, KColorScheme::Window, KSharedConfigPtr(0)).background(KColorScheme::NormalBackground).color(); };
|
||||
|
||||
void save();
|
||||
void load();
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
|
@ -130,6 +131,8 @@ public:
|
|||
QColor backgroundNormalColor() { return KColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0)).background(KColorScheme::NormalBackground).color(); };
|
||||
QColor backgroundAlternateColor() { return KColorScheme(QPalette::Active, KColorScheme::View, KSharedConfigPtr(0)).background(KColorScheme::AlternateBackground).color(); };
|
||||
|
||||
void load();
|
||||
|
||||
public Q_SLOTS:
|
||||
void setFilter(const QString &filter);
|
||||
|
||||
|
|
Loading…
Reference in New Issue