[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdelibs/frameworks] /: Revert "Make some KConfig classes return a bool when saving"
From: Albert Astals Cid <tsdgeos () terra ! es>
Date: 2013-03-26 23:18:43
Message-ID: 20130326231843.C1F01A604F () git ! kde ! org
[Download RAW message or body]
Git commit 68266a8dccffdc3b0dd7f8c0f5fc4d2367fea4f2 by Albert Astals Cid.
Committed on 27/03/2013 at 00:18.
Pushed by aacid into branch 'frameworks'.
Revert "Make some KConfig classes return a bool when saving"
This reverts commit 26af38879264ffc64a9b0f7f4f457a7ebe7ec0bb.
M +0 -3 KDE5PORTING.html
M +9 -9 tier2/kconfig/autotests/kconfigguitest.cpp
M +36 -54 tier2/kconfig/autotests/kconfigtest.cpp
M +0 -1 tier2/kconfig/autotests/kconfigtest.h
M +1 -1 tier2/kconfig/autotests/ksharedconfigtest.cpp
M +9 -5 tier2/kconfig/src/core/kconfig.cpp
M +1 -1 tier2/kconfig/src/core/kconfig.h
M +1 -1 tier2/kconfig/src/core/kconfigbase.h
M +2 -4 tier2/kconfig/src/core/kconfiggroup.cpp
M +1 -1 tier2/kconfig/src/core/kconfiggroup.h
M +4 -9 tier2/kconfig/src/core/kcoreconfigskeleton.cpp
M +2 -2 tier2/kconfig/src/core/kcoreconfigskeleton.h
http://commits.kde.org/kdelibs/68266a8dccffdc3b0dd7f8c0f5fc4d2367fea4f2
diff --git a/KDE5PORTING.html b/KDE5PORTING.html
index 06e1be1..7fbfa27 100644
--- a/KDE5PORTING.html
+++ b/KDE5PORTING.html
@@ -193,9 +193,6 @@ A script is available in kdesdk/kde-dev-scripts/kf5/convert-kstandarddirs.pl to
</li>
<li>KConfig and KDesktopFile have been ported to QStandardPaths. This changes the "const char* \
resourceType" in the API into QStandardPaths::StandardLocation, and means that modifying the "config" \
resource before using KConfig has no effect on KConfig anymore. </li>
-<li>KConfigBase::sync now returns a bool</li>
-<li>KCoreConfigSkeleton::writeConfig now returns a bool</li>
-<li>KCoreConfigSkeleton::usrWriteConfig now returns a bool</li>
<li>KTemporaryFile is deprecated, port to QTemporaryFile instead, see KTemporaryFile API documentation \
for details.</li> <li>KTempDir is deprecated, port to QTemporaryDir instead, see KTempDir API \
documentation for details.</li> <li>KToolInvocation::invokeHelp is now KHelpClient::invokeHelp, in the \
kwidgets framework.</li>
diff --git a/tier2/kconfig/autotests/kconfigguitest.cpp b/tier2/kconfig/autotests/kconfigguitest.cpp
index d967b29..e6b4c17 100644
--- a/tier2/kconfig/autotests/kconfigguitest.cpp
+++ b/tier2/kconfig/autotests/kconfigguitest.cpp
@@ -47,14 +47,14 @@ void KConfigTest::initTestCase()
cg.writeEntry( "colorEntry3", (QList<int>() << 234 << 234 << 127));
cg.writeEntry( "colorEntry4", (QList<int>() << 235 << 235 << 100 << 125));
cg.writeEntry( "fontEntry", FONTENTRY );
- QVERIFY(sc.sync());
+ sc.sync();
KConfig sc1("kdebugrc");
KConfigGroup sg0(&sc1, "0");
sg0.writeEntry("AbortFatal", false);
sg0.writeEntry("WarnOutput", 0);
sg0.writeEntry("FatalOutput", 0);
- QVERIFY(sc1.sync());
+ sc1.sync();
}
void KConfigTest::cleanupTestCase()
@@ -98,47 +98,47 @@ void KConfigTest::testInvalid()
// 1 element list
list << 1;
sc3.writeEntry( QString("badList"), list);
- QVERIFY(sc.sync());
+ sc.sync();
QVERIFY( sc3.readEntry( "badList", QColor() ) == QColor() );
// 2 element list
list << 2;
sc3.writeEntry( "badList", list);
- QVERIFY(sc.sync());
+ sc.sync();
QVERIFY( sc3.readEntry( "badList", QColor() ) == QColor() );
// 3 element list
list << 303;
sc3.writeEntry( "badList", list);
- QVERIFY(sc.sync());
+ sc.sync();
QVERIFY( sc3.readEntry( "badList", QColor() ) == QColor() ); // out of bounds
// 4 element list
list << 4;
sc3.writeEntry( "badList", list );
- QVERIFY(sc.sync());
+ sc.sync();
QVERIFY( sc3.readEntry( "badList", QColor() ) == QColor() ); // out of bounds
list[2] = -3;
- sc3.writeEntry( "badList", list ); QVERIFY(sc.sync());
+ sc3.writeEntry( "badList", list ); sc.sync();
QVERIFY( sc3.readEntry( "badList", QColor() ) == QColor() ); // out of bounds
// 5 element list
list[2] = 3;
list << 5;
sc3.writeEntry( "badList", list);
- QVERIFY(sc.sync());
+ sc.sync();
QVERIFY( sc3.readEntry( "badList", QColor() ) == QColor() );
// 6 element list
list << 6;
sc3.writeEntry( "badList", list);
- QVERIFY(sc.sync());
+ sc.sync();
QVERIFY( sc3.readEntry( "badList", QColor() ) == QColor() );
}
diff --git a/tier2/kconfig/autotests/kconfigtest.cpp b/tier2/kconfig/autotests/kconfigtest.cpp
index f55256b..86ff718 100644
--- a/tier2/kconfig/autotests/kconfigtest.cpp
+++ b/tier2/kconfig/autotests/kconfigtest.cpp
@@ -174,7 +174,7 @@ void KConfigTest::initTestCase()
KConfigGroup cg3(&cg, "SubGroup/3");
cg3.writeEntry( "sub3string", "somevalue" );
- QVERIFY(sc.sync());
+ sc.sync();
QVERIFY(QFile::exists(kdehome + "/kconfigtestdir/kconfigtest"));
QVERIFY(QFile::exists(kdehome + "/kconfigtestdir/kdeglobals"));
@@ -184,7 +184,7 @@ void KConfigTest::initTestCase()
sg0.writeEntry("AbortFatal", false);
sg0.writeEntry("WarnOutput", 0);
sg0.writeEntry("FatalOutput", 0);
- QVERIFY(sc1.sync());
+ sc1.sync();
//Setup stuff to test KConfig::addConfigSources()
KConfig devcfg("specificrc");
@@ -193,14 +193,14 @@ void KConfigTest::initTestCase()
KConfigGroup devandbasegrp(&devcfg, "Shared Group");
devandbasegrp.writeEntry("SomeSharedEntry", "DevValue");
devandbasegrp.writeEntry("SomeSpecificOnlyEntry", "DevValue");
- QVERIFY(devcfg.sync());
+ devcfg.sync();
KConfig basecfg("baserc");
KConfigGroup basegrp(&basecfg, "Base Only Group");
basegrp.writeEntry("ExistingEntry", "BaseValue");
KConfigGroup baseanddevgrp(&basecfg, "Shared Group");
baseanddevgrp.writeEntry("SomeSharedEntry", "BaseValue");
baseanddevgrp.writeEntry("SomeBaseOnlyEntry", "BaseValue");
- QVERIFY(basecfg.sync());
+ basecfg.sync();
KConfig gecfg("groupescapetest", KConfig::SimpleConfig);
cg = KConfigGroup(&gecfg, DOLLARGROUP);
@@ -257,7 +257,7 @@ void KConfigTest::revertEntries()
cg.revertToDefault( "stringEntry3" );
cg.revertToDefault( "stringEntry4" );
cg.revertToDefault( "stringEntry5" );
- QVERIFY(sc.sync());
+ sc.sync();
}
void KConfigTest::testRevertAllEntries()
@@ -346,12 +346,12 @@ void KConfigTest::testDefaults()
KConfigGroup group = defaults.group("any group");
group.writeEntry("entry1", Default);
- QVERIFY(group.sync());
+ group.sync();
group = config.group("any group");
group.writeEntry("entry1", Value1);
group.writeEntry("entry2", Value2);
- QVERIFY(group.sync());
+ group.sync();
config.addConfigSources(QStringList() << \
QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + '/' + DEFAULTS);
@@ -380,14 +380,14 @@ void KConfigTest::testLocale()
group.writeEntry("stringEntry1", Untranslated);
config.setLocale("fr");
group.writeEntry("stringEntry1", Translated, KConfig::Localized|KConfig::Persistent);
- QVERIFY(config.sync());
+ config.sync();
QCOMPARE(group.readEntry("stringEntry1", QString()), Translated);
QCOMPARE(group.readEntryUntranslated("stringEntry1"), Untranslated);
config.setLocale("C"); // strings written in the "C" locale are written as nonlocalized
group.writeEntry("stringEntry1", Untranslated, KConfig::Localized|KConfig::Persistent);
- QVERIFY(config.sync());
+ config.sync();
QCOMPARE(group.readEntry("stringEntry1", QString()), Untranslated);
}
@@ -399,7 +399,7 @@ void KConfigTest::testEncoding()
KConfig c( "kconfigtestencodings" );
KConfigGroup cg(&c, groupstr);
cg.writeEntry("key", "value");
- QVERIFY(c.sync());
+ c.sync();
QList<QByteArray> lines = readLines("kconfigtestencodings");
QCOMPARE(lines.count(), 2);
@@ -503,7 +503,7 @@ void KConfigTest::testPersistenceOfExpandFlagForPath()
KConfig sc2( "kconfigtest" );
KConfigGroup sc3(&sc2, "Path Type");
sc3.writeEntry( "dummy", "dummy" );
- QVERIFY(sc2.sync());
+ sc2.sync();
}
// 2nd step: Call testPath() again. Rewriting the config must not break
@@ -685,7 +685,7 @@ void KConfigTest::testDeleteEntry()
group.deleteEntry("DelKey");
QCOMPARE( group.readEntry("DelKey", QString("Fietsbel")), QString("Fietsbel") );
- QVERIFY(group.sync());
+ group.sync();
Q_ASSERT(!readLines(configFile).contains("DelKey=ToBeDeleted\n"));
QCOMPARE( group.readEntry("DelKey", QString("still deleted")), QString("still deleted") );
}
@@ -725,7 +725,7 @@ void KConfigTest::testDelete()
QVERIFY( !sc.entryMap("Hello").isEmpty() ); //not deleted group
QVERIFY( sc.entryMap("FooBar").isEmpty() ); //inexistant group
- QVERIFY(cg.sync());
+ cg.sync();
// Check what happens on disk
const QList<QByteArray> lines = readLines();
//qDebug() << lines;
@@ -741,7 +741,7 @@ void KConfigTest::testDelete()
cg = cf.group("Portable Devices");
cg.writeEntry("devices|manual|(null)", "whatever");
cg.writeEntry("devices|manual|/mnt/ipod", "/mnt/ipod");
- QVERIFY(cf.sync());
+ cf.sync();
int count=0;
Q_FOREACH(const QByteArray& item, readLines())
@@ -749,7 +749,7 @@ void KConfigTest::testDelete()
count++;
QCOMPARE(count, 2);
cg.deleteEntry("devices|manual|/mnt/ipod");
- QVERIFY(cf.sync());
+ cf.sync();
Q_FOREACH(const QByteArray& item, readLines())
QVERIFY(!item.contains("ipod"));
}
@@ -763,7 +763,7 @@ void KConfigTest::testDefaultGroup()
defaultGroup.writeEntry("TestKey", "defaultGroup");
QVERIFY(defaultGroup.exists());
QCOMPARE(defaultGroup.readEntry("TestKey", QString()), QString("defaultGroup"));
- QVERIFY(sc.sync());
+ sc.sync();
{
// Test reading it
@@ -792,7 +792,7 @@ void KConfigTest::testDefaultGroup()
}
defaultGroup.deleteGroup();
- QVERIFY(sc.sync());
+ sc.sync();
// Test if deleteGroup worked
lines = readLines();
@@ -808,7 +808,7 @@ void KConfigTest::testEmptyGroup()
emptyGroup.writeEntry("TestKey", "emptyGroup");
QVERIFY(emptyGroup.exists());
QCOMPARE(emptyGroup.readEntry("TestKey", QString()), QString("emptyGroup"));
- QVERIFY(sc.sync());
+ sc.sync();
{
// Test reading it
@@ -836,7 +836,7 @@ void KConfigTest::testEmptyGroup()
QVERIFY(!group.isEmpty() && group != "<default>");
}
emptyGroup.deleteGroup();
- QVERIFY(sc.sync());
+ sc.sync();
// Test if deleteGroup worked
lines = readLines();
@@ -864,7 +864,7 @@ void KConfigTest::testMerge()
<< "entry[es]=Spanish" << endl
<< "entry[de]=German" << endl;
}
- QVERIFY(config.sync());
+ config.sync();
{
QList<QByteArray> lines;
@@ -933,7 +933,7 @@ void KConfigTest::testOptionOrder()
QCOMPARE(cg3.readEntry("entry2",""), QString("unlocalized"));
QVERIFY(!cg3.isEntryImmutable("entry2"));
cg3.writeEntry("entry2","modified");
- QVERIFY(config.sync());
+ config.sync();
{
QList<QByteArray> lines;
@@ -1031,7 +1031,7 @@ void KConfigTest::testSubGroup()
QVERIFY(!group.contains("SubGroup"));
}
- QVERIFY(sc.sync());
+ sc.sync();
// Check that the empty groups are not written out.
const QList<QByteArray> lines = readLines();
@@ -1064,7 +1064,7 @@ void KConfigTest::testAddConfigSources()
KConfigGroup newgrp(&cf, "New Group");
newgrp.writeEntry("New Entry", "SomeValue");
- QVERIFY(cf.sync());
+ cf.sync();
KConfig plaincfg("specificrc");
@@ -1101,7 +1101,7 @@ void KConfigTest::testConfigCopyToSync()
// Prepare source file
KConfigGroup group(&cf1, "CopyToTest");
group.writeEntry("Type", "Test");
- QVERIFY(cf1.sync());
+ cf1.sync();
// Copy to "destination"
const QString destination = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + \
"/kconfigcopytotest"; @@ -1115,7 +1115,7 @@ void KConfigTest::testConfigCopyToSync()
QString testVal = group2.readEntry("Type");
QCOMPARE(testVal, QString("Test"));
// should write to disk the copied data from group
- QVERIFY(cf2.sync());
+ cf2.sync();
QVERIFY(QFile::exists(destination));
}
@@ -1126,7 +1126,7 @@ void KConfigTest::testConfigCopyTo()
// Prepare source file
KConfigGroup group(&cf1, "CopyToTest");
group.writeEntry("Type", "Test");
- QVERIFY(cf1.sync());
+ cf1.sync();
}
{
@@ -1138,7 +1138,7 @@ void KConfigTest::testConfigCopyTo()
KConfigGroup group2(&cf2, "CopyToTest");
QString testVal = group2.readEntry("Type");
QCOMPARE(testVal, QString("Test"));
- QVERIFY(cf2.sync());
+ cf2.sync();
QVERIFY(QFile::exists(destination));
}
@@ -1197,7 +1197,7 @@ void KConfigTest::testWriteOnSync()
// Should not rewrite the global config file.
KConfigGroup cgLocal(&sc, "Locals");
cgLocal.writeEntry("someLocalString", "whatever");
- QVERIFY(sc.sync());
+ sc.sync();
// Verify that the timestamp of global config file didn't change.
newStamp = QFileInfo(globFile).lastModified();
@@ -1213,31 +1213,13 @@ void KConfigTest::testWriteOnSync()
KConfigGroup cgGlobal(&sc, "Globals");
cgGlobal.writeEntry("someGlobalString", "whatever",
KConfig::Persistent|KConfig::Global);
- QVERIFY(sc.sync());
+ sc.sync();
// Verify that the timestamp of local config file didn't change.
newStamp = QFileInfo(locFile).lastModified();
QCOMPARE(newStamp, oldStamp);
}
-void KConfigTest::testFailOnReadOnlyFileSync()
-{
- KConfig sc("kconfigfailonreadonlytest");
- KConfigGroup cgLocal(&sc, "Locals");
-
- cgLocal.writeEntry("someLocalString", "whatever");
- QVERIFY(cgLocal.sync());
-
- QFile f(m_xdgConfigHome + "/" + sc.name());
- QVERIFY(f.exists());
- QVERIFY(f.setPermissions(QFileDevice::ReadOwner));
-
- cgLocal.writeEntry("someLocalString", "whatever2");
- QVERIFY(!cgLocal.sync());
-
- QVERIFY(f.remove());
-}
-
void KConfigTest::testDirtyOnEqual()
{
QDateTime oldStamp, newStamp;
@@ -1246,7 +1228,7 @@ void KConfigTest::testDirtyOnEqual()
// Initialize value
KConfigGroup cgLocal(&sc, "random");
cgLocal.writeEntry("theKey", "whatever");
- QVERIFY(sc.sync());
+ sc.sync();
// Age the timestamp of local config file a few sec, and collect it.
QString locFile = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/kconfigtest";
@@ -1256,7 +1238,7 @@ void KConfigTest::testDirtyOnEqual()
// Write exactly the same again
cgLocal.writeEntry("theKey", "whatever");
// This should be a no-op
- QVERIFY(sc.sync());
+ sc.sync();
// Verify that the timestamp of local config file didn't change.
newStamp = QFileInfo(locFile).lastModified();
@@ -1289,7 +1271,7 @@ void KConfigTest::testCreateDir()
QVERIFY(!QDir().exists(subdir));
KDesktopFile desktopFile(file);
desktopFile.desktopGroup().writeEntry("key", "value");
- QVERIFY(desktopFile.sync());
+ desktopFile.sync();
QVERIFY(QFile::exists(file));
// Cleanup
@@ -1402,7 +1384,7 @@ void KConfigTest::testDeleteWhenLocalized()
// Delete a value. Once with localized, once with Normal
cg.deleteEntry("foostring", KConfigBase::Persistent | KConfigBase::Localized);
cg.deleteEntry("foobool");
- QVERIFY(config.sync());
+ config.sync();
// The value is now gone. The others are still there. Everything correct
// here.
@@ -1450,7 +1432,7 @@ void KConfigTest::testDeleteWhenLocalized()
// Now test the deletion of a group.
cg.deleteGroup();
- QVERIFY(config.sync());
+ config.sync();
// Current state: [ca] and [de] entries left... oops.
//qDebug() << readLinesFrom(file);
@@ -1505,7 +1487,7 @@ void KConfigTest::testKdeGlobals()
KConfig glob("kdeglobals");
KConfigGroup general(&glob, "General");
general.writeEntry("testKG", "1");
- QVERIFY(glob.sync());
+ glob.sync();
}
KConfig globRead("kdeglobals");
@@ -1522,7 +1504,7 @@ void KConfigTest::testKdeGlobals()
KConfig glob("kdeglobals", KConfig::NoGlobals);
KConfigGroup general(&glob, "General");
general.writeEntry("testKG", "2");
- QVERIFY(glob.sync());
+ glob.sync();
}
globRead.reparseConfiguration();
QCOMPARE(general.readEntry("testKG"), QString("2"));
diff --git a/tier2/kconfig/autotests/kconfigtest.h b/tier2/kconfig/autotests/kconfigtest.h
index 69a2719..17a5294 100644
--- a/tier2/kconfig/autotests/kconfigtest.h
+++ b/tier2/kconfig/autotests/kconfigtest.h
@@ -65,7 +65,6 @@ private Q_SLOTS:
void testSubGroup();
void testAddConfigSources();
void testWriteOnSync();
- void testFailOnReadOnlyFileSync();
void testDirtyOnEqual();
void testDirtyOnEqualOverdo();
void testCreateDir();
diff --git a/tier2/kconfig/autotests/ksharedconfigtest.cpp \
b/tier2/kconfig/autotests/ksharedconfigtest.cpp index 7b23f89..2bb612f 100644
--- a/tier2/kconfig/autotests/ksharedconfigtest.cpp
+++ b/tier2/kconfig/autotests/ksharedconfigtest.cpp
@@ -70,7 +70,7 @@ void KSharedConfigTest::testReadWriteSync()
cg.writeEntry("NumKey", value);
}
QVERIFY(!QFile::exists(m_path));
- QVERIFY(KSharedConfig::openConfig()->sync());
+ KSharedConfig::openConfig()->sync();
QVERIFY(QFile::exists(m_path));
{
KConfigGroup cg(KSharedConfig::openConfig(), "KSharedConfigTest");
diff --git a/tier2/kconfig/src/core/kconfig.cpp b/tier2/kconfig/src/core/kconfig.cpp
index f849053..d26f941 100644
--- a/tier2/kconfig/src/core/kconfig.cpp
+++ b/tier2/kconfig/src/core/kconfig.cpp
@@ -392,13 +392,14 @@ QMap<QString,QString> KConfig::entryMap(const QString& aGroup) const
return theMap;
}
-bool KConfig::sync()
+// TODO KDE5: return a bool value
+void KConfig::sync()
{
Q_D(KConfig);
if (isImmutable() || name().isEmpty()) {
// can't write to an immutable or anonymous file.
- return false;
+ return;
}
if (d->bDirty && d->mBackend) {
@@ -410,7 +411,7 @@ bool KConfig::sync()
// lock the local file
if (d->configState == ReadWrite && !d->lockLocal()) {
qWarning() << "couldn't lock local file";
- return false;
+ return;
}
// Rewrite global/local config only if there is a dirty entry in it.
@@ -437,10 +438,12 @@ bool KConfig::sync()
if (d->configState == ReadWrite && !tmp->lock()) {
qWarning() << "couldn't lock global file";
d->bDirty = true;
- return false;
+ return;
}
if (!tmp->writeConfig(utf8Locale, d->entryMap, KConfigBackend::WriteGlobal)) {
d->bDirty = true;
+ // TODO KDE5: return false? (to tell the app that writing wasn't possible, e.g.
+ // config file is immutable or disk full)
}
if (tmp->isLocked()) {
tmp->unlock();
@@ -450,13 +453,14 @@ bool KConfig::sync()
if (writeLocals) {
if (!d->mBackend->writeConfig(utf8Locale, d->entryMap, KConfigBackend::WriteOptions())) {
d->bDirty = true;
+ // TODO KDE5: return false? (to tell the app that writing wasn't possible, e.g.
+ // config file is immutable or disk full)
}
}
if (d->mBackend->isLocked()) {
d->mBackend->unlock();
}
}
- return !d->bDirty;
}
void KConfig::markAsClean()
diff --git a/tier2/kconfig/src/core/kconfig.h b/tier2/kconfig/src/core/kconfig.h
index aad2eab..597330f 100644
--- a/tier2/kconfig/src/core/kconfig.h
+++ b/tier2/kconfig/src/core/kconfig.h
@@ -159,7 +159,7 @@ public:
QString name() const;
/// @reimp
- bool sync();
+ void sync();
/// @reimp
void markAsClean();
diff --git a/tier2/kconfig/src/core/kconfigbase.h b/tier2/kconfig/src/core/kconfigbase.h
index 782ff4b..ce190f3 100644
--- a/tier2/kconfig/src/core/kconfigbase.h
+++ b/tier2/kconfig/src/core/kconfigbase.h
@@ -119,7 +119,7 @@ public:
* not overwritten. Note however, that this object is @em not automatically
* updated with those changes.
*/
- virtual bool sync() = 0;
+ virtual void sync() = 0;
/**
* Reset the dirty flags of all entries in the entry map, so the
diff --git a/tier2/kconfig/src/core/kconfiggroup.cpp b/tier2/kconfig/src/core/kconfiggroup.cpp
index 79f3b86..53cac13 100644
--- a/tier2/kconfig/src/core/kconfiggroup.cpp
+++ b/tier2/kconfig/src/core/kconfiggroup.cpp
@@ -589,14 +589,12 @@ bool KConfigGroup::exists() const
return config()->hasGroup( d->fullName() );
}
-bool KConfigGroup::sync()
+void KConfigGroup::sync()
{
Q_ASSERT_X(isValid(), "KConfigGroup::sync", "accessing an invalid group");
if (!d->bConst)
- return config()->sync();
-
- return false;
+ config()->sync();
}
QMap<QString, QString> KConfigGroup::entryMap() const
diff --git a/tier2/kconfig/src/core/kconfiggroup.h b/tier2/kconfig/src/core/kconfiggroup.h
index de982c6..ff63afa 100644
--- a/tier2/kconfig/src/core/kconfiggroup.h
+++ b/tier2/kconfig/src/core/kconfiggroup.h
@@ -126,7 +126,7 @@ public:
*
* Syncs the parent config.
*/
- bool sync();
+ void sync();
/// @reimp
void markAsClean();
diff --git a/tier2/kconfig/src/core/kcoreconfigskeleton.cpp \
b/tier2/kconfig/src/core/kcoreconfigskeleton.cpp index 1852d08..c0ad044 100644
--- a/tier2/kconfig/src/core/kcoreconfigskeleton.cpp
+++ b/tier2/kconfig/src/core/kcoreconfigskeleton.cpp
@@ -1072,7 +1072,7 @@ void KCoreConfigSkeleton::readConfig()
usrReadConfig();
}
-bool KCoreConfigSkeleton::writeConfig()
+void KCoreConfigSkeleton::writeConfig()
{
//kDebug(kCoreConfigSkeletionDebugArea());
KConfigSkeletonItem::List::ConstIterator it;
@@ -1080,17 +1080,13 @@ bool KCoreConfigSkeleton::writeConfig()
{
(*it)->writeConfig( d->mConfig.data() );
}
- if (!usrWriteConfig())
- return false;
+ usrWriteConfig();
- if (!d->mConfig->sync())
- return false;
+ d->mConfig->sync();
readConfig();
Q_EMIT configChanged();
-
- return true;
}
bool KCoreConfigSkeleton::usrUseDefaults(bool)
@@ -1106,9 +1102,8 @@ void KCoreConfigSkeleton::usrReadConfig()
{
}
-bool KCoreConfigSkeleton::usrWriteConfig()
+void KCoreConfigSkeleton::usrWriteConfig()
{
- return true;
}
void KCoreConfigSkeleton::addItem( KConfigSkeletonItem *item, const QString &name )
diff --git a/tier2/kconfig/src/core/kcoreconfigskeleton.h b/tier2/kconfig/src/core/kcoreconfigskeleton.h
index 75f6fa2..3e4971b 100644
--- a/tier2/kconfig/src/core/kcoreconfigskeleton.h
+++ b/tier2/kconfig/src/core/kcoreconfigskeleton.h
@@ -1357,7 +1357,7 @@ public Q_SLOTS:
* If you need more fine-grained control of storing the settings from
* the registered items you can override writeConfig() in a derived class.
*/
- virtual bool writeConfig();
+ virtual void writeConfig();
Q_SIGNALS:
/**
@@ -1395,7 +1395,7 @@ protected:
* Override in derived classes to write special config values.
* Called from @ref writeConfig()
*/
- virtual bool usrWriteConfig();
+ virtual void usrWriteConfig();
private:
class Private;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic