70 { |
70 { |
71 QCoreApplication::setApplicationName(::appName); |
71 QCoreApplication::setApplicationName(::appName); |
72 QCoreApplication::setOrganizationName("hecknology.net"); |
72 QCoreApplication::setOrganizationName("hecknology.net"); |
73 QCoreApplication::setOrganizationDomain("hecknology.net"); |
73 QCoreApplication::setOrganizationDomain("hecknology.net"); |
74 qRegisterMetaType<Message>(); |
74 qRegisterMetaType<Message>(); |
|
75 qRegisterMetaType<Library>(); |
|
76 qRegisterMetaType<QList<Library>>(); |
|
77 qRegisterMetaType<QMdiArea::ViewMode>(); |
|
78 qRegisterMetaType<gl::RenderStyle>(); |
|
79 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) |
75 qRegisterMetaTypeStreamOperators<Library>("Library"); |
80 qRegisterMetaTypeStreamOperators<Library>("Library"); |
76 qRegisterMetaTypeStreamOperators<Libraries>("Libraries"); |
81 qRegisterMetaTypeStreamOperators<Libraries>("Libraries"); |
77 qRegisterMetaTypeStreamOperators<gl::RenderStyle>(); |
82 qRegisterMetaTypeStreamOperators<gl::RenderStyle>(); |
78 qRegisterMetaTypeStreamOperators<QMdiArea::ViewMode>(); |
83 qRegisterMetaTypeStreamOperators<QMdiArea::ViewMode>(); |
|
84 #endif |
79 } |
85 } |
80 |
86 |
81 template<typename BaseType, typename MemberType, typename DataType> |
87 template<typename BaseType, typename MemberType, typename DataType> |
82 struct MemberData |
88 struct MemberData |
83 { |
89 { |
151 */ |
157 */ |
152 static void changeLanguage(const QString& locale, QTranslator* translator) |
158 static void changeLanguage(const QString& locale, QTranslator* translator) |
153 { |
159 { |
154 if (not locale.isEmpty()) { |
160 if (not locale.isEmpty()) { |
155 const QString localeCode = ::localeCode(locale); |
161 const QString localeCode = ::localeCode(locale); |
156 QLocale::setDefault({localeCode}); |
162 QLocale::setDefault(QLocale{localeCode}); |
157 qApp->removeTranslator(translator); |
163 qApp->removeTranslator(translator); |
158 const QString path = LOCALE_DIR.filePath(localeCode + ".qm"); |
164 const QString path = LOCALE_DIR.filePath(localeCode + ".qm"); |
159 const bool loadSuccessful = translator->load(path); |
165 const bool loadSuccessful = translator->load(path); |
160 if (loadSuccessful) |
166 if (loadSuccessful) |
161 { |
167 { |