Commit 54597a6a authored by Thomas Schöps's avatar Thomas Schöps

Make ForegroundLock::isLockedForThread() also consider the current thread...

Make ForegroundLock::isLockedForThread() also consider the current thread being the main (Qt) thread, and thus add this check in more places
parent 241d71a2
......@@ -47,6 +47,8 @@
#include <language/interfaces/editorcontext.h>
#include <language/backgroundparser/backgroundparser.h>
#include <util/foregroundlock.h>
#include "core.h"
#include "mainwindow.h"
#include "uicontroller.h"
......@@ -527,6 +529,7 @@ KTextEditor::Range TextDocument::textSelection() const
QString TextDocument::text(const KTextEditor::Range &range) const
{
VERIFY_FOREGROUND_LOCKED
Q_D(const TextDocument);
if (!d->document) {
......@@ -538,6 +541,7 @@ QString TextDocument::text(const KTextEditor::Range &range) const
QString TextDocument::textLine() const
{
VERIFY_FOREGROUND_LOCKED
Q_D(const TextDocument);
if (!d->document) {
......@@ -555,6 +559,7 @@ QString TextDocument::textLine() const
QString TextDocument::textWord() const
{
VERIFY_FOREGROUND_LOCKED
Q_D(const TextDocument);
if (!d->document) {
......
......@@ -148,7 +148,8 @@ public:
bool KDevelop::ForegroundLock::isLockedForThread()
{
return QThread::currentThread() == holderThread;
return QThread::currentThread() == holderThread ||
QThread::currentThread() == QApplication::instance()->thread();
}
bool KDevelop::ForegroundLock::tryLock()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment