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

List:       kde-commits
Subject:    [kde-workspace/KDE/4.8] plasma/generic/applets/icon: don't create a .desktop file if it is a directo
From:       Aaron Seigo <aseigo () kde ! org>
Date:       2012-01-26 22:16:10
Message-ID: 20120126221610.E4EC4A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit dccbb27fbe93ec287260957e5db8e3e0b94b89a2 by Aaron Seigo.
Committed on 26/01/2012 at 23:15.
Pushed by aseigo into branch 'KDE/4.8'.

don't create a .desktop file if it is a directory (which are usually also executable)

BUG:292455

M  +7    -8    plasma/generic/applets/icon/icon.cpp

http://commits.kde.org/kde-workspace/dccbb27fbe93ec287260957e5db8e3e0b94b89a2

diff --git a/plasma/generic/applets/icon/icon.cpp b/plasma/generic/applets/icon/icon.cpp
index b25e5d6..9f5b212 100644
--- a/plasma/generic/applets/icon/icon.cpp
+++ b/plasma/generic/applets/icon/icon.cpp
@@ -146,24 +146,23 @@ void IconApplet::setUrl(const KUrl& url, bool fromConfigDialog)
     disconnect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)),
                this, SLOT(checkService(QStringList)));
 
+    m_hasDesktopFile = false;
     delete m_watcher;
     m_watcher = 0;
-    if (m_url.isLocalFile()) {
-        m_watcher = new KDirWatch;
-        m_watcher->addFile(m_url.toLocalFile());
-        connect(m_watcher, SIGNAL(deleted(QString)), this, SLOT(delayedDestroy()));
-    }
 
     // if local
-    //   if executable
+    //   if not a directory and executable
     //     make desktop file
     //    desktop file
-    m_hasDesktopFile = false;
     if (m_url.isLocalFile()) {
+        m_watcher = new KDirWatch;
+        m_watcher->addFile(m_url.toLocalFile());
+        connect(m_watcher, SIGNAL(deleted(QString)), this, SLOT(delayedDestroy()));
+
         QFileInfo fi(m_url.toLocalFile());
         if (KDesktopFile::isDesktopFile(m_url.toLocalFile())) {
             m_hasDesktopFile = true;
-        } else if (fi.isExecutable()) {
+        } else if (!fi.isDir() && fi.isExecutable()) {
             const QString suggestedName = fi.baseName();
             const QString file = KService::newServicePath(false, suggestedName);
             KDesktopFile df(file);
[prev in list] [next in list] [prev in thread] [next in thread] 

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