diff options
| author | Wladimir J. van der Laan <[email protected]> | 2012-03-24 17:07:29 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2012-04-04 08:46:12 +0200 |
| commit | 7e7bcce2d992c6fd53fdc4d9eb40f21c951d5347 (patch) | |
| tree | be52dbc136cd0e88a89dfe4487f8ee09d142bfa1 /src/qt/guiutil.cpp | |
| parent | move QT_PLUGINS stuff to qt main file, where it belongs (diff) | |
| download | discoin-7e7bcce2d992c6fd53fdc4d9eb40f21c951d5347.tar.xz discoin-7e7bcce2d992c6fd53fdc4d9eb40f21c951d5347.zip | |
Code deduplication: make function in GUIUtil to get connection type to call object slot in GUI thread
with invokeMethod.
Diffstat (limited to 'src/qt/guiutil.cpp')
| -rw-r--r-- | src/qt/guiutil.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index ac69bd07e..ad530a78e 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -17,6 +17,7 @@ #include <QClipboard> #include <QFileDialog> #include <QDesktopServices> +#include <QThread> QString GUIUtil::dateTimeStr(qint64 nTime) { @@ -184,3 +185,14 @@ QString GUIUtil::getSaveFileName(QWidget *parent, const QString &caption, return result; } +Qt::ConnectionType GUIUtil::blockingGUIThreadConnection() +{ + if(QThread::currentThread() != QCoreApplication::instance()->thread()) + { + return Qt::BlockingQueuedConnection; + } + else + { + return Qt::DirectConnection; + } +} |