]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiRef.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiRef.cpp
index 9e647504866b850014d675b97c91e01a0a4ba592..141c67bc13733ac413da9d2c4c0e39eb0f0f94a6 100644 (file)
@@ -162,6 +162,11 @@ void GuiRef::refSelected(QTreeWidgetItem * sel)
        if (isBufferReadonly())
                return;
 
+       if (sel->childCount()) {
+               sel->setExpanded(false);
+               return;
+       }
+
 /*     int const cur_item = refsTW->currentRow();
        bool const cur_item_selected = cur_item >= 0 ?
                refsLB->isSelected(cur_item) : false;*/
@@ -392,11 +397,11 @@ void GuiRef::redoRefs()
                                QString const ref = refsStrings.at(i);
                                if ((ref.startsWith(cat + QString(":")))
                                    || (cat == qt_("<No prefix>")
-                                       && !ref.contains(":"))) {
-                                       QTreeWidgetItem * child =
-                                               new QTreeWidgetItem(item);
-                                       child->setText(0, ref);
-                                       item->addChild(child);
+                                      && (!ref.mid(1).contains(":") || ref.left(1).contains(":")))) {
+                                               QTreeWidgetItem * child =
+                                                       new QTreeWidgetItem(item);
+                                               child->setText(0, ref);
+                                               item->addChild(child);
                                }
                        }
                        refsCats.append(item);
@@ -457,6 +462,7 @@ void GuiRef::updateRefs()
        sortCB->setEnabled(!refs_.empty());
        caseSensitiveCB->setEnabled(sortCB->isEnabled() && sortCB->isChecked());
        refsTW->setEnabled(!refs_.empty());
+       groupCB->setEnabled(!refs_.empty());
        // refsTW should only be the focus proxy when it is enabled
        setFocusProxy(refs_.empty() ? 0 : refsTW);
        gotoPB->setEnabled(!refs_.empty());