[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/systemsettings
From: Ben Cooksley <sourtooth () gmail ! com>
Date: 2010-04-12 7:30:26
Message-ID: 20100412073026.80D02AC896 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1113902 by bcooksley:
Add support for finding Lost modules
M +18 -1 app/SettingsBase.cpp
M +5 -0 core/MenuItem.cpp
M +7 -0 core/MenuItem.h
--- trunk/KDE/kdebase/workspace/systemsettings/app/SettingsBase.cpp #1113901:1113902
@@ -79,10 +79,19 @@
{
// Prepare the menu of all modules
categories = KServiceTypeTrader::self()->query("SystemSettingsCategory");
- modules = KServiceTypeTrader::self()->query("KCModule");
+ modules = KServiceTypeTrader::self()->query("KCModule", \
"[X-KDE-System-Settings-Parent-Category] != ''");
modules += KServiceTypeTrader::self()->query("SystemSettingsExternalApp");
rootModule = new MenuItem( true, 0 );
initMenuList(rootModule);
+ // Handle lost+found modules...
+ MenuItem * lostFound = new MenuItem( true, rootModule->children().first() );
+ lostFound->setName( i18n("Lost and Found") );
+ for (int i = 0; i < modules.size(); ++i) {
+ const KService::Ptr entry = modules.at(i);
+ MenuItem * infoItem = new MenuItem(false, lostFound);
+ infoItem->setService( entry );
+ kWarning() << "Added " << entry->name();
+ }
// Prepare the Base Data
BaseData::instance()->setMenuItem( rootModule );
// Load all possible views
@@ -190,6 +199,8 @@
}
}
+ KService::List removeList;
+
// scan for any modules at this level and add them
for (int i = 0; i < modules.size(); ++i) {
const KService::Ptr entry = modules.at(i);
@@ -198,8 +209,14 @@
// Add the module info to the menu
MenuItem * infoItem = new MenuItem(false, parent);
infoItem->setService( entry );
+ removeList.append( modules.at(i) );
}
}
+
+ for (int i = 0; i < removeList.size(); ++i) {
+ modules.removeOne( removeList.at(i) );
+ }
+
parent->sortChildrenByWeight();
}
--- trunk/KDE/kdebase/workspace/systemsettings/core/MenuItem.cpp #1113901:1113902
@@ -136,3 +136,8 @@
d->weight = 100;
}
}
+
+void MenuItem::setName( const QString& name )
+{
+ d->name = name;
+}
--- trunk/KDE/kdebase/workspace/systemsettings/core/MenuItem.h #1113901:1113902
@@ -155,6 +155,13 @@
*/
void setService( const KService::Ptr& service );
+ /**
+ * Sets the name of the object, which is used for categories which have no \
service object + *
+ * @param name The name of the item.
+ */
+ void setName( const QString& name );
+
private:
class Private;
Private *const d;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic