]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiPrefs.cpp
Allow to unbind without specifying the lfun
[lyx.git] / src / frontends / qt / GuiPrefs.cpp
index 40c063890ba056197060c421d199782b51eba4d6..31da12936fd1a3577a2ac200aaf3855591ae0fee 100644 (file)
@@ -1328,7 +1328,6 @@ PrefDisplay::PrefDisplay(GuiPreferences * form)
        connect(previewSizeSB, SIGNAL(valueChanged(double)), this, SIGNAL(changed()));
        connect(paragraphMarkerCB, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
        connect(ctAdditionsUnderlinedCB, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
-       connect(ctUseBackingstoreCB, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
 }
 
 
@@ -1356,8 +1355,6 @@ void PrefDisplay::applyRC(LyXRC & rc) const
        rc.preview_scale_factor = previewSizeSB->value();
        rc.paragraph_markers = paragraphMarkerCB->isChecked();
        rc.ct_additions_underlined = ctAdditionsUnderlinedCB->isChecked();
-       rc.draw_strategy = ctUseBackingstoreCB->isChecked()
-               ? LyXRC::DS_BACKINGSTORE : LyXRC::DS_PARTIAL;
 
        // FIXME!! The graphics cache no longer has a changeDisplay method.
 #if 0
@@ -1387,8 +1384,6 @@ void PrefDisplay::updateRC(LyXRC const & rc)
        previewSizeSB->setValue(rc.preview_scale_factor);
        paragraphMarkerCB->setChecked(rc.paragraph_markers);
        ctAdditionsUnderlinedCB->setChecked(rc.ct_additions_underlined);
-       ctUseBackingstoreCB->setChecked(rc.draw_strategy == LyXRC::DS_BACKINGSTORE);
-       ctUseBackingstoreCB->setHidden(guiApp->needsBackingStore());
        previewSizeSB->setEnabled(
                rc.display_graphics
                && rc.preview != LyXRC::PREVIEW_OFF);
@@ -3092,10 +3087,10 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
        QTreeWidgetItem * newItem = nullptr;
        // for unbind items, try to find an existing item in the system bind list
        if (tag == KeyMap::UserUnbind) {
-               QList<QTreeWidgetItem*> const items = shortcutsTW->findItems(lfun_name,
-                       Qt::MatchFlags(Qt::MatchExactly | Qt::MatchRecursive), 0);
+               QList<QTreeWidgetItem*> const items = shortcutsTW->findItems(shortcut,
+                       Qt::MatchFlags(Qt::MatchExactly | Qt::MatchRecursive), 1);
                for (auto const & item : items) {
-                       if (item->text(1) == shortcut) {
+                       if (item->text(0) == lfun_name || lfun == FuncRequest::unknown) {
                                newItem = item;
                                break;
                        }
@@ -3130,10 +3125,10 @@ QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
                        // this should not happen
                        newItem = new QTreeWidgetItem(shortcutsTW);
                }
+               newItem->setText(0, lfun_name);
+               newItem->setText(1, shortcut);
        }
 
-       newItem->setText(0, lfun_name);
-       newItem->setText(1, shortcut);
        // record BindFile representation to recover KeySequence when needed.
        newItem->setData(1, Qt::UserRole, toqstr(seq.print(KeySequence::BindFile)));
        setItemType(newItem, tag);