]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiViewSource.cpp
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiViewSource.cpp
index d58e173837a37ade140fece22c7d81f379c665a5..04c6bf5c349796661315388d72b26d91c9febab9 100644 (file)
@@ -197,20 +197,21 @@ void ViewSourceWidget::updateView(BufferView const * bv)
                   masterPerspectiveCB->isChecked());
        QString old = document_->toPlainText();
        QString qcontent = toqstr(content);
-#ifdef DEVEL_VERSION
-       // output tex<->row correspondences in the source panel if the "-dbg latex"
-       // option is given.
-       if (texrow_ && lyx::lyxerr.debugging(Debug::LATEX)) {
-               QStringList list = qcontent.split(QChar('\n'));
-               docstring_list dlist;
-               for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it)
-                       dlist.push_back(from_utf8(fromqstr(*it)));
-               texrow_->prepend(dlist);
-               qcontent.clear();
-               for (docstring_list::iterator it = dlist.begin(); it != dlist.end(); ++it)
-                       qcontent += toqstr(*it) + '\n';
+       if (guiApp->currentView()->develMode()) {
+               // output tex<->row correspondences in the source panel if the "-dbg latex"
+               // option is given.
+               if (texrow_ && lyx::lyxerr.debugging(Debug::LATEX)) {
+                       QStringList list = qcontent.split(QChar('\n'));
+                       docstring_list dlist;
+                       for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it)
+                               dlist.push_back(from_utf8(fromqstr(*it)));
+                       texrow_->prepend(dlist);
+                       qcontent.clear();
+                       for (docstring_list::iterator it = dlist.begin(); it != dlist.end(); ++it)
+                               qcontent += toqstr(*it) + '\n';
+               }
        }
-#endif
+
        // prevent gotoCursor()
        QSignalBlocker blocker(viewSourceTV);
        bool const changed = setText(qcontent);
@@ -366,9 +367,8 @@ void ViewSourceWidget::resizeEvent (QResizeEvent * event)
 }
 
 
-void ViewSourceWidget::saveSession(QString const & session_key) const
+void ViewSourceWidget::saveSession(QSettings & settings, QString const & session_key) const
 {
-       QSettings settings;
        settings.setValue(session_key + "/output", toqstr(view_format_));
        settings.setValue(session_key + "/contents", contentsCO->currentIndex());
        settings.setValue(session_key + "/autoupdate", autoUpdateCB->isChecked());
@@ -461,10 +461,10 @@ void GuiViewSource::updateTitle()
 }
 
 
-void GuiViewSource::saveSession() const
+void GuiViewSource::saveSession(QSettings & settings) const
 {
-       Dialog::saveSession();
-       widget_->saveSession(sessionKey());
+       Dialog::saveSession(settings);
+       widget_->saveSession(settings, sessionKey());
 }