[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - vcl/qt5

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Sat Feb 22 09:04:59 UTC 2020


 vcl/qt5/Qt5Instance.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 3e1ae2e28718b7e9dda6a4a6e08dd4a512828858
Author:     Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
AuthorDate: Fri Feb 21 00:22:37 2020 +0100
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Sat Feb 22 10:04:27 2020 +0100

    tdf#130499 Qt5 no qApp == main thread
    
    If there is no QApplication, we can ignore the GUI thread.
    
    Change-Id: I0d2faf4799d493ad0b6074b40242c443d4bc43dc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89241
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
    (cherry picked from commit c6fb366e05370af553af2130b370909ed4495cff)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89141
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index eae41ad9a2bd..a040900fc7ee 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -397,7 +397,10 @@ void Qt5Instance::AddToRecentDocumentList(const OUString&, const OUString&, cons
 
 OpenGLContext* Qt5Instance::CreateOpenGLContext() { return new Qt5OpenGLContext; }
 
-bool Qt5Instance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); }
+bool Qt5Instance::IsMainThread() const
+{
+    return !qApp || (qApp->thread() == QThread::currentThread());
+}
 
 void Qt5Instance::TriggerUserEventProcessing()
 {


More information about the Libreoffice-commits mailing list