summaryrefslogtreecommitdiffstats
path: root/krecipes/src/recipefilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'krecipes/src/recipefilter.cpp')
-rw-r--r--krecipes/src/recipefilter.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/krecipes/src/recipefilter.cpp b/krecipes/src/recipefilter.cpp
index f350edd..9958e67 100644
--- a/krecipes/src/recipefilter.cpp
+++ b/krecipes/src/recipefilter.cpp
@@ -15,17 +15,17 @@
#include "widgets/recipelistview.h"
-RecipeFilter::RecipeFilter( KListView *klv ) : QObject( klv ),
+RecipeFilter::RecipeFilter( KListView *klv ) : TQObject( klv ),
listview( klv ),
currentCategory( 0 )
{}
-void RecipeFilter::filter( const QString &s )
+void RecipeFilter::filter( const TQString &s )
{
//do this to only iterate over children of 'currentCategory'
- QListViewItem * pEndItem = NULL;
+ TQListViewItem * pEndItem = NULL;
if ( currentCategory ) {
- QListViewItem * pStartItem = currentCategory;
+ TQListViewItem * pStartItem = currentCategory;
do {
if ( pStartItem->nextSibling() )
pEndItem = pStartItem->nextSibling();
@@ -36,11 +36,11 @@ void RecipeFilter::filter( const QString &s )
}
//Re-show everything
- QListViewItemIterator list_it;
+ TQListViewItemIterator list_it;
if ( currentCategory )
- list_it = QListViewItemIterator( currentCategory );
+ list_it = TQListViewItemIterator( currentCategory );
else
- list_it = QListViewItemIterator( listview );
+ list_it = TQListViewItemIterator( listview );
while ( list_it.current() != pEndItem ) {
list_it.current() ->setVisible( true );
list_it++;
@@ -48,8 +48,8 @@ void RecipeFilter::filter( const QString &s )
// Only filter if the filter text isn't empty
if ( !s.isEmpty() ) {
- QListViewItemIterator list_it( listview );
- while ( QListViewItem * it = list_it.current() ) {
+ TQListViewItemIterator list_it( listview );
+ while ( TQListViewItem * it = list_it.current() ) {
if ( it->rtti() == 1000 ) // Its a recipe
{
RecipeListItem * recipe_it = ( RecipeListItem* ) it;
@@ -82,8 +82,8 @@ void RecipeFilter::filterCategory( int categoryID )
if ( categoryID == -1 )
currentCategory = 0;
else {
- QListViewItemIterator list_it( listview );
- while ( QListViewItem * it = list_it.current() ) {
+ TQListViewItemIterator list_it( listview );
+ while ( TQListViewItem * it = list_it.current() ) {
if ( it->rtti() == 1001 ) {
CategoryListItem * cat_it = ( CategoryListItem* ) it;
if ( cat_it->categoryId() == categoryID ) {
@@ -96,8 +96,8 @@ void RecipeFilter::filterCategory( int categoryID )
}
}
- QListViewItemIterator list_it( listview );
- while ( QListViewItem * it = list_it.current() ) {
+ TQListViewItemIterator list_it( listview );
+ while ( TQListViewItem * it = list_it.current() ) {
if ( categoryID == -1 )
it->setVisible( true ); // We're not filtering categories
else if ( it == currentCategory || isParentOf( it, currentCategory ) || isParentOf( currentCategory, it ) )
@@ -112,9 +112,9 @@ void RecipeFilter::filterCategory( int categoryID )
currentCategory->setOpen( true );
}
-bool RecipeFilter::hideIfEmpty( QListViewItem *parent )
+bool RecipeFilter::hideIfEmpty( TQListViewItem *parent )
{
- QListViewItem * it;
+ TQListViewItem * it;
if ( parent == 0 )
it = listview->firstChild();
else
@@ -140,9 +140,9 @@ bool RecipeFilter::hideIfEmpty( QListViewItem *parent )
return parent_should_show;
}
-bool RecipeFilter::isParentOf( QListViewItem *parent, QListViewItem *to_check )
+bool RecipeFilter::isParentOf( TQListViewItem *parent, TQListViewItem *to_check )
{
- for ( QListViewItem * it = to_check->parent(); it; it = it->parent() ) {
+ for ( TQListViewItem * it = to_check->parent(); it; it = it->parent() ) {
if ( it == parent )
return true;
}