[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] win32 paths-related fixes
From:       Jarosław_Staniek <js () iidea ! pl>
Date:       2005-02-11 13:53:56
Message-ID: 420CB8F4.4020903 () iidea ! pl
[Download RAW message or body]

1. CWD is cashed within KCmdLineArgs, but getcwd() returns a path with 
backslashes: win32_slashify() is called to fix it to a form which is expected 
by KCmdLineArgs.

2. KCmdLineArgs::makeURL() handling absolute paths fixed

3. KURL: internal cleanpath() function: handling absolute paths fixed


Please review.

-- 
regards / pozdrawiam,
  Jaroslaw Staniek / OpenOffice Polska / Kexi Team
  Developers Wanted! Kexi 0.1 Beta 5 Released: http://www.kexi-project.org
  KDElibs/Windows: http://wiki.kde.org/tiki-index.php?page=KDElibs+for+win32


["kdecore.patch" (text/plain)]

Index: kcmdlineargs.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kcmdlineargs.cpp,v
retrieving revision 1.96
diff -u -r1.96 kcmdlineargs.cpp
--- kcmdlineargs.cpp	9 Nov 2004 19:56:35 -0000	1.96
+++ kcmdlineargs.cpp	11 Feb 2005 13:42:59 -0000
@@ -30,6 +30,7 @@
 #include <limits.h>
 #endif
 
+#include <qdir.h>
 #include <qfile.h>
 #include <qasciidict.h>
 #include <qstrlist.h>
@@ -48,6 +49,10 @@
 #define DISPLAY "QWS_DISPLAY"
 #endif
 
+#ifdef Q_WS_WIN
+#include <win32_utils.h>
+#endif
+
 template class QAsciiDict<QCString>;
 template class QPtrList<KCmdLineArgs>;
 
@@ -179,6 +184,9 @@
    parsed = false;
    mCwd = mCwdd.setObject(mCwd, new char [PATH_MAX+1], true);
    getcwd(mCwd, PATH_MAX);
+#ifdef Q_WS_WIN
+   win32_slashify(mCwd, PATH_MAX);
+#endif
    if (!noKApp)
       KApplication::addCmdLineOptions();
 }
@@ -1217,7 +1225,7 @@
 
 KURL KCmdLineArgs::makeURL( const char *urlArg )
 {
-   if (*urlArg == '/')
+   if (!QDir::isRelativePath(urlArg))
    {
       KURL result;
       result.setPath(QFile::decodeName( urlArg));
Index: kurl.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kurl.cpp,v
retrieving revision 1.285
diff -u -r1.285 kurl.cpp
--- kurl.cpp	3 Dec 2004 13:18:56 -0000	1.285
+++ kurl.cpp	11 Feb 2005 13:43:00 -0000
@@ -311,7 +311,7 @@
 {
   if (_path.isEmpty()) return QString::null;
 
-  if (_path[0] != '/')
+  if (QDir::isRelativePath(_path))
      return _path; // Don't mangle mailto-style URLs
 
   QString path = _path;
@@ -2206,7 +2206,7 @@
         return KURL();
 
     KURL url;
-		if (!QDir::isRelativePath(text))
+    if (!QDir::isRelativePath(text))
         url.setPath( text );
     else
         url = text;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic