diff options
Diffstat (limited to 'kaddressbook/xxport/gnokii_xxport.cpp')
-rw-r--r-- | kaddressbook/xxport/gnokii_xxport.cpp | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/kaddressbook/xxport/gnokii_xxport.cpp b/kaddressbook/xxport/gnokii_xxport.cpp index 306fbe808..5755784af 100644 --- a/kaddressbook/xxport/gnokii_xxport.cpp +++ b/kaddressbook/xxport/gnokii_xxport.cpp @@ -77,7 +77,7 @@ static KProgressDialog *m_progressDlg; K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_gnokii_xxport, GNOKIIXXPort ) -GNOKIIXXPort::GNOKIIXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) +GNOKIIXXPort::GNOKIIXXPort( TDEABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { this_filter = this; @@ -187,7 +187,7 @@ static TQString buildPhoneInfoString( const gn_memory_status &memstat ) // read and evaluate all phone entries static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memtype, - KABC::AddresseeList *addrList ) + TDEABC::AddresseeList *addrList ) { gn_error error; @@ -204,7 +204,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty error = read_phone_memstat(memtype, &memstat); TQStringList addrlist; - KABC::Address *addr; + TDEABC::Address *addr; TQString s, country; progress->setTotalSteps(memstat.used); @@ -237,7 +237,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty .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)); - KABC::Addressee *a = new KABC::Addressee(); + TDEABC::Addressee *a = new TDEABC::Addressee(); // try to split Name into FamilyName and GivenName s = GN_FROM(name).simplifyWhiteSpace(); @@ -280,8 +280,8 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->setRevision(datetime); if (!subentries_count) - a->insertPhoneNumber(KABC::PhoneNumber(number, - KABC::PhoneNumber::Work | KABC::PhoneNumber::Pref)); + a->insertPhoneNumber(TDEABC::PhoneNumber(number, + TDEABC::PhoneNumber::Work | TDEABC::PhoneNumber::Pref)); /* scan sub-entries */ if (subentries_count) @@ -307,7 +307,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty break; case GN_PHONEBOOK_ENTRY_Postal: addrlist = TQStringList::split(';', s, true); - addr = new KABC::Address(KABC::Address::Work); + addr = new TDEABC::Address(TDEABC::Address::Work); if (addrlist.count() <= 1) { addrlist = TQStringList::split(',', s, true); if (addrlist.count() > 1 ) { @@ -341,18 +341,18 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->setNote(a->note()+s); break; case GN_PHONEBOOK_ENTRY_Number: - enum KABC::PhoneNumber::Types phonetype; + enum TDEABC::PhoneNumber::Types phonetype; switch (number_type) { - case GN_PHONEBOOK_NUMBER_Mobile: phonetype = KABC::PhoneNumber::Cell; break; - case GN_PHONEBOOK_NUMBER_Fax: phonetype = KABC::PhoneNumber::Fax; break; + case GN_PHONEBOOK_NUMBER_Mobile: phonetype = TDEABC::PhoneNumber::Cell; break; + case GN_PHONEBOOK_NUMBER_Fax: phonetype = TDEABC::PhoneNumber::Fax; break; case GN_PHONEBOOK_NUMBER_General: - case GN_PHONEBOOK_NUMBER_Work: phonetype = KABC::PhoneNumber::Work; break; + case GN_PHONEBOOK_NUMBER_Work: phonetype = TDEABC::PhoneNumber::Work; break; default: - case GN_PHONEBOOK_NUMBER_Home: phonetype = KABC::PhoneNumber::Home; break; + case GN_PHONEBOOK_NUMBER_Home: phonetype = TDEABC::PhoneNumber::Home; break; } //if (s == entry.number) - // type = (KABC::PhoneNumber::Types) (phonetype | KABC::PhoneNumber::Pref); - a->insertPhoneNumber(KABC::PhoneNumber(s, phonetype)); + // type = (TDEABC::PhoneNumber::Types) (phonetype | TDEABC::PhoneNumber::Pref); + a->insertPhoneNumber(TDEABC::PhoneNumber(s, phonetype)); break; case GN_PHONEBOOK_ENTRY_URL: a->setUrl(s); @@ -388,7 +388,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty // export to phone static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type memtype, - const KABC::Addressee *addr) + const TDEABC::Addressee *addr) { TQString s; @@ -398,13 +398,13 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem gn_lib_set_pb_location(state, phone_location); gn_lib_set_pb_name(state, GN_TO(addr->realName())); - s = addr->phoneNumber(KABC::PhoneNumber::Pref).number(); + s = addr->phoneNumber(TDEABC::PhoneNumber::Pref).number(); if (s.isEmpty()) - s = addr->phoneNumber(KABC::PhoneNumber::Work).number(); + s = addr->phoneNumber(TDEABC::PhoneNumber::Work).number(); if (s.isEmpty()) - s = addr->phoneNumber(KABC::PhoneNumber::Home).number(); + s = addr->phoneNumber(TDEABC::PhoneNumber::Home).number(); if (s.isEmpty()) - s = addr->phoneNumber(KABC::PhoneNumber::Cell).number(); + s = addr->phoneNumber(TDEABC::PhoneNumber::Cell).number(); if (s.isEmpty() && addr->phoneNumbers().count()>0) s = (*addr->phoneNumbers().at(0)).number(); s = makeValidPhone(s); @@ -428,25 +428,25 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem 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); - const KABC::Address workAddr = addr->address(KABC::Address::Work); + const TDEABC::Address homeAddr = addr->address(TDEABC::Address::Home); + const TDEABC::Address workAddr = addr->address(TDEABC::Address::Work); // add all phone numbers - const KABC::PhoneNumber::List phoneList = addr->phoneNumbers(); - KABC::PhoneNumber::List::ConstIterator it; + const TDEABC::PhoneNumber::List phoneList = addr->phoneNumbers(); + TDEABC::PhoneNumber::List::ConstIterator it; for ( it = phoneList.begin(); it != phoneList.end(); ++it ) { - const KABC::PhoneNumber *phonenumber = &(*it); + const TDEABC::PhoneNumber *phonenumber = &(*it); s = phonenumber->number(); if (s.isEmpty()) continue; gn_phonebook_number_type type; int pn_type = phonenumber->type(); - if ((pn_type & KABC::PhoneNumber::Cell)) + if ((pn_type & TDEABC::PhoneNumber::Cell)) type = GN_PHONEBOOK_NUMBER_Mobile; - else if ((pn_type & KABC::PhoneNumber::Fax)) + else if ((pn_type & TDEABC::PhoneNumber::Fax)) type = GN_PHONEBOOK_NUMBER_Fax; - else if ((pn_type & KABC::PhoneNumber::Home)) + else if ((pn_type & TDEABC::PhoneNumber::Home)) type = GN_PHONEBOOK_NUMBER_Home; - else if ((pn_type & KABC::PhoneNumber::Work)) + else if ((pn_type & TDEABC::PhoneNumber::Work)) type = GN_PHONEBOOK_NUMBER_Work; else type = GN_PHONEBOOK_NUMBER_General; gn_lib_set_pb_subentry(state, -1 /* index to append entry */, @@ -474,10 +474,10 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem GN_PHONEBOOK_ENTRY_Email, GN_PHONEBOOK_NUMBER_General, GN_TO(s)); } // add Adresses - const KABC::Address::List addresses = addr->addresses(); - KABC::Address::List::ConstIterator it2; + const TDEABC::Address::List addresses = addr->addresses(); + TDEABC::Address::List::ConstIterator it2; for ( it2 = addresses.begin(); it2 != addresses.end(); ++it2 ) { - const KABC::Address *Addr = &(*it2); + const TDEABC::Address *Addr = &(*it2); if (Addr->isEmpty()) continue; TQStringList a; TQChar sem(';'); @@ -524,9 +524,9 @@ static gn_error xxport_phone_delete_entry( int phone_location, gn_memory_type me } -KABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const +TDEABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const { - KABC::AddresseeList addrList; + TDEABC::AddresseeList addrList; if (KMessageBox::Continue != KMessageBox::warningContinueCancel(parentWidget(), i18n("<qt>Please connect your Mobile Phone to your computer and press " @@ -573,7 +573,7 @@ KABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const } -bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQString & ) +bool GNOKIIXXPort::exportContacts( const TDEABC::AddresseeList &list, const TQString & ) { if (KMessageBox::Continue != KMessageBox::warningContinueCancel(parentWidget(), i18n("<qt>Please connect your Mobile Phone to your computer and press " @@ -597,7 +597,7 @@ bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQStri KProgress* progress = (KProgress*)m_progressDlg->progressBar(); - KABC::AddresseeList::ConstIterator it; + TDEABC::AddresseeList::ConstIterator it; TQStringList failedList; gn_error error; @@ -663,7 +663,7 @@ bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQStri // Now run the loop... phone_entry_no = 1; for ( it = list.begin(); it != list.end(); ++it ) { - const KABC::Addressee *addr = &(*it); + const TDEABC::Addressee *addr = &(*it); if (addr->isEmpty()) continue; // don't write back SIM-card entries ! @@ -966,7 +966,7 @@ static TQString buildMemoryTypeString( gn_memory_type memtype ) // read and evaluate all phone entries static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memtype, - KABC::AddresseeList *addrList ) + TDEABC::AddresseeList *addrList ) { gn_error error; @@ -984,7 +984,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty gn_phonebook_entry entry; TQStringList addrlist; - KABC::Address *addr; + TDEABC::Address *addr; TQString s, country; progress->setTotalSteps(memstat.used); @@ -1010,7 +1010,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty if (error == GN_ERR_NONE) { 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(); + TDEABC::Addressee *a = new TDEABC::Addressee(); // try to split Name into FamilyName and GivenName s = GN_FROM(entry.name).simplifyWhiteSpace(); @@ -1052,7 +1052,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->setRevision(datetime); if (!entry.subentries_count) - a->insertPhoneNumber(KABC::PhoneNumber(entry.number, KABC::PhoneNumber::Work | KABC::PhoneNumber::Pref)); + a->insertPhoneNumber(TDEABC::PhoneNumber(entry.number, TDEABC::PhoneNumber::Work | TDEABC::PhoneNumber::Pref)); /* scan sub-entries */ if (entry.subentries_count) @@ -1072,7 +1072,7 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty break; case GN_PHONEBOOK_ENTRY_Postal: addrlist = TQStringList::split(';', s, true); - addr = new KABC::Address(KABC::Address::Work); + addr = new TDEABC::Address(TDEABC::Address::Work); if (addrlist.count() <= 1) { addrlist = TQStringList::split(',', s, true); if (addrlist.count() > 1 ) { @@ -1106,18 +1106,18 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty a->setNote(a->note()+s); break; case GN_PHONEBOOK_ENTRY_Number: - enum KABC::PhoneNumber::Types phonetype; + enum TDEABC::PhoneNumber::Types phonetype; switch (entry.subentries[n].number_type) { - case GN_PHONEBOOK_NUMBER_Mobile: phonetype = KABC::PhoneNumber::Cell; break; - case GN_PHONEBOOK_NUMBER_Fax: phonetype = KABC::PhoneNumber::Fax; break; + case GN_PHONEBOOK_NUMBER_Mobile: phonetype = TDEABC::PhoneNumber::Cell; break; + case GN_PHONEBOOK_NUMBER_Fax: phonetype = TDEABC::PhoneNumber::Fax; break; case GN_PHONEBOOK_NUMBER_General: - case GN_PHONEBOOK_NUMBER_Work: phonetype = KABC::PhoneNumber::Work; break; + case GN_PHONEBOOK_NUMBER_Work: phonetype = TDEABC::PhoneNumber::Work; break; default: - case GN_PHONEBOOK_NUMBER_Home: phonetype = KABC::PhoneNumber::Home; break; + case GN_PHONEBOOK_NUMBER_Home: phonetype = TDEABC::PhoneNumber::Home; break; } //if (s == entry.number) - // type = (KABC::PhoneNumber::Types) (phonetype | KABC::PhoneNumber::Pref); - a->insertPhoneNumber(KABC::PhoneNumber(s, phonetype)); + // type = (TDEABC::PhoneNumber::Types) (phonetype | TDEABC::PhoneNumber::Pref); + a->insertPhoneNumber(TDEABC::PhoneNumber(s, phonetype)); break; case GN_PHONEBOOK_ENTRY_URL: a->setUrl(s); @@ -1154,20 +1154,20 @@ static gn_error read_phone_entries( const char *memtypestr, gn_memory_type memty // export to phone static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type memtype, - const KABC::Addressee *addr) + const TDEABC::Addressee *addr) { gn_phonebook_entry entry; TQString s; memset(&entry, 0, sizeof(entry)); strncpy(entry.name, GN_TO(addr->realName()), sizeof(entry.name)-1); - s = addr->phoneNumber(KABC::PhoneNumber::Pref).number(); + s = addr->phoneNumber(TDEABC::PhoneNumber::Pref).number(); if (s.isEmpty()) - s = addr->phoneNumber(KABC::PhoneNumber::Work).number(); + s = addr->phoneNumber(TDEABC::PhoneNumber::Work).number(); if (s.isEmpty()) - s = addr->phoneNumber(KABC::PhoneNumber::Home).number(); + s = addr->phoneNumber(TDEABC::PhoneNumber::Home).number(); if (s.isEmpty()) - s = addr->phoneNumber(KABC::PhoneNumber::Cell).number(); + s = addr->phoneNumber(TDEABC::PhoneNumber::Cell).number(); if (s.isEmpty() && addr->phoneNumbers().count()>0) s = (*addr->phoneNumbers().at(0)).number(); s = makeValidPhone(s); @@ -1194,28 +1194,28 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem 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); - const KABC::Address workAddr = addr->address(KABC::Address::Work); + const TDEABC::Address homeAddr = addr->address(TDEABC::Address::Home); + const TDEABC::Address workAddr = addr->address(TDEABC::Address::Work); entry.subentries_count = 0; gn_phonebook_subentry *subentry = &entry.subentries[0]; // add all phone numbers - const KABC::PhoneNumber::List phoneList = addr->phoneNumbers(); - KABC::PhoneNumber::List::ConstIterator it; + const TDEABC::PhoneNumber::List phoneList = addr->phoneNumbers(); + TDEABC::PhoneNumber::List::ConstIterator it; for ( it = phoneList.begin(); it != phoneList.end(); ++it ) { - const KABC::PhoneNumber *phonenumber = &(*it); + const TDEABC::PhoneNumber *phonenumber = &(*it); s = phonenumber->number(); if (s.isEmpty()) continue; subentry->entry_type = GN_PHONEBOOK_ENTRY_Number; gn_phonebook_number_type type; int pn_type = phonenumber->type(); - if ((pn_type & KABC::PhoneNumber::Cell)) + if ((pn_type & TDEABC::PhoneNumber::Cell)) type = GN_PHONEBOOK_NUMBER_Mobile; - else if ((pn_type & KABC::PhoneNumber::Fax)) + else if ((pn_type & TDEABC::PhoneNumber::Fax)) type = GN_PHONEBOOK_NUMBER_Fax; - else if ((pn_type & KABC::PhoneNumber::Home)) + else if ((pn_type & TDEABC::PhoneNumber::Home)) type = GN_PHONEBOOK_NUMBER_Home; - else if ((pn_type & KABC::PhoneNumber::Work)) + else if ((pn_type & TDEABC::PhoneNumber::Work)) type = GN_PHONEBOOK_NUMBER_Work; else type = GN_PHONEBOOK_NUMBER_General; subentry->number_type = type; @@ -1253,12 +1253,12 @@ static gn_error xxport_phone_write_entry( int phone_location, gn_memory_type mem subentry++; } // add Adresses - const KABC::Address::List addresses = addr->addresses(); - KABC::Address::List::ConstIterator it2; + const TDEABC::Address::List addresses = addr->addresses(); + TDEABC::Address::List::ConstIterator it2; for ( it2 = addresses.begin(); it2 != addresses.end(); ++it2 ) { if (entry.subentries_count >= GN_PHONEBOOK_SUBENTRIES_MAX_NUMBER) break; // Phonebook full - const KABC::Address *Addr = &(*it2); + const TDEABC::Address *Addr = &(*it2); if (Addr->isEmpty()) continue; subentry->entry_type = GN_PHONEBOOK_ENTRY_Postal; TQStringList a; @@ -1315,9 +1315,9 @@ static gn_error xxport_phone_delete_entry( int phone_location, gn_memory_type me return error; } -KABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const +TDEABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const { - KABC::AddresseeList addrList; + TDEABC::AddresseeList addrList; if (KMessageBox::Continue != KMessageBox::warningContinueCancel(parentWidget(), i18n("<qt>Please connect your Mobile Phone to your computer and press " @@ -1364,7 +1364,7 @@ KABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const } -bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQString & ) +bool GNOKIIXXPort::exportContacts( const TDEABC::AddresseeList &list, const TQString & ) { if (KMessageBox::Continue != KMessageBox::warningContinueCancel(parentWidget(), i18n("<qt>Please connect your Mobile Phone to your computer and press " @@ -1388,7 +1388,7 @@ bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQStri KProgress* progress = (KProgress*)m_progressDlg->progressBar(); - KABC::AddresseeList::ConstIterator it; + TDEABC::AddresseeList::ConstIterator it; TQStringList failedList; gn_error error; @@ -1454,7 +1454,7 @@ bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQStri // Now run the loop... phone_entry_no = 1; for ( it = list.begin(); it != list.end(); ++it ) { - const KABC::Addressee *addr = &(*it); + const TDEABC::Addressee *addr = &(*it); if (addr->isEmpty()) continue; // don't write back SIM-card entries ! @@ -1572,15 +1572,15 @@ finish: #else /* no gnokii installed */ -KABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const +TDEABC::AddresseeList GNOKIIXXPort::importContacts( const TQString& ) const { - KABC::AddresseeList addrList; + TDEABC::AddresseeList addrList; KMessageBox::error(parentWidget(), i18n("Gnokii interface is not available.\n" "Please ask your distributor to add gnokii at compile time.")); return addrList; } -bool GNOKIIXXPort::exportContacts( const KABC::AddresseeList &list, const TQString & ) +bool GNOKIIXXPort::exportContacts( const TDEABC::AddresseeList &list, const TQString & ) { Q_UNUSED(list); KMessageBox::error(parentWidget(), i18n("Gnokii interface is not available.\n" |