Merge branch '1.3'

This commit is contained in:
Thorbjørn Lindeijer
2010-01-06 14:45:35 +01:00
4 changed files with 66 additions and 13 deletions

View File

@@ -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;
}