[Kst] extragear/graphics/kst/src/libkstapp
George Staikos
staikos at kde.org
Mon Nov 27 08:04:14 CET 2006
SVN commit 608217 by staikos:
remove a very odd error message and use a switch() instead of lots of if()
M +22 -21 kstdatamanager_i.cpp
--- trunk/extragear/graphics/kst/src/libkstapp/kstdatamanager_i.cpp #608216:608217
@@ -767,34 +767,35 @@
void KstDataManagerI::edit_I() {
- QListViewItem *qi;
+ QListViewItem *qi = 0;
- if (DataView->selectedItems().count() > 0) {
+ if (!DataView->selectedItems().isEmpty()) {
qi = DataView->selectedItems().at(0);
} else {
- KMessageBox::sorry(this, i18n("A data item must be selected to edit."));
+ // This error message is odd to say the least.
+ //KMessageBox::sorry(this, i18n("A data item must be selected to edit."));
return;
}
- if (qi->rtti() == RTTI_OBJ_DATA_VECTOR) {
- emit editDataVector(qi->text(0));
+ switch (qi->rtti()) {
+ case RTTI_OBJ_DATA_VECTOR:
+ emit editDataVector(qi->text(0));
+ break;
+ case RTTI_OBJ_STATIC_VECTOR:
+ emit editStaticVector(qi->text(0));
+ break;
+ case RTTI_OBJ_OBJECT:
+ static_cast<KstObjectItem*>(qi)->dataObject()->showDialog(true);
+ break;
+ case RTTI_OBJ_DATA_MATRIX:
+ emit editDataMatrix(qi->text(0));
+ break;
+ case RTTI_OBJ_STATIC_MATRIX:
+ emit editStaticMatrix(qi->text(0));
+ break;
+ default:
+ break;
}
-
- if (qi->rtti() == RTTI_OBJ_STATIC_VECTOR) {
- emit editStaticVector(qi->text(0));
- }
-
- if (qi->rtti() == RTTI_OBJ_OBJECT) {
- static_cast<KstObjectItem*>(qi)->dataObject()->showDialog(true);
- }
-
- if (qi->rtti() == RTTI_OBJ_DATA_MATRIX) {
- emit editDataMatrix(qi->text(0));
- }
-
- if (qi->rtti() == RTTI_OBJ_STATIC_MATRIX) {
- emit editStaticMatrix(qi->text(0));
- }
}
More information about the Kst
mailing list