diff --git a/kioslave/remote/kio_remote.cpp b/kioslave/remote/kio_remote.cpp --- a/kioslave/remote/kio_remote.cpp +++ b/kioslave/remote/kio_remote.cpp @@ -68,8 +68,10 @@ if ( second_slash_idx < 0 ) { second_slash_idx = url.path().size(); } - target = target.adjusted(QUrl::StripTrailingSlash); - target.setPath(target.path() + '/' + ( url.path().remove(0, second_slash_idx) )); + const QString urlPath = url.path().remove(0, second_slash_idx); + if (!urlPath.isEmpty()) { + target.setPath(QStringLiteral("%1/%2").arg(target.path(), urlPath)); + } qCDebug(KIOREMOTE_LOG) << "complete redirection target : " << target; redirection(target); finished(); @@ -157,9 +159,11 @@ if ( second_slash_idx < 0 ) { second_slash_idx = url.path().size(); } + const QString urlPath = url.path().remove(0, second_slash_idx); + if (!urlPath.isEmpty()) { + target.setPath(QStringLiteral("%1/%2").arg(target.path(), urlPath)); + } qCDebug(KIOREMOTE_LOG) << "complete redirection target : " << target; - target = target.adjusted(QUrl::StripTrailingSlash); - target.setPath(target.path() + '/' + ( url.path().remove( 0, second_slash_idx ) )); redirection( target ); finished(); return; @@ -192,10 +196,7 @@ if (!file.isEmpty()) { - QUrl desktop; - desktop.setPath(file); - - redirection(desktop); + redirection(QUrl::fromLocalFile(file)); finished(); return; } diff --git a/kioslave/remote/remoteimpl.cpp b/kioslave/remote/remoteimpl.cpp --- a/kioslave/remote/remoteimpl.cpp +++ b/kioslave/remote/remoteimpl.cpp @@ -107,7 +107,7 @@ { if (*name==filename) { - directory = *dirpath; + directory = *dirpath + QLatin1Char('/'); return true; } } @@ -137,7 +137,7 @@ if (!file.isEmpty()) { KDesktopFile desktop( file ); - return QUrl::fromLocalFile(desktop.readUrl()); + return QUrl::fromUserInput(desktop.readUrl()); } return QUrl();