[rkward-cvs] SF.net SVN: rkward:[3600] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue May 24 11:22:28 UTC 2011


Revision: 3600
          http://rkward.svn.sourceforge.net/rkward/?rev=3600&view=rev
Author:   tfry
Date:     2011-05-24 11:22:28 +0000 (Tue, 24 May 2011)

Log Message:
-----------
Fix plugin download on Windows. Unfortunately, this means changing the installation directory, since installing anywhere besides in .kde just does not work. Prepare support for KNS3. Currently disabled, since uninstallation is plain broken, there.

Modified Paths:
--------------
    trunk/rkward/rkward/CMakeLists.txt
    trunk/rkward/rkward/settings/CMakeLists.txt
    trunk/rkward/rkward/settings/rksettingsmoduleplugins.cpp
    trunk/rkward/rkward/settings/rkward.knsrc

Modified: trunk/rkward/rkward/CMakeLists.txt
===================================================================
--- trunk/rkward/rkward/CMakeLists.txt	2011-05-24 06:26:03 UTC (rev 3599)
+++ trunk/rkward/rkward/CMakeLists.txt	2011-05-24 11:22:28 UTC (rev 3600)
@@ -52,7 +52,8 @@
 	@ONLY)
 ADD_DEPENDENCIES(rkward.frontend ${RKWARD_WRAPPER_SCRIPT})
 
-TARGET_LINK_LIBRARIES(rkward.frontend ${KDE4_KDECORE_LIBS} windows ${RKWARD_ADDLIBS} agents dialogs plugin settings dataeditor core scriptbackends rbackend misc ktexteditor ${KDE4_KHTML_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KROSSCORE_LIBS} ${KDE4_KNEWSTUFF2_LIBS} ${QT_QTSCRIPT_LIBRARY} ${QT_QTNETWORK_LIBRARY})
+GET_DIRECTORY_PROPERTY(KNS_LIBS DIRECTORY settings DEFINITION KNS_LIBS)
+TARGET_LINK_LIBRARIES(rkward.frontend ${KDE4_KDECORE_LIBS} windows ${RKWARD_ADDLIBS} agents dialogs plugin settings dataeditor core scriptbackends rbackend misc ktexteditor ${KDE4_KHTML_LIBS} ${KDE4_KFILE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KROSSCORE_LIBS} ${KNS_LIBS} ${QT_QTSCRIPT_LIBRARY} ${QT_QTNETWORK_LIBRARY})
 
 ########### install files ###############
 

Modified: trunk/rkward/rkward/settings/CMakeLists.txt
===================================================================
--- trunk/rkward/rkward/settings/CMakeLists.txt	2011-05-24 06:26:03 UTC (rev 3599)
+++ trunk/rkward/rkward/settings/CMakeLists.txt	2011-05-24 11:22:28 UTC (rev 3600)
@@ -22,4 +22,14 @@
 
 ADD_LIBRARY(settings STATIC ${settings_STAT_SRCS})
 
+# NOTE: KNewStuff3 does not exist prior to KDE 4.4, and is buggy, at least up to KDE 4.5.x (does not properly list uninstalled files).
+# Check again, when it becomes usable, and insert the proper version check, below.
+#MACRO_ENSURE_VERSION("4.6.0" ${KDE_VERSION} RKWARD_USE_KNS3)
+IF(RKWARD_USE_KNS3)
+	ADD_DEFINITIONS(-DRKWARD_USE_KNS3)
+	SET(KNS_LIBS ${KDE4_KNEWSTUFF3_LIBS})
+ELSE(RKWARD_USE_KNS3)
+	SET(KNS_LIBS ${KDE4_KNEWSTUFF2_LIBS})
+ENDIF(RKWARD_USE_KNS3)
+
 INSTALL(FILES rkward.knsrc DESTINATION ${CONFIG_INSTALL_DIR})

Modified: trunk/rkward/rkward/settings/rksettingsmoduleplugins.cpp
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmoduleplugins.cpp	2011-05-24 06:26:03 UTC (rev 3599)
+++ trunk/rkward/rkward/settings/rksettingsmoduleplugins.cpp	2011-05-24 11:22:28 UTC (rev 3600)
@@ -21,7 +21,12 @@
 #include <kfiledialog.h>
 #include <kmessagebox.h>
 #include <khbox.h>
-#include <knewstuff2/engine.h>
+#include <kdeversion.h>
+#ifdef RKWARD_USE_KNS3
+#	include <knewstuff3/downloaddialog.h>
+#else
+#	include <knewstuff2/engine.h>
+#endif
 #include <ktar.h>
 #include <kzip.h>
 #include <kio/deletejob.h>
@@ -189,19 +194,28 @@
 
 	QStringList oldmaps = plugin_maps;
 
-#warning TODO: temporary hack
-// Somehow KNS is smart enough to remove the .rkward/plugins directory if it is no longer used, but not smart enough to add it back, when needed...
-	QDir::home ().mkpath (".rkward/plugins");
-
+#ifdef RKWARD_USE_KNS3
+	KNS3::DownloadDialog dialog ("rkward.knsrc", 0);
+	dialog.exec ();
+	KNS3::Entry::List list = dialog.changedEntries ();
+#else
 	KNS::Engine engine (0);
 	if (!engine.init ("rkward.knsrc")) return;
 	KNS::Entry::List list = engine.downloadDialogModal (this);
+#endif
 
 	for (int i = 0; i < list.size (); ++i) {
-		foreach (const QString inst, list[i]->installedFiles ()) {
+#ifdef RKWARD_USE_KNS3
+		QStringList installed_files = list[i].installedFiles ();
+		QStringList uninstalled_files = list[i].uninstalledFiles ();
+#else
+		QStringList installed_files = list[i]->installedFiles ();
+		QStringList uninstalled_files = list[i]->uninstalledFiles ();
+#endif
+		foreach (const QString inst, installed_files) {
 			installPluginPack (inst);
 		}
-		foreach (const QString inst, list[i]->uninstalledFiles ()) {
+		foreach (const QString inst, uninstalled_files) {
 			uninstallPluginPack (inst);
 		}
 	}

Modified: trunk/rkward/rkward/settings/rkward.knsrc
===================================================================
--- trunk/rkward/rkward/settings/rkward.knsrc	2011-05-24 06:26:03 UTC (rev 3599)
+++ trunk/rkward/rkward/settings/rkward.knsrc	2011-05-24 11:22:28 UTC (rev 3600)
@@ -1,4 +1,9 @@
 [KNewStuff2]
 ProvidersUrl=http://R.reaktanz.de/GHNS/reaktanz-provider.xml
 Uncompress=never
-InstallPath=.rkward/plugins/
+TargetDir=rkward/plugins/
+
+[KNewStuff3]
+ProvidersUrl=http://R.reaktanz.de/GHNS/reaktanz-provider.xml
+Uncompress=never
+TargetDir=rkward/plugins/


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list