On Friday 19 September 2008 16:16:16 Aaron J. Seigo wrote:
> > (or perhaps some other solution)?
>
> let me look at kconfigskeleton today...

Would this be too big hack until kconfigskeleton supports groups? What I 
looked kconfigskeleton it has to be changed quite a bit to support 
kconfiggroup.

Index: applet.cpp                                                               
                                       
===================================================================             
                                       
--- applet.cpp  (revision 862877)
+++ applet.cpp  (working copy)
@@ -41,6 +41,7 @@
 #include <QTextDocument>
 #include <QTimer>
 #include <QUiLoader>
+#include <QBuffer>

 #include <KAction>
 #include <KIcon>
@@ -1680,9 +1681,28 @@
     if (!xmlPath.isEmpty()) {
         QFile file(xmlPath);
         // FIXME: KConfigSkeleton doesn't play well with KConfigGroup =/
-        KConfigGroup config = q->config();
-        configXml = new ConfigXml(&config, &file);
-        QObject::connect(configXml, SIGNAL(configChanged()), q, 
SLOT(configChanged()));
+        if (file.open(QIODevice::ReadOnly)) {
+            QString group;
+            if (isContainment) {
+                group = "Containments";
+            } else {
+                if (q->containment()) {
+                    group = "Containments" + '\x1d' + QString::number(q-
>containment()->id()) + '\x1d';
+                }
+                group += "Applets";
+            }
+            group += '\x1d' + QString::number(appletId) + '\x1d' + 
"Configuration";
+
+            QString xml = file.readAll();
+            xml.replace(QRegExp("<\\s*group([^>]*)name\\s*=\\s*\"[^\"]*\""),
+                        QString("<group \\1 name=\"%1\"").arg(group));
+            QByteArray ba = xml.toUtf8();
+            QBuffer buffer(&ba);
+            KConfigGroup config = q->config();
+            configXml = new ConfigXml(&config, &buffer);
+            QObject::connect(configXml, SIGNAL(configChanged()), q, 
SLOT(configChanged()));
+        }
     }

     if (!package->filePath("mainconfigui").isEmpty()) {


> > Is there a preferred file extension for plasmoid plasma packages?
>
> .loveandhugs.
>
> no, wait, that's another project. uhm...
>
> .plasmoid? =)

Yep, sounds good :-)

Petri


Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to