[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdecore/config
From:       Thomas Braxton <kde.braxton () gmail ! com>
Date:       2008-01-15 20:17:16
Message-ID: 1200428236.861163.6942.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 761977 by braxton:

Write out immutable markers for immutable groups.


 M  +11 -4     kconfigini.cpp  


--- trunk/KDE/kdelibs/kdecore/config/kconfigini.cpp #761976:761977
@@ -248,6 +248,7 @@
                                      const KEntryMap& map, bool defaultGroup, bool \
&firstEntry)  {
     QByteArray currentGroup;
+    bool groupIsImmutable = false;
     const KEntryMapConstIterator end = map.constEnd();
     for (KEntryMapConstIterator it = map.constBegin(); it != end; ++it) {
         const KEntryKey& key = it.key();
@@ -256,9 +257,11 @@
         if ((key.mGroup != "<default>") == defaultGroup)
             continue; // skip
 
-        // Skip group headers
-        if (key.mKey.isNull())
+        // the only thing we care about groups is, is it immutable?
+        if (key.mKey.isNull()) {
+            groupIsImmutable = it->bImmutable;
             continue; // skip
+        }
 
         const KEntry& currentEntry = *it;
         if (!defaultGroup && currentGroup != key.mGroup) {
@@ -281,7 +284,11 @@
                     }
                   nope:
                     file.write(stringToPrintable(currentGroup.mid(start), \
                GroupString));
-                    file.write("]\n", 2);
+                    file.putChar(']');
+                    if (groupIsImmutable) {
+                        file.write("[$i]", 4);
+                    }
+                    file.putChar('\n');
                     break;
                 } else {
                     file.write(stringToPrintable(currentGroup.mid(start, end - \
start), GroupString)); @@ -353,7 +360,7 @@
     }
     const KEntryMapIterator end = entryMap.end();
     for (KEntryMapIterator it=entryMap.begin(); it != end; ++it) {
-        if (!it->bDirty) // not dirty, doesn't overwrite entry in writeMap. skips \
default entries, too. +        if (!it.key().mKey.isEmpty() && !it->bDirty) // not \
dirty, doesn't overwrite entry in writeMap. skips default entries, too.  continue;
 
         const KEntryKey& key = it.key();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic