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

List:       kde-core-devel
Subject:    KCmdLineArgs Patch
From:       Neil Stevens <neil () qualityassistant ! com>
Date:       2002-08-18 14:55:42
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This patch look OK?  I've found I need this to open some UTF8 filenames 
with Kaboodle from konsole.  The patch has KCmdLineArgs use 
QFile::decodeName on file: urls passed.  This is important because with 
KDE_UTF8_FILENAMES=1 in the environment, QFile::decodeName can be 
different from QString::fromLocal8Bit.

Unfortunately this only fixes half of my problem (I still can't open some 
UTF8 files in Kaboodle when right-clicking in Konqueror), but half is 
better than nothing.
- -- 
Neil Stevens - neil@qualityassistant.com
"I always cheer up immensely if an attack is particularly wounding
because I think, well, if they attack one personally, it means they
have not a single political argument left." - Margaret Thatcher
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9X7Vuf7mnligQOmERAoawAKCRBWyGn981kmwg7IXmGmhK5T7seACeO3XA
fRuGfemwF8haUvhkxZdLaRM=
=1NoT
-----END PGP SIGNATURE-----

["kcmdlineargspatch" (text/x-diff)]

Index: kcmdlineargs.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kcmdlineargs.cpp,v
retrieving revision 1.71
diff -u -r1.71 kcmdlineargs.cpp
--- kcmdlineargs.cpp	2002/02/22 05:11:35	1.71
+++ kcmdlineargs.cpp	2002/08/18 14:46:24
@@ -1169,7 +1169,13 @@
    }
 
    if ( !KURL::isRelativeURL( QString::fromLocal8Bit(urlArg) ) )
-     return KURL(QString::fromLocal8Bit(urlArg)); // Argument is a URL
+   {
+      KURL url = QString::fromLocal8Bit(urlArg);
+      if (url.protocol() == "file")
+         return KURL(QFile::decodeName(urlArg)); // Argument is a local file
+      else
+         return url;
+   }
 
    KURL result;
    result.setPath( cwd()+"/"+QFile::decodeName( urlArg ));


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

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