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

List:       kde-commits
Subject:    kdelibs/kresources
From:       Bram Schoenmakers <bramschoenmakers () kde ! nl>
Date:       2004-10-29 8:51:19
Message-ID: 20041029085119.EA6FD16B7F () office ! kde ! org
[Download RAW message or body]

CVS commit by bram: 

The KCM for KResources shows internal names for resource families. Now it's possible \
to add normal / translatable entries to the combo.

Each family requires a new *.desktop file of the type KResources/Manager. I'll commit \
these desktops for kabc, konnector, kcal and knotes.


  M +2 -2      Makefile.am   1.18
  M +17 -16    configpage.cpp   1.33
  M +4 -0      manager.h   1.30


--- kdelibs/kresources/configpage.cpp  #1.32:1.33
@@ -172,14 +172,15 @@ void ConfigPage::load()
   mInfoMap.clear();
 
-  KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin" );
-  KTrader::OfferList::ConstIterator it;
-  for ( it = plugins.begin(); it != plugins.end(); ++it ) {
-    QVariant tmp = (*it)->property( "X-KDE-ResourceFamily" );
+  KTrader::OfferList managers = KTrader::self()->query( "KResources/Manager" );
+  KTrader::OfferList::ConstIterator m_it;
+  for( m_it = managers.begin(); m_it != managers.end(); ++m_it ) {
+    QVariant tmp = (*m_it)->property( "Name" );
+    QString displayName = tmp.toString();
+    mFamilyMap.append( displayName );
+    tmp = (*m_it)->property( "X-KDE-ResourceFamily" );
     QString family = tmp.toString();
     if ( !family.isEmpty() ) {
-      if ( !mFamilyMap.contains( family ) ) {
         mCurrentManager = new Manager<Resource>( family );
         if ( mCurrentManager ) {
-          mFamilyMap.append( family );
           mCurrentManager->addObserver( this );
 
@@ -193,5 +194,5 @@ void ConfigPage::load()
       }
     }
-  }
+
   mCurrentManager = 0;
 

--- kdelibs/kresources/Makefile.am  #1.17:1.18
@@ -27,5 +27,5 @@
   selectdialog.h \
   configdialog.h \
-  configpage.h 
+  configpage.h
 
 kde_module_LTLIBRARIES = kcm_kresources.la
@@ -45,5 +45,5 @@
 
 servicetypedir = $(kde_servicetypesdir)
-servicetype_DATA = kresources_plugin.desktop
+servicetype_DATA = kresources_plugin.desktop kresources_manager.desktop
 
 include ../admin/Doxyfile.am

--- kdelibs/kresources/manager.h  #1.29:1.30
@@ -71,4 +71,8 @@ class ManagerNotifier
   notified about resource configuration changes, you have to subclass
   ManagerObserver and add it to the Manager by addObserver().
+
+  Since KDE 3.4 it's required to supply your application with a *.desktop
+  file for each resource family you introduce. The ServiceType should be of
+  KResources/Manager.
 */
 template<class T>


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

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