diff options
Diffstat (limited to 'kaddressbook/xxport/gnokii_xxport.cpp')
-rw-r--r-- | kaddressbook/xxport/gnokii_xxport.cpp | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/kaddressbook/xxport/gnokii_xxport.cpp b/kaddressbook/xxport/gnokii_xxport.cpp index 60675384c..c6bd0917d 100644 --- a/kaddressbook/xxport/gnokii_xxport.cpp +++ b/kaddressbook/xxport/gnokii_xxport.cpp @@ -43,7 +43,7 @@ extern "C" { #endif #endif -#include <qcursor.h> +#include <tqcursor.h> #include <kdebug.h> #include <klocale.h> @@ -63,12 +63,12 @@ extern "C" { #define GNOKII_CHECK_ERROR(error) \ do { \ if (error) \ - kdError() << QString("ERROR %1: %2\n").arg(error).arg(gn_error_print(error));\ + kdError() << TQString("ERROR %1: %2\n").arg(error).arg(gn_error_print(error));\ } while (0) // Locale conversion routines: // Gnokii uses the local 8 Bit encoding (based on LC_ALL), kaddressbook uses Unicode -#define GN_FROM(x) QString::fromLocal8Bit(x) +#define GN_FROM(x) TQString::fromLocal8Bit(x) #define GN_TO(x) (x).local8Bit() // static variables for GUI updates @@ -77,7 +77,7 @@ static KProgressDialog *m_progressDlg; K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_gnokii_xxport, GNOKIIXXPort ) -GNOKIIXXPort::GNOKIIXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +GNOKIIXXPort::GNOKIIXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { this_filter = this; @@ -88,11 +88,11 @@ GNOKIIXXPort::GNOKIIXXPort( KABC::AddressBook *ab, QWidget *parent, const char * #ifdef HAVE_GNOKII_H -static QString makeValidPhone( const QString &number ) +static TQString makeValidPhone( const TQString &number ) { // allowed chars: 0-9, *, #, p, w, + - QString num = number.simplifyWhiteSpace(); - QString allowed("0123456789*+#pw"); + TQString num = number.simplifyWhiteSpace(); + TQString allowed("0123456789*+#pw"); for (unsigned int i=num.length(); i>=1; i--) if (allowed.find(num[i-1])==-1) num.remove(i-1,1); @@ -122,12 +122,12 @@ static void busterminate(void) gn_lib_library_free(); } -static QString businit(void) +static TQString businit(void) { GNOKII_DEBUG( "Using new gnokii version." ); - GNOKII_DEBUG( QString("Compiled with libgnokii version 0x%1\n").arg(QString::number(LIBGNOKII_VERSION,16)) ); - GNOKII_DEBUG( QString("Using libgnokii runtime version 0x%1\n").arg(QString::number(gn_lib_version(),16)) ); + GNOKII_DEBUG( TQString("Compiled with libgnokii version 0x%1\n").arg(TQString::number(LIBGNOKII_VERSION,16)) ); + GNOKII_DEBUG( TQString("Using libgnokii runtime version 0x%1\n").arg(TQString::number(gn_lib_version(),16)) ); gn_error error = gn_lib_phoneprofile_load(NULL, &state); if (error) @@ -151,10 +151,10 @@ static QString businit(void) revision = gn_lib_get_phone_revision(state); imei = gn_lib_get_phone_imei(state); - GNOKII_DEBUG( QString("Found mobile phone: %1 %2, Revision: %3, IMEI: %4\n") + GNOKII_DEBUG( TQString("Found mobile phone: %1 %2, Revision: %3, IMEI: %4\n") .arg(manufacturer, model, revision, imei) ); - return QString::null; + return TQString::null; } @@ -165,17 +165,17 @@ static gn_error read_phone_memstat( const gn_memory_type memtype, gn_memory_stat error = gn_lib_addressbook_memstat(state, memtype, &memstat->used, &memstat->free); - GNOKII_DEBUG( QString("\n\nMobile phone memory status: Type: %1, used=%2, free=%3, total=%4\n\n") + GNOKII_DEBUG( TQString("\n\nMobile phone memory status: Type: %1, used=%2, free=%3, total=%4\n\n") .arg(memtype).arg(memstat->used).arg(memstat->free).arg(memstat->used+memstat->free) ); return error; } -static QString buildPhoneInfoString( const gn_memory_status &memstat ) +static TQString buildPhoneInfoString( const gn_memory_status &memstat ) { - QString format = QString::fromLatin1("<tr><td><b>%1</b></td><td>%2</td></tr>"); + TQString format = TQString::fromLatin1("<tr><td><b>%1</b></td><td>%2</td></tr>"); - return QString::fromLatin1("<b>%1</b><br><table>%2%3%4%5%6</table><br>") + return TQString::fromLatin1("<b>%1</b><br><table>%2%3%4%5%6</table><br>") .arg(i18n("Mobile Phone information:")) .arg(format.arg(i18n("Manufacturer")).arg(GN_FROM(manufacturer))) .arg(format.arg(i18n("Phone model")).arg(GN_FROM(model))) @@ -203,9 +203,9 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty gn_memory_status memstat; error = read_phone_memstat(memtype, &memstat); - QStringList addrlist; + TQStringList addrlist; KABC::Address *addr; - QString s, country; + TQString s, country; progress->setTotalSteps(memstat.used); m_progressDlg->setLabel(i18n("<qt>Importing <b>%1</b> contacts from <b>%2</b> of the Mobile Phone.<br><br>%3</qt>") @@ -233,7 +233,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty const char *name = gn_lib_get_pb_name(state); const char *number = gn_lib_get_pb_number(state); - GNOKII_DEBUG(QString("%1: %2, num=%3, location=%4, group=%5, count=%6\n").arg(i) + GNOKII_DEBUG(TQString("%1: %2, num=%3, location=%4, group=%5, count=%6\n").arg(i) .arg(GN_FROM(name)).arg(GN_FROM(number)) .arg(gn_lib_get_pb_location(state)).arg(gn_lib_get_pb_caller_group(state)) .arg(subentries_count)); @@ -244,7 +244,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->setFormattedName(s); // set formatted name as in Phone if (s.find(',') == -1) { // assumed format: "givenname [... familyname]" - addrlist = QStringList::split(' ', s); + addrlist = TQStringList::split(' ', s); if (addrlist.count() == 1) { // only one string -> put it in the GivenName a->setGivenName(s); @@ -256,27 +256,27 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty } } else { // assumed format: "familyname, ... givenname" - addrlist = QStringList::split(',', s); + addrlist = TQStringList::split(',', s); a->setFamilyName(addrlist.first().simplifyWhiteSpace()); addrlist.remove(addrlist.first()); a->setGivenName(addrlist.join(" ").simplifyWhiteSpace()); } a->insertCustom(APP, "X_GSM_CALLERGROUP", s.setNum(gn_lib_get_pb_caller_group(state))); - a->insertCustom(APP, "X_GSM_STORE_AT", QString("%1%2").arg(memtypestr).arg(gn_lib_get_pb_location(state))); + a->insertCustom(APP, "X_GSM_STORE_AT", TQString("%1%2").arg(memtypestr).arg(gn_lib_get_pb_location(state))); // set ProductId - a->setProductId(QString("%1-%2-%3-%4").arg(APP).arg(model).arg(revision).arg(imei)); + a->setProductId(TQString("%1-%2-%3-%4").arg(APP).arg(model).arg(revision).arg(imei)); // evaluate timestamp (ignore timezone) - QDateTime datetime; + TQDateTime datetime; gn_timestamp ts = gn_lib_get_pb_date(state); if (ts.year<1998) - datetime = QDateTime::currentDateTime(); + datetime = TQDateTime::currentDateTime(); else - datetime = QDateTime( QDate(ts.year, ts.month, ts.day), - QTime(ts.hour, ts.minute, ts.second) ); - GNOKII_DEBUG(QString(" date=%1\n").arg(datetime.toString())); + datetime = TQDateTime( TQDate(ts.year, ts.month, ts.day), + TQTime(ts.hour, ts.minute, ts.second) ); + GNOKII_DEBUG(TQString(" date=%1\n").arg(datetime.toString())); a->setRevision(datetime); if (!subentries_count) @@ -293,8 +293,8 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty error = gn_lib_get_pb_subentry(state, n, &entry_type, &number_type, &number); GNOKII_CHECK_ERROR(error); - QString s = GN_FROM(number).simplifyWhiteSpace(); - GNOKII_DEBUG(QString(" Subentry#%1, entry_type=%2, number_type=%3, number=%4\n") + TQString s = GN_FROM(number).simplifyWhiteSpace(); + GNOKII_DEBUG(TQString(" Subentry#%1, entry_type=%2, number_type=%3, number=%4\n") .arg(n).arg(entry_type).arg(number_type).arg(s)); if (s.isEmpty()) continue; @@ -306,10 +306,10 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->insertEmail(s); break; case GN_PHONEBOOK_ENTRY_Postal: - addrlist = QStringList::split(';', s, true); + addrlist = TQStringList::split(';', s, true); addr = new KABC::Address(KABC::Address::Work); if (addrlist.count() <= 1) { - addrlist = QStringList::split(',', s, true); + addrlist = TQStringList::split(',', s, true); if (addrlist.count() > 1 ) { // assumed format: "Locality, ZIP, Country" addr->setLocality(addrlist[0]); @@ -361,7 +361,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->insertCategory(s); break; default: - GNOKII_DEBUG(QString(" Not handled id=%1, entry=%2\n") + GNOKII_DEBUG(TQString(" Not handled id=%1, entry=%2\n") .arg(entry_type).arg(s)); break; } // switch() @@ -390,7 +390,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type memtype, const KABC::Addressee *addr) { - QString s; + TQString s; /* initialize the phonebook entry values to zero */ gn_lib_phonebook_prepare_write_entry(state); @@ -410,22 +410,22 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem s = makeValidPhone(s); gn_lib_set_pb_number(state, s.ascii()); gn_lib_set_pb_memtype(state, memtype); - QString cg = addr->custom(APP, "X_GSM_CALLERGROUP"); + TQString cg = addr->custom(APP, "X_GSM_CALLERGROUP"); if (cg.isEmpty()) gn_lib_set_pb_caller_group(state, GN_PHONEBOOK_GROUP_None); // default group else gn_lib_set_pb_caller_group(state, (gn_phonebook_group_type) cg.toInt()); // set date/revision - QDateTime datetime = addr->revision(); - QDate date(datetime.date()); - QTime time(datetime.time()); + TQDateTime datetime = addr->revision(); + TQDate date(datetime.date()); + TQTime time(datetime.time()); gn_timestamp ts; gn_timestamp_set( &ts, date.year(), date.month(), date.day(), time.hour(), time.minute(), time.second(), 0 ); gn_lib_set_pb_date(state, ts); - GNOKII_DEBUG(QString("Write #%1: name=%2, number=%3\n").arg(phone_location) + GNOKII_DEBUG(TQString("Write #%1: name=%2, number=%3\n").arg(phone_location) .arg(GN_FROM(gn_lib_get_pb_name(state))).arg(GN_FROM(gn_lib_get_pb_number(state)))); const KABC::Address homeAddr = addr->address(KABC::Address::Home); @@ -460,13 +460,13 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem GN_PHONEBOOK_ENTRY_URL, GN_PHONEBOOK_NUMBER_General, GN_TO(s)); } // add E-Mails - QStringList emails = addr->emails(); + TQStringList emails = addr->emails(); for (unsigned int n=0; n<emails.count(); n++) { s = emails[n].simplifyWhiteSpace(); if (s.isEmpty()) continue; // only one email allowed if we have URLS, notes, addresses (to avoid phone limitations) if (n && !addr->url().isEmpty() && !addr->note().isEmpty() && addr->addresses().count()) { - GNOKII_DEBUG(QString(" DROPPED email %1 in favor of URLs, notes and addresses.\n") + GNOKII_DEBUG(TQString(" DROPPED email %1 in favor of URLs, notes and addresses.\n") .arg(s)); continue; } @@ -479,9 +479,9 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem for ( it2 = addresses.begin(); it2 != addresses.end(); ++it2 ) { const KABC::Address *Addr = &(*it2); if (Addr->isEmpty()) continue; - QStringList a; - QChar sem(';'); - QString sem_repl(QString::fromLatin1(",")); + TQStringList a; + TQChar sem(';'); + TQString sem_repl(TQString::fromLatin1(",")); a.append( Addr->postOfficeBox().replace( sem, sem_repl ) ); a.append( Addr->extended() .replace( sem, sem_repl ) ); a.append( Addr->street() .replace( sem, sem_repl ) ); @@ -506,7 +506,7 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem gn_phonebook_number_type number_type; const char *number; gn_lib_get_pb_subentry(state, st, &entry_type, &number_type, &number); - GNOKII_DEBUG(QString(" SubTel #%1: entry_type=%2, number_type=%3, number=%4\n") + GNOKII_DEBUG(TQString(" SubTel #%1: entry_type=%2, number_type=%3, number=%4\n") .arg(st).arg(entry_type) .arg(number_type).arg(GN_FROM(number))); } @@ -524,7 +524,7 @@ static gn_error xxport_phone_delete_entry( int phone_location, gn_memory_type me } -KABC::AddresseeList GNOKIIXXPort::importContacts( const QString& ) const +KABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const { KABC::AddresseeList addrList; @@ -544,14 +544,14 @@ KABC::AddresseeList GNOKIIXXPort::importContacts( const QString& ) const m_progressDlg->progressBar()->setProgress(0); m_progressDlg->progressBar()->setCenterIndicator(true); m_progressDlg->setModal(true); - m_progressDlg->setInitialSize(QSize(450,350)); + m_progressDlg->setInitialSize(TQSize(450,350)); m_progressDlg->show(); processEvents(); #if (QT_VERSION >= 0x030300) m_progressDlg->setCursor( Qt::BusyCursor ); #endif - QString errStr = businit(); + TQString errStr = businit(); m_progressDlg->unsetCursor(); if (!errStr.isEmpty()) { @@ -575,7 +575,7 @@ KABC::AddresseeList GNOKIIXXPort::importContacts( const QString& ) const } -bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const QString & ) +bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQString & ) { if (KMessageBox::Continue != KMessageBox::warningContinueCancel(parentWidget(), i18n("<qt>Please connect your Mobile Phone to your computer and press " @@ -593,14 +593,14 @@ bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const QStrin m_progressDlg->progressBar()->setProgress(0); m_progressDlg->progressBar()->setCenterIndicator(true); m_progressDlg->setModal(true); - m_progressDlg->setInitialSize(QSize(450,350)); + m_progressDlg->setInitialSize(TQSize(450,350)); m_progressDlg->show(); processEvents(); KProgress* progress = (KProgress*)m_progressDlg->progressBar(); KABC::AddresseeList::ConstIterator it; - QStringList failedList; + TQStringList failedList; gn_error error; bool deleteLabelInitialized = false; @@ -608,7 +608,7 @@ bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const QStrin #if (QT_VERSION >= 0x030300) m_progressDlg->setCursor( Qt::BusyCursor ); #endif - QString errStr = businit(); + TQString errStr = businit(); m_progressDlg->unsetCursor(); if (!errStr.isEmpty()) { @@ -685,7 +685,7 @@ try_next_phone_entry: if (phone_entry_no > (memstat.used + memstat.free)) break; - GNOKII_DEBUG(QString("Try to write entry '%1' at phone_entry_no=%2, phone_count=%3\n") + GNOKII_DEBUG(TQString("Try to write entry '%1' at phone_entry_no=%2, phone_count=%3\n") .arg(addr->realName()).arg(phone_entry_no).arg(phone_count)); error = GN_ERR_NONE; @@ -759,7 +759,7 @@ finish: delete m_progressDlg; if (!failedList.isEmpty()) { - GNOKII_DEBUG(QString("Failed to export: %1\n").arg(failedList.join(", "))); + GNOKII_DEBUG(TQString("Failed to export: %1\n").arg(failedList.join(", "))); KMessageBox::informationList(parentWidget(), i18n("<qt>The following contacts could not be exported to the Mobile Phone. " "Possible Reasons for this problem could be:<br><ul>" @@ -797,7 +797,7 @@ finish: static char *lockfile = NULL; static char manufacturer[64], model[GN_MODEL_MAX_LENGTH+1], revision[GN_REVISION_MAX_LENGTH+1], imei[GN_IMEI_MAX_LENGTH+1]; -static QString PhoneProductId; +static TQString PhoneProductId; static struct gn_statemachine state; static gn_data data; @@ -808,7 +808,7 @@ static void busterminate(void) if (lockfile) gn_device_unlock(lockfile); } -static QString businit(void) +static TQString businit(void) { gn_error error; char *aux; @@ -865,24 +865,24 @@ static QString businit(void) data.revision = revision; data.imei = imei; - QCString unknown(GN_TO(i18n("Unknown"))); + TQCString unknown(GN_TO(i18n("Unknown"))); qstrncpy(manufacturer, unknown, sizeof(manufacturer)-1); qstrncpy(model, unknown, sizeof(model)-1); qstrncpy(revision, unknown, sizeof(revision)-1); qstrncpy(imei, unknown, sizeof(imei)-1); if (m_progressDlg->wasCancelled()) - return QString::null; + return TQString::null; else error = gn_sm_functions(GN_OP_Identify, &data, &state); GNOKII_CHECK_ERROR(error); - GNOKII_DEBUG( QString("Found mobile phone: %1 %2, Revision: %3, IMEI: %4\n") + GNOKII_DEBUG( TQString("Found mobile phone: %1 %2, Revision: %3, IMEI: %4\n") .arg(manufacturer, model, revision, imei) ); - PhoneProductId = QString("%1-%2-%3-%4").arg(APP).arg(model).arg(revision).arg(imei); + PhoneProductId = TQString("%1-%2-%3-%4").arg(APP).arg(model).arg(revision).arg(imei); - return QString::null; + return TQString::null; } @@ -911,7 +911,7 @@ static gn_error read_phone_memstat( const gn_memory_type memtype, gn_memory_stat break; } } - GNOKII_DEBUG( QString("\n\nMobile phone memory status: Type: %1, used=%2, free=%3, total=%4\n\n") + GNOKII_DEBUG( TQString("\n\nMobile phone memory status: Type: %1, used=%2, free=%3, total=%4\n\n") .arg(memtype).arg(memstat->used).arg(memstat->free).arg(memstat->used+memstat->free) ); return error; } @@ -945,11 +945,11 @@ static bool phone_entry_empty( const int index, const gn_memory_type memtype ) return false; } -static QString buildPhoneInfoString( const gn_memory_status &memstat ) +static TQString buildPhoneInfoString( const gn_memory_status &memstat ) { - QString format = QString::fromLatin1("<tr><td><b>%1</b></td><td>%2</td></tr>"); + TQString format = TQString::fromLatin1("<tr><td><b>%1</b></td><td>%2</td></tr>"); - return QString::fromLatin1("<b>%1</b><br><table>%2%3%4%5%6</table><br>") + return TQString::fromLatin1("<b>%1</b><br><table>%2%3%4%5%6</table><br>") .arg(i18n("Mobile Phone information:")) .arg(format.arg(i18n("Manufacturer")).arg(GN_FROM(manufacturer))) .arg(format.arg(i18n("Phone model")).arg(GN_FROM(model))) @@ -959,7 +959,7 @@ static QString buildPhoneInfoString( const gn_memory_status &memstat ) .arg(i18n("%1 out of %2 contacts used").arg(memstat.used).arg(memstat.used+memstat.free))); } -static QString buildMemoryTypeString( gn_memory_type memtype ) +static TQString buildMemoryTypeString( gn_memory_type memtype ) { switch (memtype) { case GN_MT_ME: return i18n("internal memory"); @@ -987,9 +987,9 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty error = read_phone_memstat(memtype, &memstat); gn_phonebook_entry entry; - QStringList addrlist; + TQStringList addrlist; KABC::Address *addr; - QString s, country; + TQString s, country; progress->setTotalSteps(memstat.used); m_progressDlg->setLabel(i18n("<qt>Importing <b>%1</b> contacts from <b>%2</b> of the Mobile Phone.<br><br>%3</qt>") @@ -1012,7 +1012,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty if (error == GN_ERR_INVALIDMEMORYTYPE) break; if (error == GN_ERR_NONE) { - GNOKII_DEBUG(QString("%1: %2, num=%3, location=%4, group=%5, count=%6\n").arg(i).arg(GN_FROM(entry.name)) + GNOKII_DEBUG(TQString("%1: %2, num=%3, location=%4, group=%5, count=%6\n").arg(i).arg(GN_FROM(entry.name)) .arg(GN_FROM(entry.number)).arg(entry.location).arg(entry.caller_group).arg(entry.subentries_count)); KABC::Addressee *a = new KABC::Addressee(); @@ -1021,7 +1021,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->setFormattedName(s); // set formatted name as in Phone if (s.find(',') == -1) { // assumed format: "givenname [... familyname]" - addrlist = QStringList::split(' ', s); + addrlist = TQStringList::split(' ', s); if (addrlist.count() == 1) { // only one string -> put it in the GivenName a->setGivenName(s); @@ -1033,26 +1033,26 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty } } else { // assumed format: "familyname, ... givenname" - addrlist = QStringList::split(',', s); + addrlist = TQStringList::split(',', s); a->setFamilyName(addrlist.first().simplifyWhiteSpace()); addrlist.remove(addrlist.first()); a->setGivenName(addrlist.join(" ").simplifyWhiteSpace()); } a->insertCustom(APP, "X_GSM_CALLERGROUP", s.setNum(entry.caller_group)); - a->insertCustom(APP, "X_GSM_STORE_AT", QString("%1%2").arg(memtypestr).arg(entry.location)); + a->insertCustom(APP, "X_GSM_STORE_AT", TQString("%1%2").arg(memtypestr).arg(entry.location)); // set ProductId a->setProductId(PhoneProductId); // evaluate timestamp (ignore timezone) - QDateTime datetime; + TQDateTime datetime; if (entry.date.year<1998) - datetime = QDateTime::currentDateTime(); + datetime = TQDateTime::currentDateTime(); else - datetime = QDateTime( QDate(entry.date.year, entry.date.month, entry.date.day), - QTime(entry.date.hour, entry.date.minute, entry.date.second) ); - GNOKII_DEBUG(QString(" date=%1\n").arg(datetime.toString())); + datetime = TQDateTime( TQDate(entry.date.year, entry.date.month, entry.date.day), + TQTime(entry.date.hour, entry.date.minute, entry.date.second) ); + GNOKII_DEBUG(TQString(" date=%1\n").arg(datetime.toString())); a->setRevision(datetime); if (!entry.subentries_count) @@ -1061,8 +1061,8 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty /* scan sub-entries */ if (entry.subentries_count) for (int n=0; n<entry.subentries_count; n++) { - QString s = GN_FROM(entry.subentries[n].data.number).simplifyWhiteSpace(); - GNOKII_DEBUG(QString(" Subentry#%1, entry_type=%2, number_type=%3, number=%4\n") + TQString s = GN_FROM(entry.subentries[n].data.number).simplifyWhiteSpace(); + GNOKII_DEBUG(TQString(" Subentry#%1, entry_type=%2, number_type=%3, number=%4\n") .arg(n).arg(entry.subentries[n].entry_type) .arg(entry.subentries[n].number_type).arg(s)); if (s.isEmpty()) @@ -1075,10 +1075,10 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->insertEmail(s); break; case GN_PHONEBOOK_ENTRY_Postal: - addrlist = QStringList::split(';', s, true); + addrlist = TQStringList::split(';', s, true); addr = new KABC::Address(KABC::Address::Work); if (addrlist.count() <= 1) { - addrlist = QStringList::split(',', s, true); + addrlist = TQStringList::split(',', s, true); if (addrlist.count() > 1 ) { // assumed format: "Locality, ZIP, Country" addr->setLocality(addrlist[0]); @@ -1130,7 +1130,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->insertCategory(s); break; default: - GNOKII_DEBUG(QString(" Not handled id=%1, entry=%2\n") + GNOKII_DEBUG(TQString(" Not handled id=%1, entry=%2\n") .arg(entry.subentries[n].entry_type).arg(s)); break; } // switch() @@ -1161,7 +1161,7 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem const KABC::Addressee *addr) { gn_phonebook_entry entry; - QString s; + TQString s; memset(&entry, 0, sizeof(entry)); strncpy(entry.name, GN_TO(addr->realName()), sizeof(entry.name)-1); @@ -1177,7 +1177,7 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem s = makeValidPhone(s); strncpy(entry.number, s.ascii(), sizeof(entry.number)-1); entry.memory_type = memtype; - QString cg = addr->custom(APP, "X_GSM_CALLERGROUP"); + TQString cg = addr->custom(APP, "X_GSM_CALLERGROUP"); if (cg.isEmpty()) entry.caller_group = 5; // default group else @@ -1185,9 +1185,9 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem entry.location = phone_location; // set date/revision - QDateTime datetime = addr->revision(); - QDate date(datetime.date()); - QTime time(datetime.time()); + TQDateTime datetime = addr->revision(); + TQDate date(datetime.date()); + TQTime time(datetime.time()); entry.date.year = date.year(); entry.date.month = date.month(); entry.date.day = date.day(); @@ -1195,7 +1195,7 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem entry.date.minute = time.minute(); entry.date.second = time.second(); - GNOKII_DEBUG(QString("Write #%1: name=%2, number=%3\n").arg(phone_location) + GNOKII_DEBUG(TQString("Write #%1: name=%2, number=%3\n").arg(phone_location) .arg(GN_FROM(entry.name)).arg(GN_FROM(entry.number))); const KABC::Address homeAddr = addr->address(KABC::Address::Home); @@ -1239,7 +1239,7 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem subentry++; } // add E-Mails - QStringList emails = addr->emails(); + TQStringList emails = addr->emails(); for (unsigned int n=0; n<emails.count(); n++) { if (entry.subentries_count >= GN_PHONEBOOK_SUBENTRIES_MAX_NUMBER) break; // Phonebook full @@ -1247,7 +1247,7 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem if (s.isEmpty()) continue; // only one email allowed if we have URLS, notes, addresses (to avoid phone limitations) if (n && !addr->url().isEmpty() && !addr->note().isEmpty() && addr->addresses().count()) { - GNOKII_DEBUG(QString(" DROPPED email %1 in favor of URLs, notes and addresses.\n") + GNOKII_DEBUG(TQString(" DROPPED email %1 in favor of URLs, notes and addresses.\n") .arg(s)); continue; } @@ -1265,9 +1265,9 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem const KABC::Address *Addr = &(*it2); if (Addr->isEmpty()) continue; subentry->entry_type = GN_PHONEBOOK_ENTRY_Postal; - QStringList a; - QChar sem(';'); - QString sem_repl(QString::fromLatin1(",")); + TQStringList a; + TQChar sem(';'); + TQString sem_repl(TQString::fromLatin1(",")); a.append( Addr->postOfficeBox().replace( sem, sem_repl ) ); a.append( Addr->extended() .replace( sem, sem_repl ) ); a.append( Addr->street() .replace( sem, sem_repl ) ); @@ -1292,7 +1292,7 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem // debug output for (int st=0; st<entry.subentries_count; st++) { gn_phonebook_subentry *subentry = &entry.subentries[st]; - GNOKII_DEBUG(QString(" SubTel #%1: entry_type=%2, number_type=%3, number=%4\n") + GNOKII_DEBUG(TQString(" SubTel #%1: entry_type=%2, number_type=%3, number=%4\n") .arg(st).arg(subentry->entry_type) .arg(subentry->number_type).arg(GN_FROM(subentry->data.number))); } @@ -1313,13 +1313,13 @@ static gn_error xxport_phone_delete_entry( int phone_location, gn_memory_type me entry.memory_type = memtype; entry.location = phone_location; data.phonebook_entry = &entry; - GNOKII_DEBUG(QString("Deleting entry %1\n").arg(phone_location)); + GNOKII_DEBUG(TQString("Deleting entry %1\n").arg(phone_location)); gn_error error = gn_sm_functions(GN_OP_WritePhonebook, &data, &state); GNOKII_CHECK_ERROR(error); return error; } -KABC::AddresseeList GNOKIIXXPort::importContacts( const QString& ) const +KABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const { KABC::AddresseeList addrList; @@ -1339,14 +1339,14 @@ KABC::AddresseeList GNOKIIXXPort::importContacts( const QString& ) const m_progressDlg->progressBar()->setProgress(0); m_progressDlg->progressBar()->setCenterIndicator(true); m_progressDlg->setModal(true); - m_progressDlg->setInitialSize(QSize(450,350)); + m_progressDlg->setInitialSize(TQSize(450,350)); m_progressDlg->show(); processEvents(); #if (QT_VERSION >= 0x030300) m_progressDlg->setCursor( Qt::BusyCursor ); #endif - QString errStr = businit(); + TQString errStr = businit(); m_progressDlg->unsetCursor(); if (!errStr.isEmpty()) { @@ -1370,7 +1370,7 @@ KABC::AddresseeList GNOKIIXXPort::importContacts( const QString& ) const } -bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const QString & ) +bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQString & ) { if (KMessageBox::Continue != KMessageBox::warningContinueCancel(parentWidget(), i18n("<qt>Please connect your Mobile Phone to your computer and press " @@ -1388,14 +1388,14 @@ bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const QStrin m_progressDlg->progressBar()->setProgress(0); m_progressDlg->progressBar()->setCenterIndicator(true); m_progressDlg->setModal(true); - m_progressDlg->setInitialSize(QSize(450,350)); + m_progressDlg->setInitialSize(TQSize(450,350)); m_progressDlg->show(); processEvents(); KProgress* progress = (KProgress*)m_progressDlg->progressBar(); KABC::AddresseeList::ConstIterator it; - QStringList failedList; + TQStringList failedList; gn_error error; bool deleteLabelInitialized = false; @@ -1403,7 +1403,7 @@ bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const QStrin #if (QT_VERSION >= 0x030300) m_progressDlg->setCursor( Qt::BusyCursor ); #endif - QString errStr = businit(); + TQString errStr = businit(); m_progressDlg->unsetCursor(); if (!errStr.isEmpty()) { @@ -1480,7 +1480,7 @@ try_next_phone_entry: if (phone_entry_no > (memstat.used + memstat.free)) break; - GNOKII_DEBUG(QString("Try to write entry '%1' at phone_entry_no=%2, phone_count=%3\n") + GNOKII_DEBUG(TQString("Try to write entry '%1' at phone_entry_no=%2, phone_count=%3\n") .arg(addr->realName()).arg(phone_entry_no).arg(phone_count)); error = GN_ERR_NONE; @@ -1554,7 +1554,7 @@ finish: delete m_progressDlg; if (!failedList.isEmpty()) { - GNOKII_DEBUG(QString("Failed to export: %1\n").arg(failedList.join(", "))); + GNOKII_DEBUG(TQString("Failed to export: %1\n").arg(failedList.join(", "))); KMessageBox::informationList(parentWidget(), i18n("<qt>The following contacts could not be exported to the Mobile Phone. " "Possible Reasons for this problem could be:<br><ul>" @@ -1580,7 +1580,7 @@ finish: #else /* no gnokii installed */ -KABC::AddresseeList GNOKIIXXPort::importContacts( const QString& ) const +KABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const { KABC::AddresseeList addrList; KMessageBox::error(parentWidget(), i18n("Gnokii interface is not available.\n" @@ -1588,7 +1588,7 @@ KABC::AddresseeList GNOKIIXXPort::importContacts( const QString& ) const return addrList; } -bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const QString & ) +bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQString & ) { Q_UNUSED(list); KMessageBox::error(parentWidget(), i18n("Gnokii interface is not available.\n" |