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

List:       kde-commits
Subject:    [plasmate/terietor/tools] plasmoidviewer: fix "plasmoidviewer packagepath" behaviour
From:       Marco Martin <notmart () gmail ! com>
Date:       2012-08-16 18:41:51
Message-ID: 20120816184151.C3AD9A610D () git ! kde ! org
[Download RAW message or body]

Git commit 02c6d866340403b7d081e9b62983e447fac59f67 by Marco Martin.
Committed on 22/02/2012 at 18:17.
Pushed by tsiapaliwkas into branch 'terietor/tools'.

fix "plasmoidviewer packagepath" behaviour

M  +14   -13   plasmoidviewer/main.cpp

http://commits.kde.org/plasmate/02c6d866340403b7d081e9b62983e447fac59f67

diff --git a/plasmoidviewer/main.cpp b/plasmoidviewer/main.cpp
index a3786f3..a70ef64 100644
--- a/plasmoidviewer/main.cpp
+++ b/plasmoidviewer/main.cpp
@@ -187,24 +187,25 @@ int main(int argc, char **argv)
 
         kDebug() << "setting applet to" << pluginName;
 
-        KPluginInfo::List appletList = Plasma::Applet::listAppletInfo();
+        if (!QFile::exists(pluginName + "/metadata.desktop")) {
+            KPluginInfo::List appletList = Plasma::Applet::listAppletInfo();
 
-        bool appletFound = false;
-        foreach (const KPluginInfo& info, appletList) {
+            bool appletFound = false;
+            foreach (const KPluginInfo& info, appletList) {
 
-            if (info.pluginName() == pluginName) {
-                appletFound = true;
-                break;
+                if (info.pluginName() == pluginName) {
+                    appletFound = true;
+                    break;
+                }
             }
-        }
 
-        if (!appletFound) {
-            kError() << "Fatal error. Applet: " + pluginName +
-                " is invalid. Did you run kbuildsycoca4? List known containments \
                through --list";
-            kError() << "Note: only accepts applet Plugin Name (visible through \
                --list), not user-visible name";
-            return 1;
+            if (!appletFound) {
+                kError() << "Fatal error. Applet: " + pluginName +
+                    " is invalid. Did you run kbuildsycoca4? List known containments \
through --list"; +                kError() << "Note: only accepts applet Plugin Name \
(visible through --list), not user-visible name"; +                return 1;
+            }
         }
-
     }
 
     QString formfactor = args->getOption("formfactor");


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

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