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

List:       kde-core-devel
Subject:    Using non-internal names for resource managers
From:       Bram Schoenmakers <bram_s () softhome ! net>
Date:       2004-10-18 13:34:32
Message-ID: 200410181534.33098.bram_s () softhome ! net
[Download RAW message or body]

Hi,

I noticed that the combo inside the KCM for KResources shows internal names 
instead of translated and marked up names for the managers. Thus, instead of 
"contact" it should read "Contacts" (eventually i18n'ified).

I tryed to solve this by creating a desktop file for each manager 
(KResources/Manager) which contains a normal name for manager. These 
*.desktops are read when composing the combobox in the KCM (see attached 
diff).

I created desktop files for "contact", "calendar", "notes" and "konnector". If 
I forgot some kind of resource, please let me know. An example desktop for 
"contact" is included.

Is it OK to commit? Please CC me since I'm not able to read this list ATM.

-- 
Bram Schoenmakers
KDE Netherlands (www.kde.nl)

["kresources_manager.desktop" (application/x-desktop)]
["kabc_manager.desktop" (application/x-desktop)]
["diff" (text/x-diff)]

Index: configpage.cpp
===================================================================
RCS file: /home/kde/kdelibs/kresources/configpage.cpp,v
retrieving revision 1.32
diff -B -b -p -u -3 -r1.32 configpage.cpp
--- configpage.cpp	19 Jun 2004 09:02:26 -0000	1.32
+++ configpage.cpp	18 Oct 2004 13:31:49 -0000
@@ -171,16 +171,17 @@ void ConfigPage::load()
   mFamilyMap.clear();
   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 );
 
           ResourcePageInfo *info = new ResourcePageInfo;
@@ -192,7 +193,7 @@ void ConfigPage::load()
         }
       }
     }
-  }
+
   mCurrentManager = 0;
 
   mFamilyCombo->clear();


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

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