[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE_3_1_BRANCH: kdelibs/kdecore
From: Waldo Bastian <bastian () kde ! org>
Date: 2003-09-15 7:47:19
[Download RAW message or body]
CVS commit by waba:
Revert previous commit, it breaks mailto:
M +7 -32 kurl.cpp 1.223.2.6
--- kdelibs/kdecore/kurl.cpp #1.223.2.5:1.223.2.6
@@ -272,32 +272,8 @@ static QString decode(const QString &seg
}
-static QString cleanpath(const QString &_path, bool cleanDirSeparator, bool decodeDots)
+static QString cleanpath(const QString &path, bool cleanDirSeparator=true)
{
- if (_path.isEmpty()) return QString::null;
-
- QString path = _path;
-
+ if (path.isEmpty()) return QString::null;
int len = path.length();
-
- if (decodeDots)
- {
-#ifndef KDE_QT_ONLY
- static const QString &encodedDot = KGlobal::staticQString("%2e");
-#else
- QString encodedDot("%2e");
-#endif
- if (path.find(encodedDot, 0, false) != -1)
- {
-#ifndef KDE_QT_ONLY
- static const QString &encodedDOT = KGlobal::staticQString("%2E"); // Uppercase!
-#else
- QString encodedDOT("%2E");
-#endif
- path.replace(encodedDot, ".");
- path.replace(encodedDOT, ".");
- len = path.length();
- }
- }
-
bool slash = (len && path[len-1] == '/') ||
(len > 1 && path[len-2] == '/' && path[len-1] == '.');
@@ -538,5 +514,4 @@ KURL::KURL( const KURL& _u, const QStrin
m_strPass = _u.m_strPass;
}
- cleanPath(false);
}
}
@@ -978,8 +953,8 @@ bool KURL::isParentOf( const KURL& _u )
return false; // can't work with implicit paths
- QString p1( cleanpath( path(), true, false ) );
+ QString p1( cleanpath( path() ) );
if ( p1[p1.length()-1] != '/' )
p1 += '/';
- QString p2( cleanpath( _u.path(), true, false ) );
+ QString p2( cleanpath( _u.path() ) );
if ( p2[p2.length()-1] != '/' )
p2 += '/';
@@ -1035,7 +1010,7 @@ void KURL::setFileName( const QString& _
void KURL::cleanPath( bool cleanDirSeparator ) // taken from the old KURL
{
- m_strPath = cleanpath(m_strPath, cleanDirSeparator, false);
+ m_strPath = cleanpath(m_strPath, cleanDirSeparator);
// WABA: Is this safe when "/../" is encoded with %?
- m_strPath_encoded = cleanpath(m_strPath_encoded, cleanDirSeparator, true);
+ m_strPath_encoded = cleanpath(m_strPath_encoded, cleanDirSeparator);
}
@@ -1546,5 +1521,5 @@ bool KURL::cd( const QString& _dir )
QString p = path(1);
p += _dir;
- p = cleanpath( p, true, false );
+ p = cleanpath( p );
setPath( p );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic