X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fquassel.cpp;h=cd38fd26255a7034a3fe9521fde77ebe7c396ded;hb=47a6910aed00018c7230cc2cc90ae8e80fa77dda;hp=89470d59e011427079c6495dc61046a2cc44f63d;hpb=5b686746c880e5cda6d5de3e08180ea4332ff222;p=quassel.git diff --git a/src/common/quassel.cpp b/src/common/quassel.cpp index 89470d59..cd38fd26 100644 --- a/src/common/quassel.cpp +++ b/src/common/quassel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 by the Quassel Project * + * Copyright (C) 2005-2013 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -23,23 +23,27 @@ #include #include #if !defined Q_OS_WIN32 && !defined Q_OS_MAC +# include +# include # include #endif #include #include #include +#include #include #include #include -#include -#include "message.h" +#include "bufferinfo.h" #include "identity.h" +#include "logger.h" +#include "message.h" #include "network.h" -#include "bufferinfo.h" -#include "types.h" +#include "protocol.h" #include "syncableobject.h" +#include "types.h" Quassel::BuildInfo Quassel::_buildInfo; AbstractCliParser *Quassel::_cliParser = 0; @@ -193,6 +197,8 @@ void Quassel::registerMetaTypes() qRegisterMetaTypeStreamOperators("AccountId"); qRegisterMetaTypeStreamOperators("MsgId"); + qRegisterMetaType("Protocol::SessionState"); + // Versions of Qt prior to 4.7 didn't define QVariant as a meta type if (!QMetaType::type("QVariant")) { qRegisterMetaType("QVariant"); @@ -494,10 +500,15 @@ void Quassel::loadTranslation(const QLocale &locale) quasselTranslator->setObjectName("QuasselTr"); qApp->installTranslator(quasselTranslator); - QLocale::setDefault(locale); - +#if QT_VERSION >= 0x040800 && !defined Q_OS_MAC + bool success = qtTranslator->load(locale, QString("qt_"), translationDirPath()); + if (!success) + qtTranslator->load(locale, QString("qt_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + quasselTranslator->load(locale, QString(""), translationDirPath()); +#else bool success = qtTranslator->load(QString("qt_%1").arg(locale.name()), translationDirPath()); if (!success) qtTranslator->load(QString("qt_%1").arg(locale.name()), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); quasselTranslator->load(QString("%1").arg(locale.name()), translationDirPath()); +#endif }