-rw-r--r-- | library/categoryedit_p.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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 | |||
@@ -124,14 +124,17 @@ void CategoryEdit::slotSetText( QListViewItem *selected ) | |||
124 | 124 | ||
125 | void CategoryEdit::slotAdd() | 125 | void CategoryEdit::slotAdd() |
126 | { | 126 | { |
127 | QString name = tr( "New Category" ); | 127 | QString name = tr( "New Category" ); |
128 | bool insertOk = FALSE; | 128 | int uid = 0; |
129 | int num = 0; | 129 | int num = 0; |
130 | while ( !insertOk ) { | 130 | while ( !uid ) { |
131 | if ( num++ > 0 ) | 131 | if ( num++ > 0 ) |
132 | name = tr("New Category ") + QString::number(num); | 132 | name = tr("New Category ") + QString::number(num); |
133 | insertOk = d->mCategories.addCategory( d->mStrApp, name ); | 133 | if ( chkGlobal->isChecked() ) |
134 | uid = d->mCategories.addGlobalCategory( name ); | ||
135 | else | ||
136 | uid = d->mCategories.addCategory( d->mStrApp, name ); | ||
134 | } | 137 | } |
135 | QCheckListItem *chk; | 138 | QCheckListItem *chk; |
136 | chk = new QCheckListItem( lvView, name, QCheckListItem::CheckBox ); | 139 | chk = new QCheckListItem( lvView, name, QCheckListItem::CheckBox ); |
137 | if ( !chkGlobal->isChecked() ) | 140 | if ( !chkGlobal->isChecked() ) |