mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Initialize ssl libraries at program start (may affect on issue #303)
This commit is contained in:
parent
cce47a77c3
commit
9bb6768bd9
|
@ -25,6 +25,9 @@
|
|||
#include <QProcess>
|
||||
#include "historypanewidget.hh"
|
||||
#include <QCryptographicHash>
|
||||
#include <QRunnable>
|
||||
#include <QThreadPool>
|
||||
#include <QSslConfiguration>
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "lionsupport.h"
|
||||
|
@ -47,6 +50,19 @@ using std::wstring;
|
|||
using std::map;
|
||||
using std::pair;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
|
||||
class InitSSLRunnable : public QRunnable
|
||||
{
|
||||
virtual void run()
|
||||
{
|
||||
/// This action force SSL library initialisation which may continue a few seconds
|
||||
QSslConfiguration::setDefaultConfiguration( QSslConfiguration::defaultConfiguration() );
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
MainWindow::MainWindow( Config::Class & cfg_ ):
|
||||
commitDataCompleted( false ),
|
||||
trayIcon( 0 ),
|
||||
|
@ -84,6 +100,10 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
, gdAskMessage( 0xFFFFFFFF )
|
||||
#endif
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
QThreadPool::globalInstance()->start( new InitSSLRunnable );
|
||||
#endif
|
||||
|
||||
applyQtStyleSheet( cfg.preferences.displayStyle, cfg.preferences.addonStyle );
|
||||
|
||||
ui.setupUi( this );
|
||||
|
|
Loading…
Reference in a new issue