]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use KService to lookup the library name of konsolepart
authorJekyll Wu <adaptee@gmail.com>
Thu, 24 May 2012 16:54:08 +0000 (00:54 +0800)
committerJekyll Wu <adaptee@gmail.com>
Thu, 24 May 2012 16:54:08 +0000 (00:54 +0800)
See https://git.reviewboard.kde.org/r/105028/

src/panels/terminal/terminalpanel.cpp

index 5fa0a0762e0191ca0ed556f169708caa79f7d24a..b3bbe11e832ac714bc848221c6e8bfe4dd4ef297 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <KPluginLoader>
 #include <KPluginFactory>
+#include <KService>
 #include <kde_terminal_interface_v2.h>
 #include <KParts/Part>
 #include <KShell>
@@ -100,7 +101,11 @@ void TerminalPanel::showEvent(QShowEvent* event)
 
     if (!m_terminal) {
         m_clearTerminal = true;
-        KPluginFactory* factory = KPluginLoader("libkonsolepart").factory();
+        KPluginFactory* factory = 0;
+        KService::Ptr service = KService::serviceByDesktopName("konsolepart");
+        if(service) {
+            factory = KPluginLoader(service->library()).factory();
+        }
         m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0;
         if (m_konsolePart) {
             connect(m_konsolePart, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited()));