]> git.pld-linux.org Git - packages/ktorrent.git/commitdiff
- up to 4.1.3; stbr auto/th/ktorrent-4.1.3-1
authorMariusz Mazur <mmazur@pld-linux.org>
Tue, 28 Feb 2012 14:14:20 +0000 (14:14 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ktorrent.spec -> 1.81
    plasma_applet_remove_taskmanager.diff -> 1.1

ktorrent.spec
plasma_applet_remove_taskmanager.diff [new file with mode: 0644]

index e4886a2ce9e9d15c064535815329c0840c5a8144..e5c67a205714ea9acbc912edef273268d5b49f9e 100644 (file)
@@ -6,12 +6,13 @@ Summary:      Native KDE BitTorrent client
 Summary(de.UTF-8):     Ein nativer KDE BitTorrent Klient
 Summary(pl.UTF-8):     Natywny klient BitTorrenta dla KDE
 Name:          ktorrent
-Version:       4.1.2
+Version:       4.1.3
 Release:       1
 License:       GPL
 Group:         Applications/Networking
 Source0:       http://ktorrent.org/downloads/%{version}/%{name}-%{version}.tar.bz2
-# Source0-md5: 8026d9f75257f2e52ac5ba3ce4720d55
+# Source0-md5: 4cdd6597a11a465d91e17ac86320883e
+Patch0:                plasma_applet_remove_taskmanager.diff
 URL:           http://ktorrent.org/
 BuildRequires: Qt3Support-devel >= %{qtver}
 BuildRequires: QtCore-devel >= %{qtver}
@@ -70,6 +71,7 @@ Główne cechy to:
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 install -d build
diff --git a/plasma_applet_remove_taskmanager.diff b/plasma_applet_remove_taskmanager.diff
new file mode 100644 (file)
index 0000000..0d0e3e5
--- /dev/null
@@ -0,0 +1,177 @@
+From: Joris Guisson <joris.guisson@gmail.com>
+Date: Wed, 23 Nov 2011 19:17:08 +0000
+Subject: Use dbus to show ktorrent window from plasma applet. This removes the dependency on libtaskmanager.
+X-Git-Url: http://quickgit.kde.org/?p=ktorrent.git&amp;a=commitdiff&amp;h=6d4a6ae51692966862ccb20d17cb217717519d40
+---
+Use dbus to show ktorrent window from plasma applet. This removes the dependency on libtaskmanager.
+
+BUG: 287309
+---
+
+
+Index: ktorrent-4.1.3/plasma/applet/CMakeLists.txt
+===================================================================
+--- ktorrent-4.1.3.orig/plasma/applet/CMakeLists.txt   2011-11-22 18:23:25.000000000 +0100
++++ ktorrent-4.1.3/plasma/applet/CMakeLists.txt        2011-12-31 18:57:47.891995599 +0100
+@@ -5,25 +5,15 @@
+ else(NOT QT_VERSION_OK)
+       
+-      set(TASKMANAGER_FOUND FALSE)
+-      FIND_PATH(TASKMANAGER_INCLUDE_DIR NAMES taskmanager.h  PATHS ${KDE4_INCLUDE_DIR}/taskmanager ${INCLUDE_INSTALL_DIR}/taskmanager.h)
+-      FIND_LIBRARY(TASKMANAGER_LIBRARY NAMES taskmanager PATHS ${KDE4_LIB_DIR} ${LIB_INSTALL_DIR})
+-
+-      if(TASKMANAGER_INCLUDE_DIR AND TASKMANAGER_LIBRARY)
+-              set(TASKMANAGER_FOUND TRUE)
+-              message(STATUS "Found libtaskmanager: ${TASKMANAGER_LIBRARY} ")
+-              include_directories(${TASKMANAGER_INCLUDE_DIR})
+-              set(ktapplet_SRCS applet.cpp chunkbar.cpp fadingitem.cpp fadingnavigationwidget.cpp)
+-              
+-              kde4_add_ui_files(ktapplet_SRCS appletconfig.ui)
+-              
+-              kde4_add_plugin(plasma_applet_ktorrent ${ktapplet_SRCS})
+-              target_link_libraries(plasma_applet_ktorrent  ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS} ${TASKMANAGER_LIBRARY} ${LIBKTORRENT_LIBRARIES} ktcore)
+-              
+-              install(TARGETS plasma_applet_ktorrent DESTINATION ${PLUGIN_INSTALL_DIR})
+-              install(FILES plasma-applet-ktorrent.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+-      endif(TASKMANAGER_INCLUDE_DIR AND TASKMANAGER_LIBRARY)
+-
+-      macro_log_feature(TASKMANAGER_FOUND "libtaskmanager" "libtaskmanager library and header files" "http://www.kde.org/" FALSE "" "libtaskmanager is needed for KTorrent Plasmoid")
++      
++      set(ktapplet_SRCS applet.cpp chunkbar.cpp fadingitem.cpp fadingnavigationwidget.cpp)
++      
++      kde4_add_ui_files(ktapplet_SRCS appletconfig.ui)
++      
++      kde4_add_plugin(plasma_applet_ktorrent ${ktapplet_SRCS})
++      target_link_libraries(plasma_applet_ktorrent  ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS} ${LIBKTORRENT_LIBRARIES} ktcore)
++      
++      install(TARGETS plasma_applet_ktorrent DESTINATION ${PLUGIN_INSTALL_DIR})
++      install(FILES plasma-applet-ktorrent.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+ endif(NOT QT_VERSION_OK)
+Index: ktorrent-4.1.3/plasma/applet/applet.cpp
+===================================================================
+--- ktorrent-4.1.3.orig/plasma/applet/applet.cpp       2011-11-22 18:23:25.000000000 +0100
++++ ktorrent-4.1.3/plasma/applet/applet.cpp    2011-12-31 18:57:47.891995599 +0100
+@@ -21,6 +21,9 @@
+ #include "applet.h"
+ #include <QFile>
+ #include <QGraphicsLinearLayout>
++#include <QDBusConnection>
++#include <QDBusConnectionInterface>
++#include <QDBusMessage>
+ #include <KConfigDialog>
+ #include <KLocale>
+ #include <KRun>
+@@ -31,12 +34,11 @@
+ #include <Plasma/IconWidget>
+ #endif
+ #include <Plasma/Label>
+-#include <taskmanager/taskmanager.h>
+-#include <taskmanager/task.h>
+ #include <util/functions.h>
+ #include "chunkbar.h"
+ #include "fadingnavigationwidget.h"
++
+ using namespace bt;
+ namespace ktplasma
+@@ -174,7 +176,8 @@
+               }
+       }
+-      void Applet::updateNavigation() {
++      void Applet::updateNavigation() 
++      {
+               navigation->setEnabled(connected_to_app && !sources.empty()
+                       && (sources.count() > 1 || !sources.contains(current_source)));
+       }
+@@ -193,12 +196,14 @@
+               }
+       }
+       
+-      void Applet::updateSources() {
++      void Applet::updateSources() 
++      {
+               sources = engine->sources();
+               sources.removeOne("core");
+       }
+-      void Applet::setSource(QString source) {
++      void Applet::setSource(QString source) 
++      {
+               if (!current_source.isEmpty())
+                       engine->disconnectSource(current_source,this);
+               clearData();
+@@ -340,20 +345,39 @@
+       void Applet::iconClicked()
+       {
+-              TaskManager::TaskDict tasks = TaskManager::TaskManager::self()->tasks();
+-              for (TaskManager::TaskDict::iterator i = tasks.begin();i != tasks.end();i ++)
++              QDBusConnection session_bus = QDBusConnection::sessionBus();
++              QDBusConnectionInterface* dbus_service = session_bus.interface();
++              if (!session_bus.isConnected() || !dbus_service || !dbus_service->isServiceRegistered("org.ktorrent.ktorrent"))
++              {
++                      // can't find the window, try launching it
++                      KUrl::List empty;
++                      KRun::run("ktorrent", empty, 0);
++              }
++              else
+               {
+-                      if (i.value()->className() == "ktorrent")
+-                      {
+-                              KWindowSystem::activateWindow(i.key());
+-                              return;
+-                      }
++                      QDBusMessage msg = QDBusMessage::createMethodCall("org.ktorrent.ktorrent", "/ktorrent/MainWindow_1", "org.kde.KMainWindow", "winId");
++                      QDBusPendingCall call = session_bus.asyncCall(msg, 5000);
++                      QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(call ,this);
++                      connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(dbusCallFinished(QDBusPendingCallWatcher*)));
+               }
+-
+-              // can't find the window, try launching it
+-              KUrl::List empty;
+-              KRun::run("ktorrent", empty, 0);
+       }
++      
++      void Applet::dbusCallFinished(QDBusPendingCallWatcher* self)
++      {
++              if (self->isError())
++              {
++                      // call failed, try launching it
++                      KUrl::List empty;
++                      KRun::run("ktorrent", empty, 0);
++              }
++              else
++              {
++                      QDBusPendingReply<qlonglong> reply = *self;
++                      KWindowSystem::activateWindow(reply.value());           
++              }
++              self->deleteLater();
++      }
++
+       void Applet::clearData()
+       {               
+Index: ktorrent-4.1.3/plasma/applet/applet.h
+===================================================================
+--- ktorrent-4.1.3.orig/plasma/applet/applet.h 2011-11-22 18:23:25.000000000 +0100
++++ ktorrent-4.1.3/plasma/applet/applet.h      2011-12-31 18:57:47.891995599 +0100
+@@ -27,6 +27,7 @@
+ #include "fadingnavigationwidget.h"
+ class QGraphicsLinearLayout;
++class QDBusPendingCallWatcher;
+ namespace Plasma
+ {
+@@ -68,6 +69,7 @@
+               void iconClicked();
+               void selectPrev();
+               void selectNext();
++              void dbusCallFinished(QDBusPendingCallWatcher* self);
+               
+       private:
+               void updateTorrentCombo();
This page took 0.043816 seconds and 4 git commands to generate.