src/hbwidgets/popups/hbselectiondialog_p.cpp
changeset 5 627c4a0fd0e7
parent 2 06ff229162e9
child 6 c3690ec91ef8
--- a/src/hbwidgets/popups/hbselectiondialog_p.cpp	Thu May 27 13:10:59 2010 +0300
+++ b/src/hbwidgets/popups/hbselectiondialog_p.cpp	Fri Jun 11 13:58:22 2010 +0300
@@ -84,7 +84,7 @@
 
         lbCounter->setText(QString(QString::number(selectedItems) + "/" + QString::number(totalItems)));
         //update checked state of "MarkAll" checkbox 
-        if (selectedItems == totalItems){
+        if (totalItems > 0 && (selectedItems == totalItems)){
             chkMark->blockSignals(true); //should not call _q_checkboxclicked()
             chkMark->setChecked(true);
             chkMark->blockSignals(false);
@@ -107,11 +107,13 @@
         indexStart = itemModel->index(0,0);
         indexEnd = itemModel->index(itemModel->rowCount()-1,0);
         totalItems = itemModel->rowCount();
+        Q_UNUSED( totalItems ); // todo: remove totalItems if not needed
     }
 
     QItemSelectionModel* selectionModel = mListWidget->selectionModel();
     if(selectionModel){
         selectedItems = selectionModel->selectedRows().count();
+        Q_UNUSED( selectedItems ); // todo: remove selectedItems if not needed
         if(value){ //Select All
             selectionModel->select(QItemSelection(indexStart,indexEnd),QItemSelectionModel::Select);
         }