From e4ba535e4dd08c66b8d30c8d75382c49b36125f5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 26 Aug 2004 20:53:13 +0000 Subject: [PATCH] From KDE_3_3_BRANCH: create an empty filter when there's none, to avoid a completely disabled dialog (usability tests indicated that the new-filter button is too hard to find that way. svn path=/trunk/kdepim/; revision=341538 --- kmfilterdlg.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/kmfilterdlg.cpp b/kmfilterdlg.cpp index f786da533..6546f2a9f 100644 --- a/kmfilterdlg.cpp +++ b/kmfilterdlg.cpp @@ -754,16 +754,14 @@ void KMFilterListBox::loadFilterList() blockSignals(FALSE); setEnabled(TRUE); - // select topmost item - if ( mListBox->count() ) - { - mListBox->setSelected( 0, TRUE ); - } - else - { - emit resetWidgets(); - mIdxSelItem = -1; - } + // create an empty filter when there's none, to avoid a completely + // disabled dialog (usability tests indicated that the new-filter + // button is too hard to find that way): + if ( !mListBox->count() ) + slotNew(); + + assert( mListBox->count() > 0 ); + mListBox->setSelected( 0, true ); enableControls(); }