summaryrefslogtreecommitdiffstats
path: root/krecipes/src/backends/qsqlrecipedb.h
diff options
context:
space:
mode:
Diffstat (limited to 'krecipes/src/backends/qsqlrecipedb.h')
-rw-r--r--krecipes/src/backends/qsqlrecipedb.h126
1 files changed, 63 insertions, 63 deletions
diff --git a/krecipes/src/backends/qsqlrecipedb.h b/krecipes/src/backends/qsqlrecipedb.h
index 68ba6cc..ca707dd 100644
--- a/krecipes/src/backends/qsqlrecipedb.h
+++ b/krecipes/src/backends/qsqlrecipedb.h
@@ -13,18 +13,18 @@
***************************************************************************/
-#ifndef QSQLRECIPEDB_H
-#define QSQLRECIPEDB_H
+#ifndef TQSQLRECIPEDB_H
+#define TQSQLRECIPEDB_H
#include "backends/recipedb.h"
-#include <qglobal.h>
-#include <qobject.h>
-#include <qsqldatabase.h>
-#include <qimage.h>
-#include <qfileinfo.h>
-#include <qregexp.h>
-#include <qstring.h>
+#include <ntqglobal.h>
+#include <ntqobject.h>
+#include <ntqsqldatabase.h>
+#include <ntqimage.h>
+#include <ntqfileinfo.h>
+#include <ntqregexp.h>
+#include <ntqstring.h>
#include "datablocks/recipe.h"
#include "datablocks/elementlist.h"
@@ -34,19 +34,19 @@
/**
@author Unai Garro, Jason Kivlighn
*/
-class QSqlRecipeDB : public RecipeDB
+class TQSqlRecipeDB : public RecipeDB
{
Q_OBJECT
protected:
- virtual QString qsqlDriverPlugin() const { return QString::null; }
- virtual QSqlDriver *qsqlDriver() const { return 0; }
+ virtual TQString qsqlDriverPlugin() const { return TQString::null; }
+ virtual TQSqlDriver *qsqlDriver() const { return 0; }
virtual void createDB( void ) = 0;
virtual void portOldDatabases( float version );
- virtual void storePhoto( int recipeID, const QByteArray &data );
- virtual void loadPhoto( int recipeID, QPixmap &photo );
+ virtual void storePhoto( int recipeID, const TQByteArray &data );
+ virtual void loadPhoto( int recipeID, TQPixmap &photo );
void loadRecipeMetadata( Recipe *recipe );
void search( RecipeList *list, int items, const RecipeSearchParameters & );
@@ -58,54 +58,54 @@ protected:
* Note: Only call when an insert is actually going to take place.
* This function will increment the sequence counter.
*/
- virtual int getNextInsertID( const QString & /*table*/, const QString & /*column*/ )
+ virtual int getNextInsertID( const TQString & /*table*/, const TQString & /*column*/ )
{
return -1;
}
- QSqlDatabase *database;
- QSqlQuery m_query;
- QString DBuser;
- QString DBpass;
- QString DBhost;
+ TQSqlDatabase *database;
+ TQSqlQuery m_query;
+ TQString DBuser;
+ TQString DBpass;
+ TQString DBhost;
int DBport;
public:
- QSqlRecipeDB( const QString &host, const QString &user = QString::null, const QString &pass = QString::null, const QString &DBName = DEFAULT_DB_NAME, int port = 0 );
- ~QSqlRecipeDB( void );
+ TQSqlRecipeDB( const TQString &host, const TQString &user = TQString::null, const TQString &pass = TQString::null, const TQString &DBName = DEFAULT_DB_NAME, int port = 0 );
+ ~TQSqlRecipeDB( void );
void connect( bool create_db, bool create_tables );
void addIngredientWeight( const Weight & );
- void addProperty( const QString &name, const QString &units );
+ void addProperty( const TQString &name, const TQString &units );
void addPropertyToIngredient( int ingredientID, int propertyID, double amount, int perUnitsID );
void addUnitToIngredient( int ingredientID, int unitID );
void categorizeRecipe( int recipeID, const ElementList &categoryList );
void changePropertyAmountToIngredient( int ingredientID, int propertyID, double amount, int per_units );
- void createNewAuthor( const QString &authorName );
- void createNewCategory( const QString &categoryName, int parent_id = -1 );
- void createNewIngGroup( const QString &name );
- void createNewIngredient( const QString &ingredientName );
- void createNewPrepMethod( const QString &prepMethodName );
- void createNewRating( const QString &name );
+ void createNewAuthor( const TQString &authorName );
+ void createNewCategory( const TQString &categoryName, int parent_id = -1 );
+ void createNewIngGroup( const TQString &name );
+ void createNewIngredient( const TQString &ingredientName );
+ void createNewPrepMethod( const TQString &prepMethodName );
+ void createNewRating( const TQString &name );
void createNewUnit( const Unit &unit );
- void createNewYieldType( const QString &type );
+ void createNewYieldType( const TQString &type );
void emptyData( void );
void empty( void );
- int findExistingAuthorByName( const QString& name );
- int findExistingCategoryByName( const QString& name );
- int findExistingIngredientGroupByName( const QString& name );
- int findExistingIngredientByName( const QString& name );
- int findExistingPrepByName( const QString& name );
- int findExistingRecipeByName( const QString& name );
- int findExistingRatingByName( const QString& name );
- int findExistingUnitByName( const QString& name );
- int findExistingPropertyByName( const QString& name );
- int findExistingYieldTypeByName( const QString& name );
+ int findExistingAuthorByName( const TQString& name );
+ int findExistingCategoryByName( const TQString& name );
+ int findExistingIngredientGroupByName( const TQString& name );
+ int findExistingIngredientByName( const TQString& name );
+ int findExistingPrepByName( const TQString& name );
+ int findExistingRecipeByName( const TQString& name );
+ int findExistingRatingByName( const TQString& name );
+ int findExistingUnitByName( const TQString& name );
+ int findExistingPropertyByName( const TQString& name );
+ int findExistingYieldTypeByName( const TQString& name );
void findIngredientUnitDependancies( int ingredientID, int unitID, ElementList *recipes, ElementList *ingredientInfo );
void findIngredientDependancies( int ingredientID, ElementList *recipes );
void findPrepMethodDependancies( int prepMethodID, ElementList *recipes );
@@ -114,7 +114,7 @@ public:
void findUseOfCategoryInRecipes( ElementList *results, int catID );
void findUseOfAuthorInRecipes( ElementList *results, int authorID );
- QString getUniqueRecipeTitle( const QString &recipe_title );
+ TQString getUniqueRecipeTitle( const TQString &recipe_title );
bool ingredientContainsProperty( int ingredientID, int propertyID, int perUnitsID );
bool ingredientContainsUnit( int ingredientID, int unitID );
@@ -128,7 +128,7 @@ public:
void loadPrepMethods( ElementList *list, int limit = -1, int offset = 0 );
void loadProperties( IngredientPropertyList *list, int ingredientID = -2 ); // Loads the list of possible properties by default, all the ingredient properties with -1, and the ingredients of given property if id>=0
void loadRatingCriterion( ElementList *list, int limit = -1, int offset = 0 );
- void loadRecipes( RecipeList *, int items = All, QValueList<int> ids = QValueList<int>() );
+ void loadRecipes( RecipeList *, int items = All, TQValueList<int> ids = TQValueList<int>() );
void loadRecipeList( ElementList *list, int categoryID = -1, bool recursive = false );
void loadUncategorizedRecipes( ElementList *list );
void loadUnits( UnitList *list, Unit::Type = Unit::All, int limit = -1, int offset = 0 );
@@ -143,11 +143,11 @@ public:
void mergePrepMethods( int id1, int id2 );
void mergeProperties( int id1, int id2 );
- void modIngredientGroup( int ingredientID, const QString &newLabel );
+ void modIngredientGroup( int ingredientID, const TQString &newLabel );
/**
* set newLabel for ingredientID
*/
- void modIngredient( int ingredientID, const QString &newLabel );
+ void modIngredient( int ingredientID, const TQString &newLabel );
/**
* set newLabel for unitID
*/
@@ -155,18 +155,18 @@ public:
/**
* set newLabel for categoryID
*/
- void modCategory( int categoryID, const QString &newLabel );
+ void modCategory( int categoryID, const TQString &newLabel );
void modCategory( int categoryID, int new_parent_id );
/**
* set newLabel for authorID
*/
- void modAuthor( int authorID, const QString &newLabel );
+ void modAuthor( int authorID, const TQString &newLabel );
- void modPrepMethod( int prepMethodID, const QString &newLabel );
+ void modPrepMethod( int prepMethodID, const TQString &newLabel );
- void modProperty( int propertyID, const QString &newLabel );
+ void modProperty( int propertyID, const TQString &newLabel );
- QString recipeTitle( int recipeID );
+ TQString recipeTitle( int recipeID );
void removeAuthor( int categoryID );
void removeCategory( int categoryID );
@@ -189,35 +189,35 @@ public:
double ingredientWeight( const Ingredient &ing, bool *wasApproximated = 0 );
WeightList ingredientWeightUnits( int ingID );
- QString escapeAndEncode( const QString &s ) const;
- QString unescapeAndDecode( const QCString &s ) const;
+ TQString escapeAndEncode( const TQString &s ) const;
+ TQString unescapeAndDecode( const TQCString &s ) const;
- QString categoryName( int ID );
- QString prepMethodName( int ID );
- QString ingredientName( int ID );
+ TQString categoryName( int ID );
+ TQString prepMethodName( int ID );
+ TQString ingredientName( int ID );
IngredientProperty propertyName( int ID );
Unit unitName( int ID );
- int getCount( const QString &table_name );
+ int getCount( const TQString &table_name );
int categoryTopLevelCount();
bool checkIntegrity( void );
- void splitCommands( QString& s, QStringList& sl );
+ void splitCommands( TQString& s, TQStringList& sl );
float databaseVersion( void );
protected:
- void execSQL( const QString &command );
+ void execSQL( const TQString &command );
private:
- void loadElementList( ElementList *elList, QSqlQuery *query );
- void loadPropertyElementList( ElementList *elList, QSqlQuery *query );
- QString getNextInsertIDStr( const QString &table, const QString &column );
+ void loadElementList( ElementList *elList, TQSqlQuery *query );
+ void loadPropertyElementList( ElementList *elList, TQSqlQuery *query );
+ TQString getNextInsertIDStr( const TQString &table, const TQString &column );
- QString DBname;
- const QString connectionName;
- QString m_command;
+ TQString DBname;
+ const TQString connectionName;
+ TQString m_command;
static int m_refCount;
};