summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarek Kobus <jkobus@trolltech.com>2010-01-06 11:10:14 +0100
committerJarek Kobus <jkobus@trolltech.com>2010-01-06 11:33:45 +0100
commit738a950b754d1197d686acb1b04a5fdc883a02e5 (patch)
tree1bef88d711a6da70a1bcebcd7c3fbdb738d77a83
parent7a0313ed9e40fa6defe7cc7489abf0fa1ae16f3a (diff)
downloadqt-creator-738a950b754d1197d686acb1b04a5fdc883a02e5.tar.gz
Load designer translations before instantiating any designer object
In this way all tr calls are done after translations are loaded. Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@trolltech.com> Task-number: QTCREATORBUG-470
-rw-r--r--src/plugins/designer/formeditorplugin.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp
index 97bb7201c0..2875ba92d1 100644
--- a/src/plugins/designer/formeditorplugin.cpp
+++ b/src/plugins/designer/formeditorplugin.cpp
@@ -91,6 +91,18 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
addAutoReleasedObject(new FormEditorFactory);
+ // Ensure that loading designer translations is done before FormEditorW is instantiated
+ const QString locale = qApp->property("qtc_locale").toString();
+ if (!locale.isEmpty()) {
+ QTranslator *qtr = new QTranslator(this);
+ const QString &creatorTrPath =
+ Core::ICore::instance()->resourcePath() + QLatin1String("/translations");
+ const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
+ const QString &trFile = QLatin1String("designer_") + locale;
+ if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
+ qApp->installTranslator(qtr);
+ }
+
if (qgetenv("KDE_SESSION_VERSION") == QByteArray("4")) {
// KDE 4, possibly dangerous...
// KDE 4.2.0 had a nasty bug, which resulted in the File/Open Dialog crashing
@@ -105,17 +117,6 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
FormEditorW::ensureInitStage(FormEditorW::RegisterPlugins);
}
- const QString locale = qApp->property("qtc_locale").toString();
- if (!locale.isEmpty()) {
- QTranslator *qtr = new QTranslator(this);
- const QString &creatorTrPath =
- Core::ICore::instance()->resourcePath() + QLatin1String("/translations");
- const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
- const QString &trFile = QLatin1String("designer_") + locale;
- if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
- qApp->installTranslator(qtr);
- }
-
error->clear();
return true;
}