Re: [PATCH] Fix adding global categories
Paul Eggleton <[email protected]> Fri, 5 Jan 2007 18:31:24 +1300
| Newsgroups | gmane.comp.handhelds.opie.devel |
|---|---|
| Message-ID | <[email protected]> |
On Friday 29 December 2006 13:44, Paul Eggleton wrote: > This patch fixes the bug that prevents setting the name properly on a new > global category in the category editing dialog. Re-based patch with style changes removed is attached. Cheers, Paul _______________________________________________ http://opie.handhelds.org/cgi-bin/moin.cgi/DeveloperWikiIndex Opie-devel mailing list [email protected] https://handhelds.org/mailman/listinfo/opie-devel
category_add2.patch
(text/x-diff, 934 B)
Index: library/categoryedit_p.cpp
===================================================================
RCS file: /cvs/opie/library/categoryedit_p.cpp,v
retrieving revision 1.4
diff -u -B -b -r1.4 categoryedit_p.cpp
--- library/categoryedit_p.cpp 1 Mar 2004 18:10:37 -0000 1.4
+++ library/categoryedit_p.cpp 5 Jan 2007 05:29:01 -0000
@@ -125,12 +125,15 @@
void CategoryEdit::slotAdd()
{
QString name = tr( "New Category" );
- bool insertOk = FALSE;
int num = 0;
- while ( !insertOk ) {
+ int uid = 0;
+ while ( uid == 0 ) {
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 );