diff options
author | Gerald Combs <gerald@wireshark.org> | 2017-11-20 09:18:59 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2017-11-20 22:08:09 +0000 |
commit | dd562b503f2ff089968283b1593496c007f854a6 (patch) | |
tree | dcdfbd93a1f7dbaa11761915dfdfcf58beb0d00c /wireshark-qt.cpp | |
parent | 5968fc1cae5028002d4f974e0464608f73204b60 (diff) |
Qt: Move the MIME init thread to WiresharkApplication.
The Qt 4.8 "Starting a Thread" document at
http://doc.qt.io/qt-4.8/threads-starting.html says,
"Note that you must create the QApplication (or QCoreApplication) object
before you can create a QThread."
It looks like this changed some time around Qt 5.5 or 5.6, e.g.
https://codereview.qt-project.org/#/c/120793/, but just to be safe move
the MIME database initialization thread to WiresharkApplication. We
start reading the database later than I'd like, but it's still early
enough to make a difference here.
QMimeDatabase was added in Qt 5.0. Add version checks.
Change-Id: Ic80ebb8692e93b1e4aea7a8670f4fcf45e385b29
Reviewed-on: https://code.wireshark.org/review/24512
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'wireshark-qt.cpp')
-rw-r--r-- | wireshark-qt.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index 73c5153ca7..a4341e5835 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -96,8 +96,6 @@ #include "caputils/capture-pcap-util.h" #include <QMessageBox> -#include <QMimeDatabase> -#include <QThreadPool> #ifdef _WIN32 # include "caputils/capture-wpcap.h" @@ -140,19 +138,6 @@ */ #define DEBUG_STARTUP_TIME_LOGLEVEL 252 -// QMimeDatabase can be slow to initialize. Do so in a worker thread -// as early as possible. -// https://github.com/lxde/pcmanfm-qt/issues/415 -class MimeDatabaseInitThread : public QRunnable -{ -private: - void run() - { - QMimeDatabase mime_db; - mime_db.mimeTypeForData(QByteArray()); - } -}; - /* update the main window */ void main_window_update(void) { @@ -395,9 +380,6 @@ int main(int argc, char *qt_argv[]) QTextCodec::setCodecForTr(utf8codec); #endif - MimeDatabaseInitThread *mime_db_init_thread = new(MimeDatabaseInitThread); - QThreadPool::globalInstance()->start(mime_db_init_thread); - /* Set the C-language locale to the native environment. */ setlocale(LC_ALL, ""); |