]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
Do not show master's errors if compiling child
[lyx.git] / src / frontends / qt4 / GuiApplication.cpp
index 8b43169aae5be486763a496920458a9b5c03de6b..35b639c9ac490e27e09ee25c123afce961eb9840 100644 (file)
@@ -474,7 +474,7 @@ QString findImg(QString const & name)
        return img_name;
 }
 
-} // namespace anon
+} // namespace
 
 
 QString themeIconName(QString const & action)
@@ -598,7 +598,7 @@ QPixmap getPixmap(QString const & path, QString const & name, QString const & ex
        if (getPixmap(pixmap, fpath)) {
                return pixmap;
        }
-       
+
        QStringList exts = ext.split(",");
        fpath = ":/" + path + name + ".";
        for (int i = 0; i < exts.size(); ++i) {
@@ -1407,7 +1407,7 @@ DispatchResult const & GuiApplication::dispatch(FuncRequest const & cmd)
        updateCurrentView(cmd, dr);
 
        // the buffer may have been closed by one action
-       if (theBufferList().isLoaded(buffer))
+       if (theBufferList().isLoaded(buffer) || theBufferList().isInternal(buffer))
                buffer->undo().endUndoGroup();
 
        d->dispatch_result_ = dr;
@@ -1727,13 +1727,8 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                current_view_->message(bformat(_("Opening help file %1$s..."),
                                               makeDisplayPath(fname.absFileName())));
                Buffer * buf = current_view_->loadDocument(fname, false);
-
-#ifndef DEVEL_VERSION
                if (buf)
-                       buf->setReadonly(true);
-#else
-               (void) buf;
-#endif
+                       buf->setReadonly(!current_view_->develMode());
                break;
        }
 
@@ -1888,7 +1883,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        dispatch(func);
                }
                // the buffer may have been closed by one action
-               if (theBufferList().isLoaded(buffer))
+               if (theBufferList().isLoaded(buffer) || theBufferList().isInternal(buffer))
                        buffer->undo().endUndoGroup();
                break;
        }
@@ -2075,9 +2070,8 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        if (current_view_ == 0)
                                createView();
                }
-               // fall through
        }
-
+       // fall through
        default:
                // The LFUN must be for one of GuiView, BufferView, Buffer or Cursor;
                // let's try that:
@@ -2295,8 +2289,12 @@ void GuiApplication::processFuncRequestAsync(FuncRequest const & func)
 void GuiApplication::processFuncRequestQueue()
 {
        while (!d->func_request_queue_.empty()) {
-               processFuncRequest(d->func_request_queue_.front());
+               // take the item from the stack _before_ processing the
+               // request in order to avoid race conditions from nested
+               // or parallel requests (see #10406)
+               FuncRequest const fr(d->func_request_queue_.front());
                d->func_request_queue_.pop();
+               processFuncRequest(fr);
        }
 }
 
@@ -2657,7 +2655,7 @@ namespace {
                const QFontInfo fi(font);
                return fi.fixedPitch();
        }
-}
+} // namespace
 
 
 QFont const GuiApplication::typewriterSystemFont()
@@ -2729,7 +2727,8 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event)
 #endif
                        // In release mode, try to exit gracefully.
                        this->exit(1);
-
+                       // FIXME: GCC 7 thinks we can fall through here. Can we?
+                       // fall through
                case BufferException: {
                        if (!current_view_ || !current_view_->documentBufferView())
                                return false;