From: Peter Kümmel Date: Thu, 8 Jun 2006 14:27:44 +0000 (+0000) Subject: - remove usage of qt3 support functions. X-Git-Tag: 1.6.10~13139 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8a552374b9aea902eb8f272b514c3717806839b3;p=lyx.git - remove usage of qt3 support functions. - undef QT3_SUPPORT until the QT3_SUPPORT-logic will be inverted. - QLocale::system().name() returns e.g de_DE but the Qt file name is qt_de. Index: frontends/qt4/lyx_gui.C =================================================================== --- frontends/qt4/lyx_gui.C (revision 14043) +++ frontends/qt4/lyx_gui.C (working copy) @@ -9,6 +9,8 @@ * Full author contact details are available in file CREDITS. */ +#undef QT3_SUPPORT + #include #include "lyx_gui.h" @@ -55,6 +57,8 @@ #include #include #include +#include +#include using lyx::support::ltrim; using lyx::support::package; @@ -167,19 +171,22 @@ // install translation file for Qt built-in dialogs // These are only installed since Qt 3.2.x - QTranslator qt_trans(0); - if (qt_trans.load(QString("qt_") + QTextCodec::locale(), - qInstallPathTranslations())) { + QTranslator qt_trans; + QString language_name = QString("qt_") + QLocale::system().name(); + language_name.truncate(5); + if (qt_trans.load(language_name, + QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + { qApp->installTranslator(&qt_trans); // even if the language calls for RtL, don't do that - qApp->setReverseLayout(false); + qApp->setLayoutDirection(Qt::LeftToRight); lyxerr[Debug::GUI] << "Successfully installed Qt translations for locale " - << QTextCodec::locale() << std::endl; + << fromqstr(language_name) << std::endl; } else lyxerr[Debug::GUI] << "Could not find Qt translations for locale " - << QTextCodec::locale() << std::endl; + << fromqstr(language_name) << std::endl; /*#ifdef Q_WS_MACX // These translations are meant to break Qt/Mac menu merging @@ -260,9 +267,7 @@ // During screen update/ redraw, this method is disabled to // prevent keyboard events being handed to the LyX core, where // they could cause re-entrant calls to screen update. -#if QT_VERSION >= 0x030100 - qApp->processEvents(QEventLoop::ExcludeUserInput); -#endif + qApp->processEvents(QEventLoop::ExcludeUserInputEvents); } git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14046 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/lyx_gui.C b/src/frontends/qt4/lyx_gui.C index 181a6e157a..e06678826f 100644 --- a/src/frontends/qt4/lyx_gui.C +++ b/src/frontends/qt4/lyx_gui.C @@ -9,6 +9,8 @@ * Full author contact details are available in file CREDITS. */ +#undef QT3_SUPPORT + #include #include "lyx_gui.h" @@ -55,6 +57,8 @@ #include #include #include +#include +#include using lyx::support::ltrim; using lyx::support::package; @@ -167,19 +171,22 @@ void exec(int & argc, char * argv[]) // install translation file for Qt built-in dialogs // These are only installed since Qt 3.2.x - QTranslator qt_trans(0); - if (qt_trans.load(QString("qt_") + QTextCodec::locale(), - qInstallPathTranslations())) { + QTranslator qt_trans; + QString language_name = QString("qt_") + QLocale::system().name(); + language_name.truncate(5); + if (qt_trans.load(language_name, + QLibraryInfo::location(QLibraryInfo::TranslationsPath))) + { qApp->installTranslator(&qt_trans); // even if the language calls for RtL, don't do that - qApp->setReverseLayout(false); + qApp->setLayoutDirection(Qt::LeftToRight); lyxerr[Debug::GUI] << "Successfully installed Qt translations for locale " - << QTextCodec::locale() << std::endl; + << fromqstr(language_name) << std::endl; } else lyxerr[Debug::GUI] << "Could not find Qt translations for locale " - << QTextCodec::locale() << std::endl; + << fromqstr(language_name) << std::endl; /*#ifdef Q_WS_MACX // These translations are meant to break Qt/Mac menu merging @@ -260,9 +267,7 @@ void sync_events() // During screen update/ redraw, this method is disabled to // prevent keyboard events being handed to the LyX core, where // they could cause re-entrant calls to screen update. -#if QT_VERSION >= 0x030100 - qApp->processEvents(QEventLoop::ExcludeUserInput); -#endif + qApp->processEvents(QEventLoop::ExcludeUserInputEvents); }