[PATCH] win32 paths-related fixes

Waldo Bastian bastian at kde.org
Fri Feb 11 16:51:20 GMT 2005


In the chunk below

@@ -1217,7 +1225,7 @@
 
 KURL KCmdLineArgs::makeURL( const char *urlArg )
 {
-   if (*urlArg == '/')
+   if (!QDir::isRelativePath(urlArg))
    {
       KURL result;
       result.setPath(QFile::decodeName( urlArg));

you may want to do something like this instead:

@@ -1226,10 +1226,11 @@ KCmdLineArgs::url(int n) const

 KURL KCmdLineArgs::makeURL( const char *urlArg )
 {
-   if (*urlArg == '/')
+   QString _urlArg = QFile::decodeName( urlArg);
+   if (!QDir::isRelativePath(_urlArg))
    {
       KURL result;
-      result.setPath(QFile::decodeName( urlArg));
+      result.setPath(_urlArg);
       return result; // Absolute path.
    }
@@ -1237,7 +1238,7 @@ KURL KCmdLineArgs::makeURL( const char *
      return KURL(QString::fromLocal8Bit(urlArg)); // Argument is a URL

    KURL result;
-   result.setPath( cwd()+"/"+QFile::decodeName( urlArg ));
+   result.setPath( cwd()+"/"+_urlArg);
    result.cleanPath();
    return result;  // Relative path
 }

Cheers,
Waldo
-- 
bastian at kde.org   |   Free Novell Linux Desktop 9 Evaluation Download
bastian at suse.com  |   http://www.novell.com/products/desktop/eval.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050211/c515f05e/attachment.sig>


More information about the kde-core-devel mailing list