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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Mar 22 13:45:49 UTC 2011


Revision: 3496
          http://rkward.svn.sourceforge.net/rkward/?rev=3496&view=rev
Author:   tfry
Date:     2011-03-22 13:45:49 +0000 (Tue, 22 Mar 2011)

Log Message:
-----------
Try harder to support installations outside the main KDE dir.

Modified Paths:
--------------
    trunk/rkward/rkward/main.cpp
    trunk/rkward/rkward/rkward.bat.template
    trunk/rkward/rkward/rkward.sh.template

Modified: trunk/rkward/rkward/main.cpp
===================================================================
--- trunk/rkward/rkward/main.cpp	2011-03-22 10:24:33 UTC (rev 3495)
+++ trunk/rkward/rkward/main.cpp	2011-03-22 13:45:49 UTC (rev 3496)
@@ -2,7 +2,7 @@
                           main.cpp  -  description
                              -------------------
     begin                : Tue Oct 29 20:06:08 CET 2002
-    copyright            : (C) 2002, 2005, 2006, 2007, 2008, 2009, 2010 by Thomas Friedrichsmeier 
+    copyright            : (C) 2002, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by Thomas Friedrichsmeier 
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -54,6 +54,7 @@
 #include <kaboutdata.h>
 #include <klocale.h>
 #include <ktemporaryfile.h>
+#include <kstandarddirs.h>
 
 #include <qstring.h>
 #include <QMutex>
@@ -67,7 +68,6 @@
 
 #ifdef Q_WS_WIN
 	// these are needed for the exit hack.
-#	include <stdio.h>
 #	include <windows.h>
 #endif
 
@@ -165,6 +165,11 @@
 	}
 	args->clear();
 
+	// Usually, KDE always adds the current directory to the list of prefixes.
+	// However, since RKWard 0.5.6, the main binary is in KDE's libexec dir, which defies this mechanism. Therefore, RKWARD_ENSURE_PREFIX is set from the wrapper script.
+	char *add_path = getenv ("RKWARD_ENSURE_PREFIX");
+	if (add_path) KGlobal::dirs ()->addPrefix (QString::fromLocal8Bit (add_path));
+
 	// do it!
 	int status = app.exec ();
 

Modified: trunk/rkward/rkward/rkward.bat.template
===================================================================
--- trunk/rkward/rkward/rkward.bat.template	2011-03-22 10:24:33 UTC (rev 3495)
+++ trunk/rkward/rkward/rkward.bat.template	2011-03-22 13:45:49 UTC (rev 3496)
@@ -16,6 +16,7 @@
 
 ECHO Starting RKWard
 SET RKWARD.BIN=%~dsp0\..\lib\kde4\libexec\rkward.frontend.exe
+SET RKWARD_ENSURE_PREFIX=%~dsp0\..
 SET DEBUGGER=
 
 IF NOT "%1" == "--debugger" GOTO run

Modified: trunk/rkward/rkward/rkward.sh.template
===================================================================
--- trunk/rkward/rkward/rkward.sh.template	2011-03-22 10:24:33 UTC (rev 3495)
+++ trunk/rkward/rkward/rkward.sh.template	2011-03-22 13:45:49 UTC (rev 3496)
@@ -49,6 +49,7 @@
   rkward_binary="`dirname $0`/rkward.frontend"
 else
   # for regular installations
+  export RKWARD_ENSURE_PREFIX="`dirname $0`/.."
   rkward_binary="@LIBEXEC_INSTALL_DIR@/rkward.frontend"
 fi
 exec $R_binary CMD $debugger ${rkward_binary} "$@"


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