author | ar <ar> | 2004-05-31 15:26:50 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-31 15:26:50 (UTC) |
commit | 27dfc34d411dee76f09f5e516c60b0a64eb35948 (patch) (side-by-side diff) | |
tree | b7f7259497630390e352a1257cac5dc59f5399a6 /noncore/apps/tableviewer/ui/tvfilterview.cpp | |
parent | 27b09fe4f930b96e82cea9fb0eb1a9b87f7ec062 (diff) | |
download | opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.zip opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.tar.gz opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.tar.bz2 |
- convert qWarning to owarn
Diffstat (limited to 'noncore/apps/tableviewer/ui/tvfilterview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/ui/tvfilterview.cpp | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/noncore/apps/tableviewer/ui/tvfilterview.cpp b/noncore/apps/tableviewer/ui/tvfilterview.cpp index 22f1fb7..198c8b5 100644 --- a/noncore/apps/tableviewer/ui/tvfilterview.cpp +++ b/noncore/apps/tableviewer/ui/tvfilterview.cpp @@ -17,23 +17,29 @@ ** not clear to you. ** **********************************************************************/ #include "tvfilterview.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/qpeapplication.h> +using namespace Opie::Core; + +/* QT */ #include <qtoolbutton.h> #include <qcombobox.h> #include <qlistview.h> #include <qlayout.h> #include <qheader.h> #include <qpushbutton.h> #include <qlabel.h> -#include <qpe/qpeapplication.h> TVFilterView::TVFilterView(TableState *t, QWidget* parent, const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl) { - if ( !name ) - setName( "Filter View" ); + if ( !name ) + setName( "Filter View" ); QVBoxLayout *vlayout = new QVBoxLayout(this); display = new QListView(this, "display"); @@ -87,10 +93,10 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent, connect(keyEntry, SIGNAL(valueChanged()), this, SLOT( updateTerm() )); connect(keyNameCombo, SIGNAL(activated(int)), this, SLOT( updateTerm() )); - connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, - SLOT(setTerm(QListViewItem*))); + connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, + SLOT(setTerm(QListViewItem*))); ts = t; current = 0; terms.setAutoDelete(true); @@ -101,9 +107,9 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent, #endif } /*! - Destroys the TVFilterView widget + Destroys the TVFilterView widget */ TVFilterView::~TVFilterView() { } @@ -117,37 +123,37 @@ void TVFilterView::reset() keyNameCombo->clear(); keyIds.clear(); } -void TVFilterView::rebuildKeys() +void TVFilterView::rebuildKeys() { int i; if (!ts) return; if(!ts->kRep) return; keyEntry->setTableState(ts); - + /* set up the list of keys that can be compared on */ keyNameCombo->clear(); KeyListIterator it(*ts->kRep); i = 0; while(it.current()) { - if(ts->kRep->validIndex(it.currentKey())) { - keyNameCombo->insertItem(it.current()->name()); - keyIds.insert(i, it.currentKey()); - ++i; - } - ++it; + if(ts->kRep->validIndex(it.currentKey())) { + keyNameCombo->insertItem(it.current()->name()); + keyIds.insert(i, it.currentKey()); + ++i; + } + ++it; } } bool TVFilterView::passesFilter(DataElem *d) { if (!filterActive()) return true; FilterTerm *t; - + for (t = terms.first(); t != 0; t = terms.next() ) { /* check against filter */ switch(t->ct) { case ct_less: @@ -174,10 +180,9 @@ bool TVFilterView::passesFilter(DataElem *d) { if (!d->endsWith(t->keyIndex, t->value)) return false; break; default: - qWarning("TVFilterView::passesFilter() " - "unrecognized filter type"); + owarn << "TVFilterView::passesFilter() unrecognized filter type" << oendl; return false; } } return true; @@ -193,9 +198,9 @@ bool TVFilterView::filterActive() const return true; } /* SLOTS */ -void TVFilterView::newTerm() +void TVFilterView::newTerm() { if (!ts) return; FilterTerm *term = new FilterTerm; @@ -211,9 +216,9 @@ void TVFilterView::newTerm() keyEntry->setEnabled(true); keyNameCombo->setEnabled(true); } -void TVFilterView::updateTerm() +void TVFilterView::updateTerm() { FilterTerm *term; /* Read the widget values (keyname, compare type, value) * and build the lists */ @@ -230,9 +235,9 @@ void TVFilterView::updateTerm() term->keyIndex = keyIds[keyNameCombo->currentItem()]; keyEntry->setKey(term->keyIndex); /* so the next two items make sense */ term->ct = keyEntry->getCompareType(), term->value = keyEntry->getCompareValue(); - + keyString = keyNameCombo->currentText(); switch(term->ct) { case ct_less: @@ -259,16 +264,16 @@ void TVFilterView::updateTerm() vString = term->value.toString(); /* remove old view */ - if (term->view) + if (term->view) delete(term->view); term->view = new QListViewItem(display, 0, keyString, cmpString, vString); display->setSelected(term->view, true); } /* deletes current term */ -void TVFilterView::deleteTerm() +void TVFilterView::deleteTerm() { if(!current) return; if (current->view) delete(current->view); @@ -283,24 +288,24 @@ void TVFilterView::deleteTerm() } } /* clears all terminations */ -void TVFilterView::clearTerms() +void TVFilterView::clearTerms() { while(current) deleteTerm(); } void TVFilterView::setTerm(QListViewItem *target) { - /* Iterate through the list to find item with view=target.. + /* Iterate through the list to find item with view=target.. * set as current, delete */ FilterTerm *term = current; for (current = terms.first(); current != 0; current = terms.next() ) if (current->view == target) break; if (!current) { - current = term; + current = term; } } |