[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/krecipes/src/dialogs
From:       Jason Kivlighn <confederacy2 () excite ! com>
Date:       2004-03-18 2:28:34
Message-ID: 20040318022834.D929F999A () office ! kde ! org
[Download RAW message or body]

CVS commit by jkivlighn: 

Now creating a new category from the dialog to select a category is actually possible \
(Fixed a small bug in the code to add this ability).   Also, the categories can be \
sorted in this dialog.


  M +4 -7      selectcategoriesdialog.cpp   1.16
  M +1 -1      selectcategoriesdialog.h   1.10


--- kdenonbeta/krecipes/src/dialogs/selectcategoriesdialog.h  #1.9:1.10
@@ -44,6 +44,6 @@ private:
 
         //Variables
-        ElementList categoryListPC;
         RecipeDB *database;
+        
         //Private methods
         void loadCategories(const ElementList &categoryList, QPtrList <bool> \
*selected);

--- kdenonbeta/krecipes/src/dialogs/selectcategoriesdialog.cpp  #1.15:1.16
@@ -22,4 +22,6 @@ class CategoryListItem:public QCheckList
 public:
         CategoryListItem(QListView* qlv, const Element &el \
):QCheckListItem(qlv,QString::null,QCheckListItem::CheckBox),elStored(el){} +        \
Element element() const { return elStored; } +
 private:
         const Element elStored;
@@ -38,5 +40,5 @@ SelectCategoriesDialog::SelectCategories
 // Store pointer
 database = db;
-categoryListPC=categoryList;
+
 //Design UI
 
@@ -52,5 +54,4 @@ categoryListView=new KListView(this);
 categoryListView->addColumn("*");
 categoryListView->addColumn(i18n("Category"));
-categoryListView->setSorting(-1);
 categoryListView->setAllColumnsShowFocus(true);
 layout->addMultiCellWidget(categoryListView,1,1,1,3);
@@ -99,12 +100,8 @@ SelectCategoriesDialog::~SelectCategorie
 void SelectCategoriesDialog::getSelectedCategories(ElementList *newSelected)
 {
-ElementList::const_iterator element_it = categoryListPC.begin(); // Initialize to \
                first element
-
 for (CategoryListItem *it=(CategoryListItem *) categoryListView->firstChild();it; \
it=(CategoryListItem *) it->nextSibling())  {
         /*bool *newValue=new bool;*/
-        if (it->isOn()) newSelected->append(*element_it); // If checked, add
-
-        element_it++;
+        if (it->isOn()) newSelected->append(it->element()); // If checked, add
         }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic