summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemengine_symbian.cpp
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-09-17 18:13:50 +0100
committerShane Kearns <shane.kearns@accenture.com>2010-09-20 15:47:05 +0100
commit883b223c2fc17e313c8a080c14055bba02ae655c (patch)
treef76318190ab755fd6895695705a018879104e449 /src/corelib/io/qfilesystemengine_symbian.cpp
parent63d50fdfa59cd198f7bf87f37770960e1b93945d (diff)
Make use of new isRelative / isAbsolute functions
Reviewed-By: joao
Diffstat (limited to 'src/corelib/io/qfilesystemengine_symbian.cpp')
-rw-r--r--src/corelib/io/qfilesystemengine_symbian.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/corelib/io/qfilesystemengine_symbian.cpp b/src/corelib/io/qfilesystemengine_symbian.cpp
index ce2166dd9b..efb35393c3 100644
--- a/src/corelib/io/qfilesystemengine_symbian.cpp
+++ b/src/corelib/io/qfilesystemengine_symbian.cpp
@@ -112,16 +112,17 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
{
QString orig = entry.filePath();
- const bool needsDrive = (!orig.isEmpty() && orig.at(0).unicode() == '/');
- const bool isDriveLetter = (orig.size() == 2 && orig.at(1).unicode() == ':');
- const bool isDriveRelative = (orig.size() > 2 && orig.at(1).unicode() == ':' && orig.at(2).unicode() != '/');
+ const bool isAbsolute = entry.isAbsolute();
const bool isDirty = (orig.contains(QLatin1String("/../")) || orig.contains(QLatin1String("/./")) ||
orig.endsWith(QLatin1String("/..")) || orig.endsWith(QLatin1String("/.")));
- const bool isAbsolute = !entry.isRelative();
- if (isAbsolute &&
- !(needsDrive || isDriveLetter || isDriveRelative || isDirty))
+ if (isAbsolute && !isDirty)
return entry;
+ const bool isRelative = entry.isRelative();
+ const bool needsDrive = (!orig.isEmpty() && orig.at(0).unicode() == '/');
+ const bool isDriveLetter = !needsDrive && !isAbsolute && !isRelative && orig.length() == 2;
+ const bool isDriveRelative = !needsDrive && !isAbsolute && !isRelative && orig.length() > 2;
+
QString result;
if (needsDrive || isDriveLetter || isDriveRelative || !isAbsolute || orig.isEmpty()) {
QFileSystemEntry cur(currentPath());