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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/kickoff/core
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2009-04-27 22:41:09
Message-ID: 1240872069.366790.20091.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 960100 by aseigo:

only count items as duplicates if all user visible information matches (name, generic name and icon name)
BUG:175161


 M  +20 -12    applicationmodel.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/kickoff/core/applicationmodel.cpp #960099:960100
@@ -85,6 +85,7 @@
     QList<AppNode*> children;
 
     QIcon icon;
+    QString iconName;
     QString genericName;
     QString appName;
     QString relPath;
@@ -172,23 +173,28 @@
             // check for duplicates (eg. KDE 3 and KDE 4 versions of application
             // both present)
             if (duplicatePolicy == ApplicationModel::ShowLatestOnlyPolicy &&
-                    existingServices.contains(appName)) {
+                existingServices.contains(appName)) {
                 if (Kickoff::isLaterVersion(existingServices[appName], service)) {
                     continue;
                 } else {
                     // find and remove the existing entry with the same name
                     for (int i = node->children.count() - 1; i >= 0; --i) {
-                        if (node->children[i]->appName == appName) {
-                            AppNode* n = node->children.takeAt(i);
-                            const QString s = n->genericName.toLower();
-                            if(genericNames.contains(s)) {
-                                QList<AppNode*> l = genericNames[s];
-                                for(int j = l.count() - 1; j >= 0; --j)
-                                    if(l[j] == n)
-                                        l.takeAt(j);
-                                genericNames[s] = l;
+                        AppNode *app = node->children.at(i);
+                        if (app->appName == appName &&
+                            app->genericName == genericName &&
+                            app->iconName == icon) {
+                            app = node->children.takeAt(i);
+                            const QString s = app->genericName.toLower();
+                            if (genericNames.contains(s)) {
+                                QList<AppNode*> list = genericNames[s];
+                                for (int j = list.count() - 1; j >= 0; --j) {
+                                    if(list.at(j) == app) {
+                                        list.takeAt(j);
+                                    }
+                                }
+                                genericNames[s] = list;
                             }
-                            delete n;
+                            delete app;
                         }
                     }
                 }
@@ -205,8 +211,9 @@
         } else if (p->isType(KST_KServiceGroup)) {
             const KServiceGroup::Ptr serviceGroup = KServiceGroup::Ptr::staticCast(p);
 
-            if (serviceGroup->noDisplay() || serviceGroup->childCount() == 0)
+            if (serviceGroup->noDisplay() || serviceGroup->childCount() == 0) {
                 continue;
+            }
 
             kDebug(250) << "Service group" << serviceGroup->entryPath() << serviceGroup->icon()
             << serviceGroup->relPath() << serviceGroup->directoryEntryPath();
@@ -228,6 +235,7 @@
         }
 
         AppNode *newnode = new AppNode();
+        newnode->iconName = icon;
         newnode->icon = KIcon(icon);
         newnode->appName = appName;
         newnode->genericName = genericName;
[prev in list] [next in list] [prev in thread] [next in thread] 

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