5555
5656#if defined(QT_STATICPLUGIN)
5757#include < QtPlugin>
58- #if QT_VERSION < 0x050000
59- Q_IMPORT_PLUGIN (qcncodecs)
60- Q_IMPORT_PLUGIN(qjpcodecs)
61- Q_IMPORT_PLUGIN(qtwcodecs)
62- Q_IMPORT_PLUGIN(qkrcodecs)
63- Q_IMPORT_PLUGIN(qtaccessiblewidgets)
64- #else
6558#if QT_VERSION < 0x050400
6659Q_IMPORT_PLUGIN (AccessibleFactory)
6760#endif
@@ -73,11 +66,6 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
7366Q_IMPORT_PLUGIN (QCocoaIntegrationPlugin);
7467#endif
7568#endif
76- #endif
77-
78- #if QT_VERSION < 0x050000
79- #include < QTextCodec>
80- #endif
8169
8270// Declare meta types used for QMetaObject::invokeMethod
8371Q_DECLARE_METATYPE (bool *)
@@ -151,16 +139,6 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans
151139}
152140
153141/* qDebug() message handler --> debug.log */
154- #if QT_VERSION < 0x050000
155- void DebugMessageHandler (QtMsgType type, const char *msg)
156- {
157- if (type == QtDebugMsg) {
158- LogPrint (BCLog::QT, " GUI: %s\n " , msg);
159- } else {
160- LogPrintf (" GUI: %s\n " , msg);
161- }
162- }
163- #else
164142void DebugMessageHandler (QtMsgType type, const QMessageLogContext& context, const QString &msg)
165143{
166144 Q_UNUSED (context);
@@ -170,7 +148,6 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
170148 LogPrintf (" GUI: %s\n " , msg.toStdString ());
171149 }
172150}
173- #endif
174151
175152/* * Class encapsulating Bitcoin Core startup and shutdown.
176153 * Allows running startup and shutdown in a different thread from the UI thread.
@@ -572,12 +549,6 @@ int main(int argc, char *argv[])
572549 // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory
573550
574551 // / 1. Basic Qt initialization (not dependent on parameters or configuration)
575- #if QT_VERSION < 0x050000
576- // Internal string conversion is all UTF-8
577- QTextCodec::setCodecForTr (QTextCodec::codecForName (" UTF-8" ));
578- QTextCodec::setCodecForCStrings (QTextCodec::codecForTr ());
579- #endif
580-
581552 Q_INIT_RESOURCE (bitcoin);
582553 Q_INIT_RESOURCE (bitcoin_locale);
583554
@@ -708,17 +679,12 @@ int main(int argc, char *argv[])
708679 // / 9. Main GUI initialization
709680 // Install global event filter that makes sure that long tooltips can be word-wrapped
710681 app.installEventFilter (new GUIUtil::ToolTipToRichTextFilter (TOOLTIP_WRAP_THRESHOLD, &app));
711- #if QT_VERSION < 0x050000
712- // Install qDebug() message handler to route to debug.log
713- qInstallMsgHandler (DebugMessageHandler);
714- #else
715682#if defined(Q_OS_WIN)
716683 // Install global event filter for processing Windows session related Windows messages (WM_QUERYENDSESSION and WM_ENDSESSION)
717684 qApp->installNativeEventFilter (new WinShutdownMonitor ());
718685#endif
719686 // Install qDebug() message handler to route to debug.log
720687 qInstallMessageHandler (DebugMessageHandler);
721- #endif
722688 // Allow parameter interaction before we create the options model
723689 app.parameterSetup ();
724690 // Load GUI settings from QSettings
@@ -739,7 +705,7 @@ int main(int argc, char *argv[])
739705 // so the GUI thread won't be held up.
740706 if (node->baseInitialize ()) {
741707 app.requestInitialize ();
742- #if defined(Q_OS_WIN) && QT_VERSION >= 0x050000
708+ #if defined(Q_OS_WIN)
743709 WinShutdownMonitor::registerShutdownBlockReason (QObject::tr (" %1 didn't yet exit safely..." ).arg (QObject::tr (PACKAGE_NAME)), (HWND)app.getMainWinId ());
744710#endif
745711 app.exec ();
0 commit comments