]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocWidget.cpp
Fix bug #6661: Outliner filter bar should not be case sensitive.
[lyx.git] / src / frontends / qt4 / TocWidget.cpp
index 738e474b157b89b9b6cb7d6605b93c67220684f1..80e867c7d1d05e3ce1b80f9e7fc87364c3c7b296 100644 (file)
@@ -139,7 +139,7 @@ bool TocWidget::getStatus(Cursor & cur, FuncRequest const & cmd,
        TocItem const & item =
                gui_view_.tocModels().currentItem(current_type_, index);
 
-       switch (cmd.action)
+       switch (cmd.action())
        {
        case LFUN_CHANGE_ACCEPT:
        case LFUN_CHANGE_REJECT:
@@ -179,7 +179,7 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd)
        // Start an undo group.
        cur.beginUndoGroup();
 
-       switch (cmd.action)
+       switch (cmd.action())
        {
        case LFUN_CHANGE_ACCEPT:
        case LFUN_CHANGE_REJECT:
@@ -200,7 +200,7 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd)
        case LFUN_OUTLINE_DOWN:
        case LFUN_OUTLINE_IN:
        case LFUN_OUTLINE_OUT:
-               outline(cmd.action);
+               outline(cmd.action());
                break;
 
        default:
@@ -315,7 +315,8 @@ void TocWidget::on_typeCO_currentIndexChanged(int index)
 {
        current_type_ = typeCO->itemData(index).toString();
        updateView();
-       gui_view_.setFocus();
+       if (typeCO->hasFocus())
+               gui_view_.setFocus();
 }
 
 
@@ -404,7 +405,8 @@ void TocWidget::updateView()
        tocTV->setEnabled(false);
        tocTV->setUpdatesEnabled(false);
 
-       QAbstractItemModel * toc_model = gui_view_.tocModels().model(current_type_);
+       QAbstractItemModel * toc_model = 
+                       gui_view_.tocModels().model(current_type_);
        if (tocTV->model() != toc_model) {
                tocTV->setModel(toc_model);
                tocTV->setEditTriggers(QAbstractItemView::NoEditTriggers);
@@ -453,7 +455,7 @@ void TocWidget::filterContents()
                QModelIndex index = indices[i];
                bool const matches =
                        index.data().toString().contains(
-                               filterLE->text(), Qt::CaseSensitive);
+                               filterLE->text(), Qt::CaseInsensitive);
                tocTV->setRowHidden(index.row(), index.parent(), !matches);
        }
        // recursively unhide parents of unhidden children