Paste P614

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Jul 6 2020, 4:31 PM.
diff --git a/src/kdeclarative/configpropertymap.cpp b/src/kdeclarative/configpropertymap.cpp
index bd877e3..a55592e 100644
--- a/src/kdeclarative/configpropertymap.cpp
+++ b/src/kdeclarative/configpropertymap.cpp
@@ -47,6 +47,7 @@ public:
QPointer<KCoreConfigSkeleton> config;
bool updatingConfigValue = false;
bool autosave = true;
+ bool notify = false;
};
ConfigPropertyMap::ConfigPropertyMap(KCoreConfigSkeleton *config, QObject *parent)
@@ -85,6 +86,16 @@ void ConfigPropertyMap::setAutosave(bool autosave)
d->autosave = autosave;
}
+bool KDeclarative::ConfigPropertyMap::isNotify() const
+{
+ return d->notify;
+}
+
+void ConfigPropertyMap::setNotify(bool notify)
+{
+ d->notify = notify;
+}
+
QVariant ConfigPropertyMap::updateValue(const QString &key, const QVariant &input)
{
Q_UNUSED(key);
@@ -127,6 +138,7 @@ void ConfigPropertyMapPrivate::writeConfig()
const auto lstItems = config.data()->items();
for (KConfigSkeletonItem *item : lstItems) {
+ item->setWriteFlags(notify ? KConfigBase::Notify : KConfigBase::Normal);
item->setProperty(q->value(item->key()));
}
@@ -142,6 +154,7 @@ void ConfigPropertyMapPrivate::writeConfigValue(const QString &key, const QVaria
KConfigSkeletonItem *item = config.data()->findItem(key);
if (item) {
updatingConfigValue = true;
+ item->setWriteFlags(notify ? KConfigBase::Notify : KConfigBase::Normal);
item->setProperty(value);
if (autosave) {
config.data()->save();
diff --git a/src/kdeclarative/configpropertymap.h b/src/kdeclarative/configpropertymap.h
index ec82647..fe4efc2 100644
--- a/src/kdeclarative/configpropertymap.h
+++ b/src/kdeclarative/configpropertymap.h
@@ -60,6 +60,11 @@ public:
*/
void setAutosave(bool autosave);
+
+ bool isNotify() const;
+
+ void setNotify(bool notify);
+
/**
* @brief Whether the value at the given key is immutable
*
diff --git a/src/quickaddons/configmodule.cpp b/src/quickaddons/configmodule.cpp
index e7d52d8..467082e 100644
--- a/src/quickaddons/configmodule.cpp
+++ b/src/quickaddons/configmodule.cpp
@@ -166,6 +166,9 @@ QQuickItem *ConfigModule::mainUi()
ConfigModulePrivate::s_rootObjects[d->_qmlObject->rootContext()] = this;
d->_qmlObject->setTranslationDomain(aboutData()->componentName());
+
+ qDebug() << "Setting translation domain " << aboutData()->componentName();
+
d->_qmlObject->setInitializationDelayed(true);
KPackage::Package package = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/GenericQML"));
davidedmundson edited the content of this paste. (Show Details)Jul 6 2020, 4:31 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.