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

List:       kde-commits
Subject:    branches/kdepim/enterprise4/kdelibs-4.0.83/kdecore/io
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2008-07-01 20:17:58
Message-ID: 1214943478.607763.14906.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 826928 by staniek:

merge with recent trunk changes, especially in r819627



 M  +10 -5     kurl.cpp  


--- branches/kdepim/enterprise4/kdelibs-4.0.83/kdecore/io/kurl.cpp #826927:826928
@@ -576,10 +576,15 @@
     QString path1 = path((options & CompareWithoutTrailingSlash) ? \
                RemoveTrailingSlash : LeaveTrailingSlash);
     QString path2 = _u.path((options & CompareWithoutTrailingSlash) ? \
RemoveTrailingSlash : LeaveTrailingSlash);  #ifdef Q_WS_WIN
-    if ( isLocalFile() && _u.isLocalFile() && 0 != QString::compare( path1, path2, \
                Qt::CaseInsensitive ) )
-#else
+    const bool bLocal1 = isLocalFile();
+    const bool bLocal2 = _u.isLocalFile();
+    if ( !bLocal1 && bLocal2 || bLocal1 && !bLocal2 )
+      return false;
+    // local files are case insensitive
+    if ( bLocal1 && bLocal2 && 0 != QString::compare( path1, path2, \
Qt::CaseInsensitive ) ) +      return false;
+#endif
     if ( path1 != path2 )
-#endif
       return false;
 
     if ( scheme() == _u.scheme() &&
@@ -1668,13 +1673,13 @@
     kDebug(126) << "KUrl::setPath " << " " << _path.toAscii().data();
 #endif
     if ( scheme().isEmpty() )
-        setScheme( "file" );
+        setScheme( QLatin1String( "file" ) );
     QString path = KShell::tildeExpand( _path );
 #ifdef Q_WS_WIN
     //This is necessary because QUrl has the "path" part including the first slash
     //Without this QUrl doesn't understand that this is a path, and some operations \
fail  //e.g. C:/blah needs to become /C:/blah
-    if( !path.isEmpty() && path[0] != QLatin1Char('/') )
+    if( !path.isEmpty() && path[0] != QLatin1Char('/') && scheme() == QLatin1String( \
"file" ) )  path = QLatin1Char('/') + path;
 #endif
     QUrl::setPath( path );


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

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