From fd6e14414f272d5890fa5334f861c3b0770ca908 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Sun, 5 Jul 2020 02:24:57 +0200 Subject: [PATCH] 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 insertion(+), 46 deletions(-) diff --git a/src/frontends/qt/GuiRef.cpp b/src/frontends/qt/GuiRef.cpp index d819e45ff8..a727700005 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 335ff02076..d46bbad0a3 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 53d637b094..0f4a7d351a 100644 --- a/src/frontends/qt/ui/RefUi.ui +++ b/src/frontends/qt/ui/RefUi.ui @@ -27,31 +27,7 @@ - - - - - false - - - &Name: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - nameED - - - - - - - false - - - - + @@ -381,7 +357,6 @@ groupCB referenceED typeCO - nameED qt_i18n.h diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index e9b2695397..d41f0a1165 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; -- 2.39.5