[rkward-cvs] SF.net SVN: rkward:[2864] trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue May 18 08:03:31 UTC 2010


Revision: 2864
          http://rkward.svn.sourceforge.net/rkward/?rev=2864&view=rev
Author:   tfry
Date:     2010-05-18 08:03:31 +0000 (Tue, 18 May 2010)

Log Message:
-----------
Make sure that package_archive-directory exists, if needed

Modified Paths:
--------------
    trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp

Modified: trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp
===================================================================
--- trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp	2010-05-13 13:41:02 UTC (rev 2863)
+++ trunk/rkward/rkward/dialogs/rkloadlibsdialog.cpp	2010-05-18 08:03:31 UTC (rev 2864)
@@ -2,7 +2,7 @@
                           rkloadlibsdialog  -  description
                              -------------------
     begin                : Mon Sep 6 2004
-    copyright            : (C) 2004, 2006, 2007, 2008, 2009 by Thomas Friedrichsmeier
+    copyright            : (C) 2004, 2006, 2007, 2008, 2009, 2010 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -170,8 +170,12 @@
 	RK_TRACE (DIALOGS);
 
 	if (packages.isEmpty ()) return false;
-	QString command_string = "install.packages (pkgs=c (\"" + packages.join ("\", \"") + "\")" + ", lib=\"" + to_libloc + "\""; 
-	if (RKSettingsModuleRPackages::archivePackages ()) command_string += ", destdir=\"" + QDir (RKSettingsModuleGeneral::filesPath ()).filePath ("package_archive") + "\"";
+	QString command_string = "install.packages (pkgs=c (\"" + packages.join ("\", \"") + "\")" + ", lib=\"" + to_libloc + "\"";
+	QString downloaddir = QDir (RKSettingsModuleGeneral::filesPath ()).filePath ("package_archive");
+	if (RKSettingsModuleRPackages::archivePackages ()) {
+		QDir (RKSettingsModuleGeneral::filesPath ()).mkdir ("package_archive");
+		command_string += ", destdir=\"" + downloaddir + "\"";
+	}
 	if (install_dependencies) command_string += ", dependencies=TRUE";
 	command_string += ")\n";
 
@@ -189,7 +193,7 @@
 			RK_ASSERT (false);
 #else
 			KUser user;
-			stream << QString ("system (\"chown ") + user.loginName() + ' ' + QDir (RKSettingsModuleGeneral::filesPath ()).filePath ("package_archive") + "/*\")\n";
+			stream << QString ("system (\"chown ") + user.loginName() + ' ' + downloaddir + "/*\")\n";
 #endif
 		}
 		stream << "q ()\n";


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