diff options
Diffstat (limited to 'tdecore/kurl.cpp')
| -rw-r--r-- | tdecore/kurl.cpp | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/tdecore/kurl.cpp b/tdecore/kurl.cpp index 290355552..8122bb4bf 100644 --- a/tdecore/kurl.cpp +++ b/tdecore/kurl.cpp @@ -47,7 +47,7 @@ #include <tqtextcodec.h> #include <tqmutex.h> -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN # define KURL_ROOTDIR_PATH "C:/" #else # define KURL_ROOTDIR_PATH "/" @@ -386,7 +386,7 @@ static TQString cleanpath(const TQString &_path, bool cleanDirSeparator, bool de orig_pos = pos; } -#ifdef Q_WS_WIN // prepend drive letter if exists (js) +#ifdef TQ_WS_WIN // prepend drive letter if exists (js) if (orig_pos >= 2 && isalpha(path[0].latin1()) && path[1]==':') { result.prepend(TQString(path[0])+":"); } @@ -670,7 +670,7 @@ void KURL::parse( const TQString& _url, int encoding_hint ) // Node 1: Accept alpha or slash TQChar x = buf[pos++]; -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN /* win32: accept <letter>: or <letter>:/ or <letter>:\ */ const bool alpha = isalpha((int)x); if (alpha && len<2) @@ -791,7 +791,7 @@ void KURL::parseURL( const TQString& _url, int encoding_hint ) // Node 1: Accept alpha or slash TQChar x = buf[pos++]; -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN /* win32: accept <letter>: or <letter>:/ or <letter>:\ */ const bool alpha = isalpha((int)x); if (alpha && len<2) @@ -1608,7 +1608,7 @@ TQString KURL::prettyURL( int _trailing ) const } else { - u += trailingSlash( _trailing, lazy_encode( m_strPath ) ); + u += trailingSlash( _trailing, lazy_encode( m_strPath, false ) ); } if (!m_strQuery_encoded.isNull()) @@ -1628,7 +1628,7 @@ TQString KURL::prettyURL( int _trailing, AdjustementFlags _flags) const TQString u = prettyURL(_trailing); if (_flags & StripFileProtocol && u.startsWith("file://")) { u.remove(0, 7); -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN return TQDir::convertSeparators(u); #endif } @@ -2378,21 +2378,17 @@ int KURL::uriMode() const KURL::URIMode KURL::uriModeForProtocol(const TQString& protocol) { + KURL::URIMode mode = Auto; #ifndef KDE_QT_ONLY - KURL::URIMode mode = Auto; - if (protocol == fileProt) - return URL; - if (TDEGlobal::_instance) - mode = KProtocolInfo::uriParseMode(protocol); - if (mode == Auto ) { -#else - KURL::URIMode mode = Auto; + if (protocol == fileProt) + return URL; + if (TDEGlobal::_instance) + mode = KProtocolInfo::uriParseMode(protocol); #endif - if ( protocol == "ed2k" || protocol == "sig2dat" || protocol == "slsk" || protocol == "data" ) mode = RawURI; - else if ( protocol == "mailto" ) mode = Mailto; - else mode = URL; -#ifndef KDE_QT_ONLY - } -#endif - return mode; + if (mode == Auto ) { + if ( protocol == "ed2k" || protocol == "sig2dat" || protocol == "slsk" || protocol == "data" ) mode = RawURI; + else if ( protocol == "mailto" ) mode = Mailto; + else mode = URL; + } + return mode; } |
