From 51bd5e8d542372ad54898ce642fe9b82b8ba83f3 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 10 Jan 2007 16:52:08 +0000 Subject: BUG: If the global category is checked in the category dialog the 'New Category' entry is still in local application scope. This means that the 'New Category' entry is in the wrong scope and all hell breaks loose. Actually the user will probably get confused that the category they are wanting to change is not in the right scope. FIX: Check to see that the global checkbox is checked before trying to add the new category. NOTE: This patch was originally submitted by Paul Eggleton (Blue Lightning). Thanks for the fix! --- (limited to 'library') diff --git a/library/categoryedit_p.cpp b/library/categoryedit_p.cpp index 14ac2e1..ee0da22 100644 --- a/library/categoryedit_p.cpp +++ b/library/categoryedit_p.cpp @@ -125,12 +125,15 @@ void CategoryEdit::slotSetText( QListViewItem *selected ) void CategoryEdit::slotAdd() { QString name = tr( "New Category" ); - bool insertOk = FALSE; + int uid = 0; int num = 0; - while ( !insertOk ) { + while ( !uid ) { if ( num++ > 0 ) name = tr("New Category ") + QString::number(num); - insertOk = d->mCategories.addCategory( d->mStrApp, name ); + if ( chkGlobal->isChecked() ) + uid = d->mCategories.addGlobalCategory( name ); + else + uid = d->mCategories.addCategory( d->mStrApp, name ); } QCheckListItem *chk; chk = new QCheckListItem( lvView, name, QCheckListItem::CheckBox ); -- cgit v0.9.0.2