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

List:       kde-commits
Subject:    KDE/kdelibs/kdeui
From:       Kevin Ottens <ervin () kde ! org>
Date:       2010-10-25 15:40:02
Message-ID: 20101025154003.01B3EAC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1189697 by ervin:

Allow to use KCoreConfigSkeleton, not only the kdeui specific subclass.


 M  +9 -1      dialogs/kconfigdialogmanager.cpp  
 M  +8 -0      dialogs/kconfigdialogmanager.h  
 M  +9 -0      widgets/kcmodule.cpp  
 M  +12 -0     widgets/kcmodule.h  


--- trunk/KDE/kdelibs/kdeui/dialogs/kconfigdialogmanager.cpp #1189696:1189697
@@ -53,7 +53,7 @@
   /**
   * KConfigSkeleton object used to store settings
    */
-  KConfigSkeleton *m_conf;
+  KCoreConfigSkeleton *m_conf;
 
   /**
   * Dialog being managed
@@ -66,6 +66,14 @@
   bool trackChanges : 1;
 };
 
+KConfigDialogManager::KConfigDialogManager(QWidget *parent, KCoreConfigSkeleton *conf)
+ : QObject(parent), d(new Private(this))
+{
+  d->m_conf = conf;
+  d->m_dialog = parent;
+  init(true);
+}
+
 KConfigDialogManager::KConfigDialogManager(QWidget *parent, KConfigSkeleton *conf)
  : QObject(parent), d(new Private(this))
 {
--- trunk/KDE/kdelibs/kdeui/dialogs/kconfigdialogmanager.h #1189696:1189697
@@ -26,6 +26,7 @@
 #include <QtCore/QObject>
 #include <QtCore/QHash>
 
+class KCoreConfigSkeleton;
 class KConfigSkeleton;
 class KConfigSkeletonItem;
 class QWidget;
@@ -119,6 +120,13 @@
    * @param parent  Dialog widget to manage
    * @param conf Object that contains settings
    */
+   KConfigDialogManager(QWidget *parent, KCoreConfigSkeleton *conf);
+
+  /**
+   * Constructor.
+   * @param parent  Dialog widget to manage
+   * @param conf Object that contains settings
+   */
    KConfigDialogManager(QWidget *parent, KConfigSkeleton *conf);
 
   /**
--- trunk/KDE/kdelibs/kdeui/widgets/kcmodule.cpp #1189696:1189697
@@ -125,6 +125,15 @@
     d->_buttons = buttons;
 }
 
+KConfigDialogManager* KCModule::addConfig( KCoreConfigSkeleton *config, QWidget* widget )
+{
+    KConfigDialogManager* manager = new KConfigDialogManager( widget, config );
+    manager->setObjectName( objectName() );
+    connect( manager, SIGNAL( widgetModified() ), SLOT( widgetChanged() ));
+    d->managers.append( manager );
+    return manager;
+}
+
 KConfigDialogManager* KCModule::addConfig( KConfigSkeleton *config, QWidget* widget )
 {
     KConfigDialogManager* manager = new KConfigDialogManager( widget, config );
--- trunk/KDE/kdelibs/kdeui/widgets/kcmodule.h #1189696:1189697
@@ -35,6 +35,7 @@
 class QStringList;
 class KAboutData;
 class KConfigDialogManager;
+class KCoreConfigSkeleton;
 class KConfigSkeleton;
 class KCModulePrivate;
 class KComponentData;
@@ -302,6 +303,17 @@
 
 protected:
   /**
+   * Adds a KCoreConfigskeleton @p config to watch the widget @p widget
+   *
+   * This function is useful if you need to handle multiple configuration files.
+   *
+   * @return a pointer to the KCoreConfigDialogManager in use
+   * @param config the KCoreConfigSkeleton to use
+   * @param widget the widget to watch
+   */
+  KConfigDialogManager* addConfig( KCoreConfigSkeleton *config, QWidget* widget );
+
+  /**
    * Adds a KConfigskeleton @p config to watch the widget @p widget
    *
    * This function is useful if you need to handle multiple configuration files.
[prev in list] [next in list] [prev in thread] [next in thread] 

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