Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 31e1296274b13d07b478531793fc3fda > files > 28

kdebase-3.5.9-4mdv2008.0.src.rpm

diff -p -up kdebase-3.5.8/kicker/kicker/ui/service_mnu.cpp.kmenu_tooltip kdebase-3.5.8/kicker/kicker/ui/service_mnu.cpp
--- kdebase-3.5.8/kicker/kicker/ui/service_mnu.cpp.kmenu_tooltip	2008-02-13 14:56:22.000000000 -0200
+++ kdebase-3.5.8/kicker/kicker/ui/service_mnu.cpp	2008-02-13 17:12:31.000000000 -0200
@@ -26,6 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include <qbitmap.h>
 #include <qpixmap.h>
 #include <qimage.h>
+#include <qtooltip.h>
 
 #include <dcopclient.h>
 #include <kapplication.h>
@@ -69,6 +70,8 @@ PanelServiceMenu::PanelServiceMenu(const
     connect(KSycoca::self(), SIGNAL(databaseChanged()),
             SLOT(slotClearOnClose()));
     connect(this, SIGNAL(aboutToHide()), this, SLOT(slotClose()));
+
+    connect(this, SIGNAL(highlighted(int)), this, SLOT(slotSetTooltip(int)));
 }
 
 PanelServiceMenu::~PanelServiceMenu()
@@ -821,3 +824,17 @@ void PanelServiceMenu::updateRecentlyUse
     RecentlyLaunchedApps::the().m_bNeedToUpdate = true;
 }
 
+void PanelServiceMenu::slotSetTooltip(int id)
+{
+    QToolTip::remove(this);
+    if (entryMap_.contains(id) && entryMap_[id]->isType(KST_KService))
+    {
+        KService::Ptr s(static_cast<KService *>(entryMap_[id].data()));
+        QString text;
+        if (!s->genericName().isEmpty())
+            text = s->genericName();
+        if (text.isEmpty() && !s->comment().isEmpty())
+            text = s->comment();
+        QToolTip::add(this, text);
+    }
+}
diff -p -up kdebase-3.5.8/kicker/kicker/ui/service_mnu.h.kmenu_tooltip kdebase-3.5.8/kicker/kicker/ui/service_mnu.h
--- kdebase-3.5.8/kicker/kicker/ui/service_mnu.h.kmenu_tooltip	2008-02-13 14:56:33.000000000 -0200
+++ kdebase-3.5.8/kicker/kicker/ui/service_mnu.h	2008-02-13 17:11:15.000000000 -0200
@@ -75,6 +75,7 @@ protected slots:
     virtual void slotClear();
     virtual void configChanged();
     virtual void slotClose();
+    void slotSetTooltip(int id);
     void slotDragObjectDestroyed();
 
     // for use in Add Applicaton To Panel