diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2009-08-11 16:11:46 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-08-11 16:30:56 (GMT) |
commit | 96a578afeaf2ee08db3eeea0f0250e8b08bcf9b6 (patch) | |
tree | d82ad76f6552179792c2b8e421811f081a92d0fc /src | |
parent | 7c46245633a1edfbdc1ff770a28a7d5e7a5739bf (diff) | |
download | Qt-96a578afeaf2ee08db3eeea0f0250e8b08bcf9b6.zip Qt-96a578afeaf2ee08db3eeea0f0250e8b08bcf9b6.tar.gz Qt-96a578afeaf2ee08db3eeea0f0250e8b08bcf9b6.tar.bz2 |
merge nativeAbsoluteFilePath and nativeAbsoluteFilePathCore
Merge-request: 1176
Reviewed-by: Joerg Bornemann <joerg.bornemann@trolltech.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qfsfileengine_win.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index e669752..edf65d2 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -345,9 +345,9 @@ static inline bool isDriveRoot(const QString &path) && path.at(2) == QLatin1Char('/')); } -static QString nativeAbsoluteFilePathCore(const QString &path) +static QString nativeAbsoluteFilePath(const QString &path) { - QString ret; + QString absPath; #if !defined(Q_OS_WINCE) QVarLengthArray<wchar_t, MAX_PATH> buf(qMax(MAX_PATH, path.size() + 1)); wchar_t *fileName = 0; @@ -357,19 +357,13 @@ static QString nativeAbsoluteFilePathCore(const QString &path) retLen = GetFullPathName((wchar_t*)path.utf16(), buf.size(), buf.data(), &fileName); } if (retLen != 0) - ret = QString::fromWCharArray(buf.data(), retLen); + absPath = QString::fromWCharArray(buf.data(), retLen); #else if (path.startsWith(QLatin1Char('/')) || path.startsWith(QLatin1Char('\\'))) - ret = QDir::toNativeSeparators(path); + absPath = QDir::toNativeSeparators(path); else - ret = QDir::toNativeSeparators(QDir::cleanPath(qfsPrivateCurrentDir + QLatin1Char('/') + path)); + absPath = QDir::toNativeSeparators(QDir::cleanPath(qfsPrivateCurrentDir + QLatin1Char('/') + path)); #endif - return ret; -} - -static QString nativeAbsoluteFilePath(const QString &path) -{ - QString absPath = nativeAbsoluteFilePathCore(path); // This is really ugly, but GetFullPathName strips off whitespace at the end. // If you for instance write ". " in the lineedit of QFileDialog, // (which is an invalid filename) this function will strip the space off and viola, |