Author: mmazur Date: Tue Feb 28 14:14:26 2012 GMT Module: packages Tag: HEAD ---- Log message: - up to 4.1.3; stbr
---- Files affected: packages/ktorrent: ktorrent.spec (1.80 -> 1.81) , plasma_applet_remove_taskmanager.diff (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: packages/ktorrent/ktorrent.spec diff -u packages/ktorrent/ktorrent.spec:1.80 packages/ktorrent/ktorrent.spec:1.81 --- packages/ktorrent/ktorrent.spec:1.80 Wed Sep 7 11:49:15 2011 +++ packages/ktorrent/ktorrent.spec Tue Feb 28 15:14:20 2012 @@ -7,12 +7,13 @@ 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} @@ -71,6 +72,7 @@ %prep %setup -q +%patch0 -p1 %build install -d build @@ -165,6 +167,9 @@ All persons listed below can be reached at <cvs_login>@pld-linux.org $Log$ +Revision 1.81 2012/02/28 14:14:20 mmazur +- up to 4.1.3; stbr + Revision 1.80 2011/09/07 09:49:15 marti - up to 4.1.2 - dropped unused locales ================================================================ Index: packages/ktorrent/plasma_applet_remove_taskmanager.diff diff -u /dev/null packages/ktorrent/plasma_applet_remove_taskmanager.diff:1.1 --- /dev/null Tue Feb 28 15:14:26 2012 +++ packages/ktorrent/plasma_applet_remove_taskmanager.diff Tue Feb 28 15:14:20 2012 @@ -0,0 +1,177 @@ +From: Joris Guisson <[email protected]> +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&a=commitdiff&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(); ================================================================ ---- CVS-web: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/ktorrent/ktorrent.spec?r1=1.80&r2=1.81&f=u _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
