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

List:       kde-panel-devel
Subject:    Kickoff fix
From:       dantti85-dev () yahoo ! com ! br
Date:       2009-05-30 3:01:25
Message-ID: 471959.49844.qm () web32106 ! mail ! mud ! yahoo ! com
[Download RAW message or body]

Hi,
there is a bug in kickoff when dealing with old applications
that install .desktop at applnk. KSycoca returns a relative
path and as David Faure said it should be handled in kickoff,
in the case what happens is that kvirc from kde3 when added
to favorites looses it's icon, and when added to the desktop
does not work at all.

I've made a patch so please take a look, if it's ok, i'll commit.

Thanks,
Daniel.



      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
["kickoff.diff" (text/x-diff)]

Index: plasma/applets/kickoff/core/models.cpp
===================================================================
--- plasma/applets/kickoff/core/models.cpp	(revisão 975387)
+++ plasma/applets/kickoff/core/models.cpp	(cópia de trabalho)
@@ -59,7 +59,9 @@
 
     QStandardItem *item = 0;
 
-    if (url.isLocalFile() && urlString.endsWith(".desktop")) {
+    // We can't check if it's a local file since legacy .desktop at applnk
+    // receive relative paths
+    if (urlString.endsWith(".desktop")) {
         // .desktop files may be services (type field == 'Application' or 'Service')
         // or they may be other types such as links.
         //
Index: plasma/applets/kickoff/ui/contextmenufactory.cpp
===================================================================
--- plasma/applets/kickoff/ui/contextmenufactory.cpp	(revisão 975387)
+++ plasma/applets/kickoff/ui/contextmenufactory.cpp	(cópia de trabalho)
@@ -38,6 +38,7 @@
 #include <Solid/OpticalDrive>
 #include <Solid/OpticalDisc>
 #include <KUrl>
+#include <KStandardDirs>
 
 // Plasma
 #include <Plasma/Containment>
@@ -154,7 +155,15 @@
 
             if (desktop && desktop->immutability() == Plasma::Mutable) {
                 addToDesktopAction->setText(i18n("Add to Desktop"));
-                actions << addToDesktopAction;
+                // There might be relative paths, we need to locate them
+                if (kurl.isRelative()) {
+                    kurl = KStandardDirs::locate("apps", url);
+                    if (!kurl.isEmpty()) {
+                        actions << addToDesktopAction;
+                    }
+                } else {
+                    actions << addToDesktopAction;
+                }
             }
         }
 
@@ -234,7 +243,7 @@
                     Plasma::Containment *desktop = corona->containmentForScreen(containment->screen());
                     if (desktop) {
                         QVariantList args;
-                        args << url;
+                        args << kurl.url();
                         desktop->addApplet("icon", args);
                     }
                 }
@@ -246,7 +255,7 @@
             Plasma::Containment *panel = d->applet->containment();
             if (panel) {
                 QVariantList args;
-                args << url;
+                args << kurl.url();
 
                 // move it to the middle of the panel
                 QRectF rect(panel->geometry().width() / 2, 0, 150, panel->boundingRect().height());


_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

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