[PATCH] win32 paths-related fixes
Jaroslaw Staniek
js at iidea.pl
Fri Feb 11 22:16:18 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
> }
Good idea, and what about:
if ( !KURL::isRelativeURL( QString::fromLocal8Bit(urlArg) ) )
return KURL(QString::fromLocal8Bit(urlArg)); // Argument is a URL
in KCmdLineArgs::makeURL()? -- is QString::fromLocal8Bit(urlArg) needed or
replacing it with _urlArg is enough?
please send me a CC.
--
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
More information about the kde-core-devel
mailing list