summaryrefslogtreecommitdiffstats
path: root/krecipes/src/widgets/ingredientlistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'krecipes/src/widgets/ingredientlistview.cpp')
-rw-r--r--krecipes/src/widgets/ingredientlistview.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/krecipes/src/widgets/ingredientlistview.cpp b/krecipes/src/widgets/ingredientlistview.cpp
index 887896d..19f493d 100644
--- a/krecipes/src/widgets/ingredientlistview.cpp
+++ b/krecipes/src/widgets/ingredientlistview.cpp
@@ -21,7 +21,7 @@
#include "dialogs/createelementdialog.h"
#include "dialogs/dependanciesdialog.h"
-IngredientCheckListItem::IngredientCheckListItem( IngredientCheckListView* qlv, const Element &ing ) : QCheckListItem( qlv, QString::null, QCheckListItem::CheckBox ),
+IngredientCheckListItem::IngredientCheckListItem( IngredientCheckListView* qlv, const Element &ing ) : TQCheckListItem( qlv, TQString::null, TQCheckListItem::CheckBox ),
m_listview(qlv)
{
// Initialize the ingredient data with the the property data
@@ -30,7 +30,7 @@ IngredientCheckListItem::IngredientCheckListItem( IngredientCheckListView* qlv,
ingStored->name = ing.name;
}
-IngredientCheckListItem::IngredientCheckListItem( IngredientCheckListView* qlv, QListViewItem *after, const Element &ing ) : QCheckListItem( qlv, after, QString::null, QCheckListItem::CheckBox ),
+IngredientCheckListItem::IngredientCheckListItem( IngredientCheckListView* qlv, TQListViewItem *after, const Element &ing ) : TQCheckListItem( qlv, after, TQString::null, TQCheckListItem::CheckBox ),
m_listview(qlv)
{
// Initialize the ingredient data with the the property data
@@ -47,7 +47,7 @@ int IngredientCheckListItem::id( void ) const
{
return ingStored->id;
}
-QString IngredientCheckListItem::name( void ) const
+TQString IngredientCheckListItem::name( void ) const
{
return ingStored->name;
}
@@ -56,15 +56,15 @@ Element IngredientCheckListItem::ingredient() const
return *ingStored;
}
-QString IngredientCheckListItem::text( int column ) const
+TQString IngredientCheckListItem::text( int column ) const
{
switch ( column ) {
case 0:
return ( ingStored->name );
case 1:
- return ( QString::number( ingStored->id ) );
+ return ( TQString::number( ingStored->id ) );
default:
- return QString::null;
+ return TQString::null;
}
}
@@ -73,10 +73,10 @@ void IngredientCheckListItem::stateChange( bool on )
m_listview->stateChange(this,on);
}
-IngredientListView::IngredientListView( QWidget *parent, RecipeDB *db ) : DBListViewBase( parent,db, db->ingredientCount() )
+IngredientListView::IngredientListView( TQWidget *parent, RecipeDB *db ) : DBListViewBase( parent,db, db->ingredientCount() )
{
setAllColumnsShowFocus( true );
- setDefaultRenameAction( QListView::Reject );
+ setDefaultRenameAction( TQListView::Reject );
}
void IngredientListView::init()
@@ -104,7 +104,7 @@ void IngredientListView::checkCreateIngredient( const Element &el )
}
-StdIngredientListView::StdIngredientListView( QWidget *parent, RecipeDB *db, bool editable ) : IngredientListView( parent, db )
+StdIngredientListView::StdIngredientListView( TQWidget *parent, RecipeDB *db, bool editable ) : IngredientListView( parent, db )
{
addColumn( i18n( "Ingredient" ) );
@@ -127,13 +127,13 @@ StdIngredientListView::StdIngredientListView( QWidget *parent, RecipeDB *db, boo
delete il;
- connect( this, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ), SLOT( showPopup( KListView *, QListViewItem *, const QPoint & ) ) );
- connect( this, SIGNAL( doubleClicked( QListViewItem* ) ), this, SLOT( modIngredient( QListViewItem* ) ) );
- connect( this, SIGNAL( itemRenamed( QListViewItem* ) ), this, SLOT( saveIngredient( QListViewItem* ) ) );
+ connect( this, SIGNAL( contextMenu( KListView *, TQListViewItem *, const TQPoint & ) ), SLOT( showPopup( KListView *, TQListViewItem *, const TQPoint & ) ) );
+ connect( this, SIGNAL( doubleClicked( TQListViewItem* ) ), this, SLOT( modIngredient( TQListViewItem* ) ) );
+ connect( this, SIGNAL( itemRenamed( TQListViewItem* ) ), this, SLOT( saveIngredient( TQListViewItem* ) ) );
}
}
-void StdIngredientListView::showPopup( KListView * /*l*/, QListViewItem *i, const QPoint &p )
+void StdIngredientListView::showPopup( KListView * /*l*/, TQListViewItem *i, const TQPoint &p )
{
if ( i )
kpop->exec( p );
@@ -143,8 +143,8 @@ void StdIngredientListView::createNew()
{
CreateElementDialog * elementDialog = new CreateElementDialog( this, i18n( "New Ingredient" ) );
- if ( elementDialog->exec() == QDialog::Accepted ) {
- QString result = elementDialog->newElementName();
+ if ( elementDialog->exec() == TQDialog::Accepted ) {
+ TQString result = elementDialog->newElementName();
if ( checkBounds( result ) )
database->createNewIngredient( result ); // Create the new author in the database
@@ -154,7 +154,7 @@ void StdIngredientListView::createNew()
void StdIngredientListView::remove
()
{
- QListViewItem * it = currentItem();
+ TQListViewItem * it = currentItem();
if ( it ) {
int ingredientID = it->text( 1 ).toInt();
@@ -171,7 +171,7 @@ void StdIngredientListView::remove
DependanciesDialog warnDialog( this, list );
warnDialog.setCustomWarning( i18n("You are about to permanantly delete recipes from your database.") );
- if ( warnDialog.exec() == QDialog::Accepted )
+ if ( warnDialog.exec() == TQDialog::Accepted )
database->removeIngredient( ingredientID );
}
}
@@ -179,7 +179,7 @@ void StdIngredientListView::remove
void StdIngredientListView::rename()
{
- QListViewItem * item = currentItem();
+ TQListViewItem * item = currentItem();
if ( item )
IngredientListView::rename( item, 0 );
@@ -187,22 +187,22 @@ void StdIngredientListView::rename()
void StdIngredientListView::createIngredient( const Element &ing )
{
- createElement(new QListViewItem( this, ing.name, QString::number( ing.id ) ));
+ createElement(new TQListViewItem( this, ing.name, TQString::number( ing.id ) ));
}
void StdIngredientListView::removeIngredient( int id )
{
- QListViewItem * item = findItem( QString::number( id ), 1 );
+ TQListViewItem * item = findItem( TQString::number( id ), 1 );
removeElement(item);
}
-void StdIngredientListView::modIngredient( QListViewItem* i )
+void StdIngredientListView::modIngredient( TQListViewItem* i )
{
if ( i )
IngredientListView::rename( i, 0);
}
-void StdIngredientListView::saveIngredient( QListViewItem* i )
+void StdIngredientListView::saveIngredient( TQListViewItem* i )
{
if ( !checkBounds( i->text( 0 ) ) ) {
reload(ForceReload); //reset the changed text
@@ -229,10 +229,10 @@ void StdIngredientListView::saveIngredient( QListViewItem* i )
}
}
-bool StdIngredientListView::checkBounds( const QString &name )
+bool StdIngredientListView::checkBounds( const TQString &name )
{
if ( name.length() > uint(database->maxIngredientNameLength()) ) {
- KMessageBox::error( this, QString( i18n( "Ingredient name cannot be longer than %1 characters." ) ).arg( database->maxIngredientNameLength() ) );
+ KMessageBox::error( this, TQString( i18n( "Ingredient name cannot be longer than %1 characters." ) ).arg( database->maxIngredientNameLength() ) );
return false;
}
@@ -241,7 +241,7 @@ bool StdIngredientListView::checkBounds( const QString &name )
-IngredientCheckListView::IngredientCheckListView( QWidget *parent, RecipeDB *db ) : IngredientListView( parent, db )
+IngredientCheckListView::IngredientCheckListView( TQWidget *parent, RecipeDB *db ) : IngredientListView( parent, db )
{
addColumn( i18n( "Ingredient" ) );
@@ -258,7 +258,7 @@ void IngredientCheckListView::createIngredient( const Element &ing )
void IngredientCheckListView::removeIngredient( int id )
{
- QListViewItem * item = findItem( QString::number( id ), 1 );
+ TQListViewItem * item = findItem( TQString::number( id ), 1 );
removeElement(item);
}
@@ -266,8 +266,8 @@ void IngredientCheckListView::load( int limit, int offset )
{
IngredientListView::load(limit,offset);
- for ( QValueList<Element>::const_iterator ing_it = m_selections.begin(); ing_it != m_selections.end(); ++ing_it ) {
- QCheckListItem * item = ( QCheckListItem* ) findItem( QString::number( (*ing_it).id ), 1 );
+ for ( TQValueList<Element>::const_iterator ing_it = m_selections.begin(); ing_it != m_selections.end(); ++ing_it ) {
+ TQCheckListItem * item = ( TQCheckListItem* ) findItem( TQString::number( (*ing_it).id ), 1 );
if ( item ) {
item->setOn(true);
}