diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
commit | b6edfe41c9395f2e20784cbf0e630af6426950a3 (patch) | |
tree | 56ed9b871d4296e6c15949c24e16420be1b28697 /kexi/kexidb | |
parent | ef39e8e4178a8f98cf5f154916ba0f03e4855206 (diff) | |
download | koffice-b6edfe41c9395f2e20784cbf0e630af6426950a3.tar.gz koffice-b6edfe41c9395f2e20784cbf0e630af6426950a3.zip |
rename the following methods:
tqfind find
tqreplace replace
tqcontains contains
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/kexidb')
27 files changed, 111 insertions, 111 deletions
diff --git a/kexi/kexidb/alter.cpp b/kexi/kexidb/alter.cpp index 5a84424e1..5386d3d6d 100644 --- a/kexi/kexidb/alter.cpp +++ b/kexi/kexidb/alter.cpp @@ -316,7 +316,7 @@ void AlterTableHandler::ChangeFieldPropertyAction::simplifyActions(ActionDictDic // Case 1. special: name1 -> name2, i.e. rename action TQString newName( newValue().toString() ); // try to find rename(newName, otherName) action - ActionBase *renameActionLikeThis = actionsLikeThis ? actionsLikeThis->tqfind( "name" ) : 0; + ActionBase *renameActionLikeThis = actionsLikeThis ? actionsLikeThis->find( "name" ) : 0; if (dynamic_cast<ChangeFieldPropertyAction*>(renameActionLikeThis)) { // 1. instead of having rename(fieldName(), newValue()) action, // let's have rename(fieldName(), otherName) action @@ -334,7 +334,7 @@ void AlterTableHandler::ChangeFieldPropertyAction::simplifyActions(ActionDictDic adict->insert(m_propertyName.latin1(), newRenameAction);*/ } else { - ActionBase *removeActionForThisField = actionsLikeThis ? actionsLikeThis->tqfind( ":remove:" ) : 0; + ActionBase *removeActionForThisField = actionsLikeThis ? actionsLikeThis->find( ":remove:" ) : 0; if (removeActionForThisField) { //if this field is going to be removed, jsut change the action's field name // and do not add a new action @@ -362,7 +362,7 @@ void AlterTableHandler::ChangeFieldPropertyAction::simplifyActions(ActionDictDic } return; } - ActionBase *removeActionForThisField = actionsLikeThis ? actionsLikeThis->tqfind( ":remove:" ) : 0; + ActionBase *removeActionForThisField = actionsLikeThis ? actionsLikeThis->find( ":remove:" ) : 0; if (removeActionForThisField) { //if this field is going to be removed, do not add a new action return; @@ -372,7 +372,7 @@ void AlterTableHandler::ChangeFieldPropertyAction::simplifyActions(ActionDictDic // becomes: [ setCaption(A, "captionB") ] // because adding this action does nothing ActionDict *nextActionsLikeThis = fieldActions[ uid() ]; //fieldName().latin1() ]; - if (!nextActionsLikeThis || !nextActionsLikeThis->tqfind( m_propertyName.latin1() )) { + if (!nextActionsLikeThis || !nextActionsLikeThis->find( m_propertyName.latin1() )) { //no such action, add this AlterTableHandler::ChangeFieldPropertyAction* newAction = new AlterTableHandler::ChangeFieldPropertyAction( *this ); @@ -608,7 +608,7 @@ void AlterTableHandler::InsertFieldAction::simplifyActions(ActionDictDict &field // Try to find actions related to this action ActionDict *actionsForThisField = fieldActions[ uid() ]; //m_field->name().latin1() ]; - ActionBase *removeActionForThisField = actionsForThisField ? actionsForThisField->tqfind( ":remove:" ) : 0; + ActionBase *removeActionForThisField = actionsForThisField ? actionsForThisField->find( ":remove:" ) : 0; if (removeActionForThisField) { //if this field is going to be removed, do not add a new action //and remove the "Remove" action @@ -1070,7 +1070,7 @@ TableSchema* AlterTableHandler::execute(const TQString& tableName, ExecutionArgu oldTable = 0;*/ // Replace the old table with the new one (oldTable will be destroyed) - if (!d->conn->alterTableName(*newTable, oldTableName, true /*tqreplace*/)) { + if (!d->conn->alterTableName(*newTable, oldTableName, true /*replace*/)) { setError(d->conn); //! @todo delete newTable... args.result = false; diff --git a/kexi/kexidb/connection.cpp b/kexi/kexidb/connection.cpp index 830dee292..4af6cae6d 100644 --- a/kexi/kexidb/connection.cpp +++ b/kexi/kexidb/connection.cpp @@ -361,7 +361,7 @@ bool Connection::drv_databaseExists( const TQString &dbName, bool ignoreErrors ) return false; } - if (list.tqfind( dbName )==list.end()) { + if (list.find( dbName )==list.end()) { if (!ignoreErrors) setError(ERR_OBJECT_NOT_FOUND, i18n("The database \"%1\" does not exist.").tqarg(dbName)); return false; @@ -1784,12 +1784,12 @@ tristate Connection::alterTable( TableSchema& tableSchema, TableSchema& newTable empty = true; #endif if (empty) { - ok = createTable(&newTableSchema, true/*tqreplace*/); + ok = createTable(&newTableSchema, true/*replace*/); } return ok; } -bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newName, bool tqreplace) +bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newName, bool replace) { clearError(); if (&tableSchema!=d->tables[tableSchema.id()]) { @@ -1813,7 +1813,7 @@ bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newNam TableSchema *tableToReplace = this->tableSchema( newName ); const bool destTableExists = tableToReplace != 0; const int origID = destTableExists ? tableToReplace->id() : -1; //will be reused in the new table - if (!tqreplace && destTableExists) { + if (!replace && destTableExists) { setError(ERR_OBJECT_EXISTS, i18n("Could not rename table \"%1\" to \"%2\". Table \"%3\" already exists.") .tqarg(tableSchema.name()).tqarg(newName).tqarg(newName)); @@ -1830,7 +1830,7 @@ bool Connection::alterTableName(TableSchema& tableSchema, const TQString& newNam // drop the table replaced (with schema) if (destTableExists) { - if (!tqreplace) { + if (!replace) { return false; } if (!dropTable( newName )) { @@ -3139,7 +3139,7 @@ inline void updateRowDataWithNewValues(QuerySchema &query, RowData& data, KexiDB columnsOrderExpanded = query.columnsOrder(QuerySchema::ExpandedList); TQMap<QueryColumnInfo*,int>::ConstIterator columnsOrderExpandedIt; for (KexiDB::RowEditBuffer::DBMap::ConstIterator it=b.constBegin();it!=b.constEnd();++it) { - columnsOrderExpandedIt = columnsOrderExpanded.tqfind( it.key() ); + columnsOrderExpandedIt = columnsOrderExpanded.find( it.key() ); if (columnsOrderExpandedIt == columnsOrderExpanded.constEnd()) { KexiDBWarn << "(Connection) updateRowDataWithNewValues(): \"now also assign new value in memory\" step " "- could not find item '" << it.key()->aliasOrName() << "'" << endl; @@ -3268,7 +3268,7 @@ bool Connection::insertRow(QuerySchema &query, RowData& data, RowEditBuffer& buf QueryColumnInfo *ci = fieldsExpanded.at(i); if (ci->field && KexiDB::isDefaultValueAllowed(ci->field) && !ci->field->defaultValue().isNull() - && !b.tqcontains( ci )) + && !b.contains( ci )) { KexiDBDbg << "Connection::insertRow(): adding default value '" << ci->field->defaultValue().toString() << "' for column '" << ci->field->name() << "'" << endl; @@ -3483,7 +3483,7 @@ void Connection::registerForTableSchemaChanges(TableSchemaChangeListenerInterfac d->tableSchemaChangeListeners.insert(&schema, listeners); } //TODO: inefficient - if (listeners->tqfindRef( &listener )==-1) + if (listeners->findRef( &listener )==-1) listeners->append( &listener ); } @@ -3502,7 +3502,7 @@ void Connection::unregisterForTablesSchemaChanges(TableSchemaChangeListenerInter for (TQPtrDictIterator< TQPtrList<TableSchemaChangeListenerInterface> > it(d->tableSchemaChangeListeners); it.current(); ++it) { - if (-1!=it.current()->tqfind(&listener)) + if (-1!=it.current()->find(&listener)) it.current()->take(); } } diff --git a/kexi/kexidb/connection.h b/kexi/kexidb/connection.h index 3d4eb82cb..b06df35b2 100644 --- a/kexi/kexidb/connection.h +++ b/kexi/kexidb/connection.h @@ -566,7 +566,7 @@ class KEXI_DB_EXPORT Connection : public TQObject, public KexiDB::Object -- false is returned and ERR_OBJECT_EXISTS error is set. The schema of \a tableSchema is updated on success. \return true on success. */ - bool alterTableName(TableSchema& tableSchema, const TQString& newName, bool tqreplace = false); + bool alterTableName(TableSchema& tableSchema, const TQString& newName, bool replace = false); /*! Drops a query defined by \a querySchema. If true is returned, schema information \a querySchema is destoyed @@ -894,7 +894,7 @@ class KEXI_DB_EXPORT Connection : public TQObject, public KexiDB::Object /*! For optional reimplemenation: asks server if database \a dbName exists. This method is used internally in databaseExists(). The default implementation - calls databaseNames and checks if that list tqcontains \a dbName. If you need to + calls databaseNames and checks if that list contains \a dbName. If you need to ask the server specifically if a database exists, eg. if you can't retrieve a list of all available database names, please reimplement this method and do all needed checks. diff --git a/kexi/kexidb/driver.cpp b/kexi/kexidb/driver.cpp index d192fe87c..da77ab72c 100644 --- a/kexi/kexidb/driver.cpp +++ b/kexi/kexidb/driver.cpp @@ -237,7 +237,7 @@ bool Driver::isKexiDBSystemObjectName( const TQString& n ) if (!n.lower().startsWith("kexi__")) return false; const TQStringList list( Connection::kexiDBSystemTableNames() ); - return list.tqfind(n.lower())!=list.constEnd(); + return list.find(n.lower())!=list.constEnd(); } bool Driver::isSystemFieldName( const TQString& n ) const @@ -255,7 +255,7 @@ TQString Driver::valueToSQL( uint ftype, const TQVariant& v ) const case Field::Text: case Field::LongText: { TQString s = v.toString(); - return escapeString(s); //TQString("'")+s.tqreplace( '"', "\\\"" ) + "'"; + return escapeString(s); //TQString("'")+s.replace( '"', "\\\"" ) + "'"; } case Field::Byte: case Field::ShortInteger: @@ -267,7 +267,7 @@ TQString Driver::valueToSQL( uint ftype, const TQVariant& v ) const if (v.type()==TQVariant::String) { //workaround for values stored as string that should be casted to floating-point TQString s(v.toString()); - return s.tqreplace(',', "."); + return s.replace(',', "."); } return v.toString(); } @@ -333,21 +333,21 @@ TQCString Driver::escapeIdentifier(const TQCString& str, int options) const needOuterQuotes = true; // ... or if it's a keyword in Kexi's SQL dialect, - else if(d->kexiSQLDict->tqfind(str)) + else if(d->kexiSQLDict->find(str)) needOuterQuotes = true; // ... or if it's a keyword in the backends SQL dialect, // (have already checked !d->driverSQLDict) - else if((options & EscapeDriver) && d->driverSQLDict->tqfind(str)) + else if((options & EscapeDriver) && d->driverSQLDict->find(str)) needOuterQuotes = true; // ... or if the identifier has a space in it... - else if(str.tqfind(' ') != -1) + else if(str.find(' ') != -1) needOuterQuotes = true; if(needOuterQuotes && (options & EscapeKexi)) { const char quote = '"'; - return quote + TQCString(str).tqreplace( quote, "\"\"" ) + quote; + return quote + TQCString(str).replace( quote, "\"\"" ) + quote; } else if (needOuterQuotes) { const char quote = beh->TQUOTATION_MARKS_FOR_IDENTIFIER.latin1(); diff --git a/kexi/kexidb/drivermanager.cpp b/kexi/kexidb/drivermanager.cpp index 1afcbd648..0a7ff5742 100644 --- a/kexi/kexidb/drivermanager.cpp +++ b/kexi/kexidb/drivermanager.cpp @@ -115,7 +115,7 @@ bool DriverManagerInternal::lookupDrivers() << ptr->property("Name").toString() << "\" service!\n -- skipped!" << endl; continue; } - if (m_services_lcase.tqcontains(srv_name.lower())) { + if (m_services_lcase.contains(srv_name.lower())) { KexiDBWarn << "DriverManagerInternal::lookupDrivers(): more than one driver named '" << srv_name.lower() << "'\n -- skipping this one!" << endl; continue; @@ -160,7 +160,7 @@ bool DriverManagerInternal::lookupDrivers() //store association of this driver with all listed mime types for (TQStringList::ConstIterator mime_it = mimes.constBegin(); mime_it!=mimes.constEnd(); ++mime_it) { TQString mime( (*mime_it).lower() ); - if (!m_services_by_mimetype.tqcontains(mime)) { + if (!m_services_by_mimetype.contains(mime)) { m_services_by_mimetype.insert(mime, ptr); } else { @@ -198,16 +198,16 @@ Driver* DriverManagerInternal::driver(const TQString& name) clearError(); KexiDBDbg << "DriverManager::driver(): loading " << name << endl; - Driver *drv = name.isEmpty() ? 0 : m_drivers.tqfind(name.latin1()); + Driver *drv = name.isEmpty() ? 0 : m_drivers.find(name.latin1()); if (drv) return drv; //cached - if (!m_services_lcase.tqcontains(name.lower())) { + if (!m_services_lcase.contains(name.lower())) { setError(ERR_DRIVERMANAGER, i18n("Could not find database driver \"%1\".").tqarg(name) ); return 0; } - KService::Ptr ptr= *(m_services_lcase.tqfind(name.lower())); + KService::Ptr ptr= *(m_services_lcase.find(name.lower())); TQString srv_name = ptr->property("X-Kexi-DriverName").toString(); KexiDBDbg << "KexiDBInterfaceManager::load(): library: "<<ptr->library()<<endl; @@ -357,8 +357,8 @@ KService::Ptr DriverManager::serviceInfo(const TQString &name) } clearError(); - if (d_int->m_services_lcase.tqcontains(name.lower())) { - return *d_int->m_services_lcase.tqfind(name.lower()); + if (d_int->m_services_lcase.contains(name.lower())) { + return *d_int->m_services_lcase.find(name.lower()); } else { setError(ERR_DRIVERMANAGER, i18n("No such driver service: \"%1\".").tqarg(name) ); return KService::Ptr(); diff --git a/kexi/kexidb/drivers/mySQL/mySQL.pro b/kexi/kexidb/drivers/mySQL/mySQL.pro index 6c443be30..5f00a4137 100644 --- a/kexi/kexidb/drivers/mySQL/mySQL.pro +++ b/kexi/kexidb/drivers/mySQL/mySQL.pro @@ -2,11 +2,11 @@ include( ../common.pro ) INCLUDEPATH += $(MYSQL_INC) $(MYSQL_INC)/mysql -tqcontains(CONFIG,debug) { +contains(CONFIG,debug) { win32:LIBS += $(MYSQL_LIB)/debug/libmysql.lib win32:QMAKE_LFLAGS += /NODEFAULTLIB:LIBCMTD.LIB } -!tqcontains(CONFIG,debug) { +!contains(CONFIG,debug) { # win32:LIBS += $(MYSQL_LIB)/opt/mysqlclient.lib win32:LIBS += $(MYSQL_LIB)/opt/libmysql.lib # win32:QMAKE_LFLAGS += /NODEFAULTLIB:MSVCRT.LIB diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp index 50b94ae2a..4a82df509 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp +++ b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp @@ -154,7 +154,7 @@ bool MySqlConnectionInternal::executeSQL(const TQString& statement) { } TQString MySqlConnectionInternal::escapeIdentifier(const TQString& str) const { - return TQString(str).tqreplace('`', "'"); + return TQString(str).replace('`', "'"); } //-------------------------------------- diff --git a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp index 9a1213b0a..4d7db1602 100644 --- a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp +++ b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp @@ -191,9 +191,9 @@ TQCString MySqlDriver::escapeString(const TQCString& str) const //! see http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html return TQCString("'")+TQCString(str) - .tqreplace( '\\', "\\\\" ) - .tqreplace( '\'', "\\''" ) - .tqreplace( '"', "\\\"" ) + .replace( '\\', "\\\\" ) + .replace( '\'', "\\''" ) + .replace( '"', "\\\"" ) + TQCString("'"); } @@ -201,11 +201,11 @@ TQCString MySqlDriver::escapeString(const TQCString& str) const * the name with single quotes. */ TQString MySqlDriver::drv_escapeIdentifier( const TQString& str) const { - return TQString(str).tqreplace('`', "'"); + return TQString(str).replace('`', "'"); } TQCString MySqlDriver::drv_escapeIdentifier( const TQCString& str) const { - return TQCString(str).tqreplace('`', "'"); + return TQCString(str).replace('`', "'"); } #include "mysqldriver.moc" diff --git a/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp b/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp index 3d9162ca5..ce66a6e8e 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp +++ b/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp @@ -150,13 +150,13 @@ TQCString pqxxSqlDriver::escapeString( const TQCString& str) const //================================================================================== // TQString pqxxSqlDriver::drv_escapeIdentifier( const TQString& str) const { - return TQString(str).tqreplace( '"', "\"\"" ); + return TQString(str).replace( '"', "\"\"" ); } //================================================================================== // TQCString pqxxSqlDriver::drv_escapeIdentifier( const TQCString& str) const { - return TQCString(str).tqreplace( '"', "\"\"" ); + return TQCString(str).replace( '"', "\"\"" ); } //================================================================================== diff --git a/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp b/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp index 27f190b8e..631f3bc6c 100644 --- a/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp +++ b/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp @@ -366,14 +366,14 @@ bool SQLiteConnection::isReadOnly() const } #ifdef SQLITE2 -bool SQLiteConnection::drv_alterTableName(TableSchema& tableSchema, const TQString& newName, bool tqreplace) +bool SQLiteConnection::drv_alterTableName(TableSchema& tableSchema, const TQString& newName, bool replace) { const TQString oldTableName = tableSchema.name(); const bool destTableExists = this->tableSchema( newName ) != 0; //1. drop the table if (destTableExists) { - if (!tqreplace) + if (!replace) return false; if (!drv_dropTable( newName )) return false; diff --git a/kexi/kexidb/drivers/sqlite/sqliteconnection.h b/kexi/kexidb/drivers/sqlite/sqliteconnection.h index 922e8447a..ab80675e4 100644 --- a/kexi/kexidb/drivers/sqlite/sqliteconnection.h +++ b/kexi/kexidb/drivers/sqlite/sqliteconnection.h @@ -109,7 +109,7 @@ class SQLiteConnection : public Connection \return true on success. More advanced server backends implement this using "ALTER TABLE .. RENAME TO". */ - virtual bool drv_alterTableName(TableSchema& tableSchema, const TQString& newName, bool tqreplace = false); + virtual bool drv_alterTableName(TableSchema& tableSchema, const TQString& newName, bool replace = false); #endif //! for drv_changeFieldProperty() diff --git a/kexi/kexidb/drivers/sqlite/sqlitedriver.cpp b/kexi/kexidb/drivers/sqlite/sqlitedriver.cpp index c5128b63f..80276682b 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitedriver.cpp +++ b/kexi/kexidb/drivers/sqlite/sqlitedriver.cpp @@ -124,12 +124,12 @@ bool SQLiteDriver::drv_isSystemFieldName( const TQString& n ) const TQString SQLiteDriver::escapeString(const TQString& str) const { - return TQString("'")+TQString(str).tqreplace( '\'', "''" ) + "'"; + return TQString("'")+TQString(str).replace( '\'', "''" ) + "'"; } TQCString SQLiteDriver::escapeString(const TQCString& str) const { - return TQCString("'")+TQCString(str).tqreplace( '\'', "''" )+"'"; + return TQCString("'")+TQCString(str).replace( '\'', "''" )+"'"; } TQString SQLiteDriver::escapeBLOB(const TQByteArray& array) const @@ -139,12 +139,12 @@ TQString SQLiteDriver::escapeBLOB(const TQByteArray& array) const TQString SQLiteDriver::drv_escapeIdentifier( const TQString& str) const { - return TQString(str).tqreplace( '"', "\"\"" ); + return TQString(str).replace( '"', "\"\"" ); } TQCString SQLiteDriver::drv_escapeIdentifier( const TQCString& str) const { - return TQCString(str).tqreplace( '"', "\"\"" ); + return TQCString(str).replace( '"', "\"\"" ); } AdminTools* SQLiteDriver::drv_createAdminTools() const diff --git a/kexi/kexidb/expression.cpp b/kexi/kexidb/expression.cpp index ffa45c9b7..35ab8d70e 100644 --- a/kexi/kexidb/expression.cpp +++ b/kexi/kexidb/expression.cpp @@ -692,7 +692,7 @@ bool VariableExpr::validate(ParseInfo& parseInfo) /* taken from parser's addColumn(): */ KexiDBDbg << "checking variable name: " << name << endl; - int dotPos = name.tqfind('.'); + int dotPos = name.find('.'); TQString tableName, fieldName; //TODO: shall we also support db name? if (dotPos>0) { @@ -910,5 +910,5 @@ bool FunctionExpr::validate(ParseInfo& parseInfo) bool FunctionExpr::isBuiltInAggregate(const TQCString& fname) { - return builtInAggregates().tqfind(fname.upper())!=FunctionExpr_builtIns.end(); + return builtInAggregates().find(fname.upper())!=FunctionExpr_builtIns.end(); } diff --git a/kexi/kexidb/field.cpp b/kexi/kexidb/field.cpp index 97c4ae588..33e9e929a 100644 --- a/kexi/kexidb/field.cpp +++ b/kexi/kexidb/field.cpp @@ -197,7 +197,7 @@ TQString Field::typeGroupString(uint typeGroup) Field::Type Field::typeForString(const TQString& typeString) { m_typeNames.init(); - TQMap<TQString,Type>::ConstIterator it = m_typeNames.str2num.tqfind(typeString.lower()); + TQMap<TQString,Type>::ConstIterator it = m_typeNames.str2num.find(typeString.lower()); if (it==m_typeNames.str2num.end()) return InvalidType; return it.data(); @@ -206,7 +206,7 @@ Field::Type Field::typeForString(const TQString& typeString) Field::TypeGroup Field::typeGroupForString(const TQString& typeGroupString) { m_typeGroupNames.init(); - TQMap<TQString,TypeGroup>::ConstIterator it = m_typeGroupNames.str2num.tqfind(typeGroupString.lower()); + TQMap<TQString,TypeGroup>::ConstIterator it = m_typeGroupNames.str2num.find(typeGroupString.lower()); if (it==m_typeGroupNames.str2num.end()) return InvalidGroup; return it.data(); @@ -646,7 +646,7 @@ TQVariant Field::customProperty(const TQCString& propertyName, { if (!m_customProperties) return defaultValue; - CustomPropertiesMap::ConstIterator it(m_customProperties->tqfind(propertyName)); + CustomPropertiesMap::ConstIterator it(m_customProperties->find(propertyName)); if (it==m_customProperties->constEnd()) return defaultValue; return it.data(); diff --git a/kexi/kexidb/fieldlist.h b/kexi/kexidb/fieldlist.h index f77dba2b4..439a5cc12 100644 --- a/kexi/kexidb/fieldlist.h +++ b/kexi/kexidb/fieldlist.h @@ -79,11 +79,11 @@ class KEXI_DB_EXPORT FieldList virtual Field* field(const TQString& name); /*! \return true if this list contains given \a field. */ - inline bool hasField(const Field* field) { return m_fields.tqfindRef(field)!=-1; } + inline bool hasField(const Field* field) { return m_fields.findRef(field)!=-1; } /*! \return first occurrence of \a field in the list or -1 if this list does not contain this field. */ - inline int indexOf(const Field* field) { return m_fields.tqfindRef(field); } + inline int indexOf(const Field* field) { return m_fields.findRef(field); } /*! \return list of field names for this list. */ TQStringList names() const; diff --git a/kexi/kexidb/indexschema.cpp b/kexi/kexidb/indexschema.cpp index 4775125b8..dc01ae0eb 100644 --- a/kexi/kexidb/indexschema.cpp +++ b/kexi/kexidb/indexschema.cpp @@ -172,18 +172,18 @@ void IndexSchema::attachRelationship(Relationship *rel, bool ownedByMaster) return; if (rel->masterIndex()==this) { if (ownedByMaster) { - if (m_master_owned_rels.tqfindRef(rel)==-1) { + if (m_master_owned_rels.findRef(rel)==-1) { m_master_owned_rels.append(rel); } } else {//not owned - if (m_master_rels.tqfindRef(rel)==-1) { + if (m_master_rels.findRef(rel)==-1) { m_master_rels.append(rel); } } } else if (rel->detailsIndex()==this) { - if (m_details_rels.tqfindRef(rel)==-1) { + if (m_details_rels.findRef(rel)==-1) { m_details_rels.append(rel); } } @@ -193,7 +193,7 @@ void IndexSchema::detachRelationship(Relationship *rel) { if (!rel) return; - m_master_owned_rels.take( m_master_owned_rels.tqfindRef(rel) ); //for sanity - m_master_rels.take( m_master_rels.tqfindRef(rel) ); //for sanity - m_details_rels.take( m_details_rels.tqfindRef(rel) ); //for sanity + m_master_owned_rels.take( m_master_owned_rels.findRef(rel) ); //for sanity + m_master_rels.take( m_master_rels.findRef(rel) ); //for sanity + m_details_rels.take( m_details_rels.findRef(rel) ); //for sanity } diff --git a/kexi/kexidb/parser/parser.cpp b/kexi/kexidb/parser/parser.cpp index eeb6e39dc..2a9a0e4cb 100644 --- a/kexi/kexidb/parser/parser.cpp +++ b/kexi/kexidb/parser/parser.cpp @@ -109,7 +109,7 @@ void Parser::init() bool Parser::isReservedKeyword(const char *str) { - return d->reservedKeywords.tqfind(str); + return d->reservedKeywords.find(str); } bool diff --git a/kexi/kexidb/parser/parser_p.cpp b/kexi/kexidb/parser/parser_p.cpp index f64696e8f..7ed1a47bb 100644 --- a/kexi/kexidb/parser/parser_p.cpp +++ b/kexi/kexidb/parser/parser_p.cpp @@ -202,7 +202,7 @@ bool parseData(Parser *p, const char *data) Field::ListIterator it = parser->select()->fieldsIterator(); for(Field *item; (item = it.current()); ++it) { - if(tableList.tqfindRef(item->table()) == -1) + if(tableList.findRef(item->table()) == -1) { ParserError err(i18n("Field List Error"), i18n("Unknown table '%1' in field list").tqarg(item->table()->name()), ctoken, current); parser->setError(err); @@ -263,7 +263,7 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr ) #if 0 KexiDBDbg << "found variable name: " << varName << endl; - int dotPos = varName.tqfind('.'); + int dotPos = varName.find('.'); TQString tableName, fieldName; //TODO: shall we also support db name? if (dotPos>0) { diff --git a/kexi/kexidb/parser/sqlparser.cpp b/kexi/kexidb/parser/sqlparser.cpp index f4086b3b9..57e386ee4 100644 --- a/kexi/kexidb/parser/sqlparser.cpp +++ b/kexi/kexidb/parser/sqlparser.cpp @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that tqcontains +/* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof diff --git a/kexi/kexidb/parser/sqlparser.h b/kexi/kexidb/parser/sqlparser.h index 6895e29f9..6f2b65344 100644 --- a/kexi/kexidb/parser/sqlparser.h +++ b/kexi/kexidb/parser/sqlparser.h @@ -27,7 +27,7 @@ bool parseData(KexiDB::Parser *p, const char *data); Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* As a special exception, you may create a larger work that tqcontains +/* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof diff --git a/kexi/kexidb/queryschema.cpp b/kexi/kexidb/queryschema.cpp index 4fae1cf12..a82ca99a6 100644 --- a/kexi/kexidb/queryschema.cpp +++ b/kexi/kexidb/queryschema.cpp @@ -187,8 +187,8 @@ class QuerySchemaPrivate void setColumnAliasInternal(uint position, const TQCString& alias) { - columnAliases.tqreplace(position, new TQCString(alias)); - columnPositionsForAliases.tqreplace(alias, new int(position)); + columnAliases.replace(position, new TQCString(alias)); + columnPositionsForAliases.replace(alias, new int(position)); maxIndexWithAlias = TQMAX( maxIndexWithAlias, (int)position ); } @@ -245,7 +245,7 @@ class QuerySchemaPrivate for (Field::ListIterator it(query->fieldsIterator()); (f = it.current()); ++it, p++) { if (f->isExpression() && !columnAliases[p]) { //missing - for (;;) { //tqfind 1st unused + for (;;) { //find 1st unused colNum++; columnAlias = (i18n("short for 'expression' word (only latin letters, please)", "expr") + TQString::number(colNum)).latin1(); @@ -663,12 +663,12 @@ FieldList& QuerySchema::insertField(uint position, Field *field, d->asterisks.append(field); //if this is single-table asterisk, //add a table to list if doesn't exist there: - if (field->table() && (d->tables.tqfindRef(field->table())==-1)) + if (field->table() && (d->tables.findRef(field->table())==-1)) d->tables.append(field->table()); } else if (field->table()) { //add a table to list if doesn't exist there: - if (d->tables.tqfindRef(field->table())==-1) + if (d->tables.findRef(field->table())==-1) d->tables.append(field->table()); } // //visible by default @@ -918,7 +918,7 @@ void QuerySchema::addTable(TableSchema *table, const TQCString& alias) //only append table if: //-it has alias //-it has no alias but there is no such table on the list - if (alias.isEmpty() && d->tables.tqfindRef(table)!=-1) { + if (alias.isEmpty() && d->tables.findRef(table)!=-1) { const TQString& tableNameLower = table->name().lower(); const TQString& aliasLower = TQString(alias.lower()); int num = 0; @@ -960,9 +960,9 @@ TableSchema* QuerySchema::table(const TQString& tableName) const return 0; } -bool QuerySchema::tqcontains(TableSchema *table) const +bool QuerySchema::contains(TableSchema *table) const { - return d->tables.tqfindRef(table)!=-1; + return d->tables.findRef(table)!=-1; } Field* QuerySchema::findTableField(const TQString &tableOrTableAndFieldName) const @@ -1080,8 +1080,8 @@ void QuerySchema::setTableAlias(uint position, const TQCString& alias) // d->maxIndexWithTableAlias = -1; } else { - d->tableAliases.tqreplace(position, new TQCString(fixedAlias)); - d->tablePositionsForAliases.tqreplace(fixedAlias, new int(position)); + d->tableAliases.replace(position, new TQCString(fixedAlias)); + d->tablePositionsForAliases.replace(fixedAlias, new int(position)); // d->maxIndexWithTableAlias = TQMAX( d->maxIndexWithTableAlias, (int)index ); } } @@ -1164,7 +1164,7 @@ QueryColumnInfo::Vector QuerySchema::fieldsExpanded(FieldsExpandedOptions option uint uniqueListCount = 0; for (uint i=0; i<d->fieldsExpanded->count(); i++) { QueryColumnInfo *ci = (*d->fieldsExpanded)[i]; -// columnsAlreadyFoundIt = columnsAlreadyFound.tqfind(ci); +// columnsAlreadyFoundIt = columnsAlreadyFound.find(ci); // uint foundColumnIndex = -1; if (!columnsAlreadyFound[ci->aliasOrName()]) {// columnsAlreadyFoundIt==columnsAlreadyFound.constEnd()) columnsAlreadyFound.insert(ci->aliasOrName(), (char*)1); @@ -1412,7 +1412,7 @@ void QuerySchema::computeFieldsExpanded() if (!d->columnInfosByNameExpanded[ tableAndAlias ]) d->columnInfosByNameExpanded.insert( tableAndAlias, ci ); //the same for "unexpanded" list - if (columnInfosOutsideAsterisks.tqcontains(ci)) { + if (columnInfosOutsideAsterisks.contains(ci)) { if (!d->columnInfosByName[ ci->alias ]) d->columnInfosByName.insert( ci->alias, ci ); if (!d->columnInfosByName[ tableAndAlias ]) @@ -1429,7 +1429,7 @@ void QuerySchema::computeFieldsExpanded() if (!d->columnInfosByNameExpanded[ tableAndName ]) d->columnInfosByNameExpanded.insert( tableAndName, ci ); //the same for "unexpanded" list - if (columnInfosOutsideAsterisks.tqcontains(ci)) { + if (columnInfosOutsideAsterisks.contains(ci)) { if (!d->columnInfosByName[ ci->field->name() ]) d->columnInfosByName.insert( ci->field->name(), ci ); if (!d->columnInfosByName[ tableAndName ]) @@ -1453,7 +1453,7 @@ void QuerySchema::computeFieldsExpanded() lookup_list.removeRef( ci ); } else { - lookup_dict.tqreplace( key, new uint( i ) ); + lookup_dict.replace( key, new uint( i ) ); ++it; i++; } diff --git a/kexi/kexidb/queryschema.h b/kexi/kexidb/queryschema.h index 7c6821d16..6681ddd35 100644 --- a/kexi/kexidb/queryschema.h +++ b/kexi/kexidb/queryschema.h @@ -364,7 +364,7 @@ class KEXI_DB_EXPORT QuerySchema : public FieldList, public SchemaData TableSchema* table(const TQString& tableName) const; /*! \return true if the query uses \a table. */ - bool tqcontains(TableSchema *table) const; + bool contains(TableSchema *table) const; /*! Convenience function. \return table field by searching through all tables in this query. diff --git a/kexi/kexidb/relationship.cpp b/kexi/kexidb/relationship.cpp index bcb6ec898..a7796207b 100644 --- a/kexi/kexidb/relationship.cpp +++ b/kexi/kexidb/relationship.cpp @@ -80,7 +80,7 @@ void Relationship::createIndices( QuerySchema *query, Field *field1, Field *fiel return; } // if (!query->hasField(field1) && !query->hasField(field2)) { - if (!query->tqcontains(field1->table()) || !query->tqcontains(field2->table())) { + if (!query->contains(field1->table()) || !query->contains(field2->table())) { KexiDBWarn << "Relationship::addRelationship(): fields do not belong to this query" << endl; return; } diff --git a/kexi/kexidb/roweditbuffer.cpp b/kexi/kexidb/roweditbuffer.cpp index ba1bb7d58..40d2b04dd 100644 --- a/kexi/kexidb/roweditbuffer.cpp +++ b/kexi/kexidb/roweditbuffer.cpp @@ -50,7 +50,7 @@ const TQVariant* RowEditBuffer::at( QueryColumnInfo& ci, bool useDefaultValueIfP KexiDBWarn << "RowEditBuffer::at(QueryColumnInfo&): not db-aware buffer!" << endl; return 0; } - *m_dbBufferIt = m_dbBuffer->tqfind( &ci ); + *m_dbBufferIt = m_dbBuffer->find( &ci ); TQVariant* result = 0; if (*m_dbBufferIt!=m_dbBuffer->end()) result = &(*m_dbBufferIt).data(); @@ -74,7 +74,7 @@ const TQVariant* RowEditBuffer::at( Field& f ) const KexiDBWarn << "RowEditBuffer::at(Field&): this is db-aware buffer!" << endl; return 0; } - *m_simpleBufferIt = m_simpleBuffer->tqfind( f.name() ); + *m_simpleBufferIt = m_simpleBuffer->find( f.name() ); if (*m_simpleBufferIt==m_simpleBuffer->constEnd()) return 0; return &(*m_simpleBufferIt).data(); @@ -86,7 +86,7 @@ const TQVariant* RowEditBuffer::at( const TQString& fname ) const KexiDBWarn << "RowEditBuffer::at(Field&): this is db-aware buffer!" << endl; return 0; } - *m_simpleBufferIt = m_simpleBuffer->tqfind( fname ); + *m_simpleBufferIt = m_simpleBuffer->find( fname ); if (*m_simpleBufferIt==m_simpleBuffer->constEnd()) return 0; return &(*m_simpleBufferIt).data(); diff --git a/kexi/kexidb/roweditbuffer.h b/kexi/kexidb/roweditbuffer.h index 438e525eb..568d5dafb 100644 --- a/kexi/kexidb/roweditbuffer.h +++ b/kexi/kexidb/roweditbuffer.h @@ -113,7 +113,7 @@ public: //! Useful only for db-aware buffer: \return true if the value available as //! at( ci ) is obtained from column's default value inline bool hasDefaultValueAt( QueryColumnInfo& ci ) const { - return m_defaultValuesDbBuffer->tqcontains(&ci) && (*m_defaultValuesDbBuffer)[ &ci ]; + return m_defaultValuesDbBuffer->contains(&ci) && (*m_defaultValuesDbBuffer)[ &ci ]; } inline const SimpleMap simpleBuffer() { return *m_simpleBuffer; } diff --git a/kexi/kexidb/tableschema.cpp b/kexi/kexidb/tableschema.cpp index b794f2730..d78efa090 100644 --- a/kexi/kexidb/tableschema.cpp +++ b/kexi/kexidb/tableschema.cpp @@ -374,7 +374,7 @@ Field* TableSchema::anyNonPKField() if (!d->anyNonPKField) { Field *f; Field::ListIterator it(m_fields); - it.toLast(); //from the end (higher chances to tqfind) + it.toLast(); //from the end (higher chances to find) for (; (f = it.current()); --it) { if (!f->isPrimaryKey() && (!m_pkey || !m_pkey->hasField(f))) break; @@ -393,7 +393,7 @@ bool TableSchema::setLookupFieldSchema( const TQString& fieldName, LookupFieldSc return false; } if (lookupFieldSchema) - d->lookupFields.tqreplace( f, lookupFieldSchema ); + d->lookupFields.replace( f, lookupFieldSchema ); else { delete d->lookupFields[f]; d->lookupFields.remove( f ); @@ -426,7 +426,7 @@ const TQPtrVector<LookupFieldSchema>& TableSchema::lookupFieldsList() d->lookupFieldsList.resize( d->lookupFields.count() ); uint i = 0; for (Field::ListIterator it(m_fields); it.current(); ++it) { - TQMap<const Field*, LookupFieldSchema*>::ConstIterator itMap = d->lookupFields.tqfind( it.current() ); + TQMap<const Field*, LookupFieldSchema*>::ConstIterator itMap = d->lookupFields.find( it.current() ); if (itMap != d->lookupFields.constEnd()) { d->lookupFieldsList.insert( i, itMap.data() ); i++; diff --git a/kexi/kexidb/utils.cpp b/kexi/kexidb/utils.cpp index 36267b1fa..d3d1361c0 100644 --- a/kexi/kexidb/utils.cpp +++ b/kexi/kexidb/utils.cpp @@ -59,7 +59,7 @@ static void initList() const uint tg = KexiDB::Field::typeGroup( t ); TypeGroupList list; TQStringList name_list, str_list; - if (KexiDB_typeCache->tlist.tqfind( tg )!=KexiDB_typeCache->tlist.end()) { + if (KexiDB_typeCache->tlist.find( tg )!=KexiDB_typeCache->tlist.end()) { list = KexiDB_typeCache->tlist[ tg ]; name_list = KexiDB_typeCache->nlist[ tg ]; str_list = KexiDB_typeCache->slist[ tg ]; @@ -584,7 +584,7 @@ bool KexiDB::splitToTableAndFieldParts(const TQString& string, TQString& tableName, TQString& fieldName, SplitToTableAndFieldPartsOptions option) { - const int id = string.tqfind('.'); + const int id = string.find('.'); if (option & SetFieldNameIfNoTableName && id==-1) { tableName = TQString(); fieldName = string; @@ -613,7 +613,7 @@ TQString KexiDB::formatNumberForVisibleDecimalPlaces(double value, int decimalPl i--; if (s[i]=='.') //remove '.' i--; - s = s.left(i+1).tqreplace('.', KGlobal::locale()->decimalSymbol()); + s = s.left(i+1).replace('.', KGlobal::locale()->decimalSymbol()); return s; } if (decimalPlaces == 0) @@ -671,13 +671,13 @@ bool KexiDB::isBuiltinTableFieldProperty( const TQCString& propertyName ) //! @todo always update this when new builtins appear! #undef ADD } - return KexiDB_builtinFieldProperties->tqfind( propertyName ); + return KexiDB_builtinFieldProperties->find( propertyName ); } bool KexiDB::setFieldProperties( Field& field, const TQMap<TQCString, TQVariant>& values ) { TQMapConstIterator<TQCString, TQVariant> it; - if ( (it = values.tqfind("type")) != values.constEnd() ) { + if ( (it = values.find("type")) != values.constEnd() ) { if (!setIntToFieldType(field, *it)) return false; } @@ -690,50 +690,50 @@ bool KexiDB::setFieldProperties( Field& field, const TQMap<TQCString, TQVariant> uint constraints = field.constraints(); bool ok = true; - if ( (it = values.tqfind("primaryKey")) != values.constEnd() ) + if ( (it = values.find("primaryKey")) != values.constEnd() ) SET_BOOLEAN_FLAG(PrimaryKey, (*it).toBool()); - if ( (it = values.tqfind("indexed")) != values.constEnd() ) + if ( (it = values.find("indexed")) != values.constEnd() ) SET_BOOLEAN_FLAG(Indexed, (*it).toBool()); - if ( (it = values.tqfind("autoIncrement")) != values.constEnd() + if ( (it = values.find("autoIncrement")) != values.constEnd() && KexiDB::Field::isAutoIncrementAllowed(field.type()) ) SET_BOOLEAN_FLAG(AutoInc, (*it).toBool()); - if ( (it = values.tqfind("unique")) != values.constEnd() ) + if ( (it = values.find("unique")) != values.constEnd() ) SET_BOOLEAN_FLAG(Unique, (*it).toBool()); - if ( (it = values.tqfind("notNull")) != values.constEnd() ) + if ( (it = values.find("notNull")) != values.constEnd() ) SET_BOOLEAN_FLAG(NotNull, (*it).toBool()); - if ( (it = values.tqfind("allowEmpty")) != values.constEnd() ) + if ( (it = values.find("allowEmpty")) != values.constEnd() ) SET_BOOLEAN_FLAG(NotEmpty, !(*it).toBool()); field.setConstraints( constraints ); uint options = 0; - if ( (it = values.tqfind("unsigned")) != values.constEnd()) { + if ( (it = values.find("unsigned")) != values.constEnd()) { options |= KexiDB::Field::Unsigned; if (!(*it).toBool()) options ^= KexiDB::Field::Unsigned; } field.setOptions( options ); - if ( (it = values.tqfind("name")) != values.constEnd()) + if ( (it = values.find("name")) != values.constEnd()) field.setName( (*it).toString() ); - if ( (it = values.tqfind("caption")) != values.constEnd()) + if ( (it = values.find("caption")) != values.constEnd()) field.setCaption( (*it).toString() ); - if ( (it = values.tqfind("description")) != values.constEnd()) + if ( (it = values.find("description")) != values.constEnd()) field.setDescription( (*it).toString() ); - if ( (it = values.tqfind("length")) != values.constEnd()) + if ( (it = values.find("length")) != values.constEnd()) field.setLength( (*it).isNull() ? 0/*default*/ : (*it).toUInt(&ok) ); if (!ok) return false; - if ( (it = values.tqfind("precision")) != values.constEnd()) + if ( (it = values.find("precision")) != values.constEnd()) field.setPrecision( (*it).isNull() ? 0/*default*/ : (*it).toUInt(&ok) ); if (!ok) return false; - if ( (it = values.tqfind("defaultValue")) != values.constEnd()) + if ( (it = values.find("defaultValue")) != values.constEnd()) field.setDefaultValue( *it ); - if ( (it = values.tqfind("width")) != values.constEnd()) + if ( (it = values.find("width")) != values.constEnd()) field.setWidth( (*it).isNull() ? 0/*default*/ : (*it).toUInt(&ok) ); if (!ok) return false; - if ( (it = values.tqfind("visibleDecimalPlaces")) != values.constEnd() + if ( (it = values.find("visibleDecimalPlaces")) != values.constEnd() && KexiDB::supportsVisibleDecimalPlacesProperty(field.type()) ) field.setVisibleDecimalPlaces( (*it).isNull() ? -1/*default*/ : (*it).toInt(&ok) ); if (!ok) @@ -773,7 +773,7 @@ bool KexiDB::isExtendedTableFieldProperty( const TQCString& propertyName ) ADD("displayWidget"); #undef ADD } - return KexiDB_extendedProperties->tqfind( propertyName ); + return KexiDB_extendedProperties->find( propertyName ); } bool KexiDB::setFieldProperty( Field& field, const TQCString& propertyName, const TQVariant& value ) @@ -924,7 +924,7 @@ TQVariant KexiDB::loadPropertyValueFromDom( const TQDomNode& node ) return TQCString(text.latin1()); } else if (valueType == "number") { // integer or double - if (text.tqfind('.')!=-1) { + if (text.find('.')!=-1) { double val = text.toDouble(&ok); if (ok) return val; |