diff options
author | Sergio Ahumada <sergio.ahumada@nokia.com> | 2011-11-15 15:32:31 (GMT) |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@nokia.com> | 2011-11-15 15:32:31 (GMT) |
commit | 22bfd2b05a72e1e7d7babcc9c5d824dd87903b6f (patch) | |
tree | bcfc42bd2c2b813b32e1ace72ea1182fae634209 /src/corelib | |
parent | 8da9881989ca55f7d5e9e74c91e3abc98ce8a1b5 (diff) | |
parent | f86ca84e783c34e701f3742902161cb365e6e940 (diff) | |
download | Qt-22bfd2b05a72e1e7d7babcc9c5d824dd87903b6f.zip Qt-22bfd2b05a72e1e7d7babcc9c5d824dd87903b6f.tar.gz Qt-22bfd2b05a72e1e7d7babcc9c5d824dd87903b6f.tar.bz2 |
Merge branch 4.7 into qt-4.8-from-4.7
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qtranslator.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index dfc90e8..692c78c 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -408,13 +408,26 @@ bool QTranslator::load(const QString & filename, const QString & directory, Q_D(QTranslator); d->clear(); + QString fname = filename; QString prefix; if (QFileInfo(filename).isRelative()) { #ifdef Q_OS_SYMBIAN - if (directory.isEmpty()) + //TFindFile doesn't like path in the filename + QString dir(directory); + int slash = filename.lastIndexOf(QLatin1Char('/')); + slash = qMax(slash, filename.lastIndexOf(QLatin1Char('\\'))); + if (slash >=0) { + //so move the path component into the directory prefix + if (dir.isEmpty()) + dir = filename.left(slash + 1); + else + dir = dir + QLatin1Char('/') + filename.left(slash + 1); + fname = fname.mid(slash + 1); + } + if (dir.isEmpty()) prefix = QCoreApplication::applicationDirPath(); else - prefix = QFileInfo(directory).absoluteFilePath(); //TFindFile doesn't like dirty paths + prefix = QFileInfo(dir).absoluteFilePath(); //TFindFile doesn't like dirty paths if (prefix.length() > 2 && prefix.at(1) == QLatin1Char(':') && prefix.at(0).isLetter()) prefix[0] = QLatin1Char('Y'); #else @@ -428,7 +441,6 @@ bool QTranslator::load(const QString & filename, const QString & directory, QString nativePrefix = QDir::toNativeSeparators(prefix); #endif - QString fname = filename; QString realname; QString delims; delims = search_delimiters.isNull() ? QString::fromLatin1("_.") : search_delimiters; |