diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-11-15 16:06:20 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-11-15 16:06:20 (GMT) |
commit | 19f53dd23c29d9a6b256ea1473b118abcde3cc5a (patch) | |
tree | 483e6a45a93d9c6db05c53e48ca7a0dfed05d233 /src/corelib | |
parent | 12fc4ad4189f059a806bdf4f50fe090ed7031352 (diff) | |
parent | 22bfd2b05a72e1e7d7babcc9c5d824dd87903b6f (diff) | |
download | Qt-19f53dd23c29d9a6b256ea1473b118abcde3cc5a.zip Qt-19f53dd23c29d9a6b256ea1473b118abcde3cc5a.tar.gz Qt-19f53dd23c29d9a6b256ea1473b118abcde3cc5a.tar.bz2 |
Merge branch 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration:
tests: allow unstable tests to be marked with CONFIG+=insignificant_test
Fix focusScopeItemChange setting crash
Fix crash in QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd
symbian - handle path being passed as part of filename in QTranslator
Symbian - fix compile error when default configured
Compile when -no-rtti is specified as a configure option
Ensure that the RC_FILE is correctly handled in a single configuration
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; |