Author: forenr
Date: Wed Nov 10 16:35:56 2010
New Revision: 36235
URL: http://www.lyx.org/trac/changeset/36235

Log:
Fix the 100% cpu load problem when previewing with Qt 4.2 and 4.3.
Now it works fine again with those Qt versions.

Modified:
   lyx-devel/trunk/src/frontends/qt4/GuiView.cpp

Modified: lyx-devel/trunk/src/frontends/qt4/GuiView.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiView.cpp       Wed Nov 10 15:36:35 
2010        (r36234)
+++ lyx-devel/trunk/src/frontends/qt4/GuiView.cpp       Wed Nov 10 16:35:56 
2010        (r36235)
@@ -497,6 +497,7 @@
 }
 
 
+#if QT_VERSION >= 0x040400
 void GuiView::setCursorShapes(Qt::CursorShape shape)
 {
        QVector<GuiWorkArea*> areas = d.guiWorkAreas();
@@ -549,7 +550,6 @@
 
 void GuiView::processingThreadFinished()
 {
-#if (QT_VERSION >= 0x040400)
        QFutureWatcher<docstring> const * watcher =
                static_cast<QFutureWatcher<docstring> const *>(sender());
        message(watcher->result());
@@ -558,10 +558,41 @@
        d.processing_cursor_timer_.stop();
        restoreCursorShapes();
        d.indicates_processing_ = false;
-#endif
+}
+
+#else
+
+void GuiView::setCursorShapes(Qt::CursorShape)
+{
+}
+
+
+void GuiView::restoreCursorShapes()
+{
 }
 
 
+void GuiView::saveCursorShapes()
+{
+}
+
+
+void GuiView::indicateProcessing()
+{
+}
+
+
+void GuiView::processingThreadStarted()
+{
+}
+
+
+void GuiView::processingThreadFinished()
+{
+}
+#endif
+
+
 void GuiView::saveLayout() const
 {
        QSettings settings;
@@ -2942,12 +2973,12 @@
        if (!used_buffer)
                return false;
 
-       gv_->processingThreadStarted();
        string format = argument;
        if (format.empty())
                format = used_buffer->getDefaultOutputFormat();
 
 #if EXPORT_in_THREAD && (QT_VERSION >= 0x040400)
+       gv_->processingThreadStarted();
        if (!msg.empty()) {
                progress_->clearMessages();
                gv_->message(msg);
@@ -2972,7 +3003,6 @@
                                
!used_buffer->params().getIncludedChildren().empty();
                return (used_buffer->*syncFunc)(format, true, 
update_unincluded);
        } else if (previewFunc) {
-    // TODO includeall must be false or we get a 100% busy thread, a bug?
                return (used_buffer->*previewFunc)(format, false);
        }
        (void) asyncFunc;

Reply via email to