commit fd6e14414f272d5890fa5334f861c3b0770ca908
Author: Thibaut Cuvelier <[email protected]>
Date:   Sun Jul 5 02:24:57 2020 +0200

    Remove GuiRef::nameAllowed, as the DocBook support no more uses it
---
 src/frontends/qt/GuiRef.cpp  |   16 ----------------
 src/frontends/qt/GuiRef.h    |    2 --
 src/frontends/qt/ui/RefUi.ui |   27 +--------------------------
 src/insets/InsetRef.cpp      |    2 --
 4 files changed, 1 insertions(+), 46 deletions(-)

diff --git a/src/frontends/qt/GuiRef.cpp b/src/frontends/qt/GuiRef.cpp
index d819e45..a727700 100644
--- a/src/frontends/qt/GuiRef.cpp
+++ b/src/frontends/qt/GuiRef.cpp
@@ -96,8 +96,6 @@ GuiRef::GuiRef(GuiView & lv)
                this, SLOT(resetFilter()));
        connect(csFindCB, SIGNAL(clicked()),
                this, SLOT(filterLabels()));
-       connect(nameED, SIGNAL(textChanged(QString)),
-               this, SLOT(changed_adaptor()));
        connect(refsTW, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
                this, SLOT(refHighlighted(QTreeWidgetItem *)));
        connect(refsTW, SIGNAL(itemSelectionChanged()),
@@ -213,8 +211,6 @@ void GuiRef::refHighlighted(QTreeWidgetItem * sel)
        gotoPB->setEnabled(true);
        if (!isBufferReadonly())
                typeCO->setEnabled(true);
-       nameED->setHidden(!nameAllowed());
-       nameL->setHidden(!nameAllowed());
 }
 
 
@@ -318,7 +314,6 @@ void GuiRef::updateContents()
                typeCO->itemData(typeCO->currentIndex()).toString();
 
        referenceED->clear();
-       nameED->clear();
        typeCO->clear();
 
        // FIXME Bring InsetMathRef on par with InsetRef
@@ -336,9 +331,6 @@ void GuiRef::updateContents()
                typeCO->addItem(qt_("Formatted reference"), "prettyref");
 
        referenceED->setText(toqstr(params_["reference"]));
-       nameED->setText(toqstr(params_["name"]));
-       nameED->setHidden(!nameAllowed());
-       nameL->setHidden(!nameAllowed());
 
        // restore type settings for new insets
        bool const new_inset = params_["reference"].empty();
@@ -392,7 +384,6 @@ void GuiRef::applyView()
 
        
params_.setCmdName(fromqstr(typeCO->itemData(typeCO->currentIndex()).toString()));
        params_["reference"] = qstring_to_ucs4(last_reference_);
-       params_["name"] = qstring_to_ucs4(nameED->text());
        params_["plural"] = pluralCB->isChecked() ?
              from_ascii("true") : from_ascii("false");
        params_["caps"] = capsCB->isChecked() ?
@@ -403,13 +394,6 @@ void GuiRef::applyView()
 }
 
 
-bool GuiRef::nameAllowed()
-{
-       KernelDocType const doc_type = docType();
-       return doc_type != LATEX && doc_type != LITERATE;
-}
-
-
 void GuiRef::setGoBack()
 {
        gotoPB->setText(qt_("&Go Back"));
diff --git a/src/frontends/qt/GuiRef.h b/src/frontends/qt/GuiRef.h
index 335ff02..d46bbad 100644
--- a/src/frontends/qt/GuiRef.h
+++ b/src/frontends/qt/GuiRef.h
@@ -73,8 +73,6 @@ private:
        ///
        void enableBoxes();
 
-       /// is name allowed for this ?
-       bool nameAllowed();
        /// go to current reference
        void gotoRef();
        /// set go back button
diff --git a/src/frontends/qt/ui/RefUi.ui b/src/frontends/qt/ui/RefUi.ui
index 53d637b..0f4a7d3 100644
--- a/src/frontends/qt/ui/RefUi.ui
+++ b/src/frontends/qt/ui/RefUi.ui
@@ -27,31 +27,7 @@
     </widget>
    </item>
    <item row="7" column="0">
-    <layout class="QHBoxLayout" name="horizontalLayout_4">
-     <item>
-      <widget class="QLabel" name="nameL">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-       <property name="text">
-        <string>&amp;Name:</string>
-       </property>
-       <property name="alignment">
-        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-       </property>
-       <property name="buddy">
-        <cstring>nameED</cstring>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLineEdit" name="nameED">
-       <property name="enabled">
-        <bool>false</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
+    <layout class="QHBoxLayout" name="horizontalLayout_4"/>
    </item>
    <item row="0" column="0">
     <layout class="QGridLayout" name="gridLayout">
@@ -381,7 +357,6 @@
   <tabstop>groupCB</tabstop>
   <tabstop>referenceED</tabstop>
   <tabstop>typeCO</tabstop>
-  <tabstop>nameED</tabstop>
  </tabstops>
  <includes>
   <include location="local">qt_i18n.h</include>
diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index e9b2695..d41f0a1 100644
--- a/src/insets/InsetRef.cpp
+++ b/src/insets/InsetRef.cpp
@@ -287,8 +287,6 @@ void InsetRef::latex(otexstream & os, OutputParams const & 
rp) const
                }
        }
        else {
-               // We don't want to output p_["name"], since that is only used
-               // in docbook. So we construct new params, without it, and use 
that.
                InsetCommandParams p(REF_CODE, cmd);
                docstring const ref = getParam("reference");
                p["reference"] = ref;
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to