From 7346aee26bf190a7e70333c40fab4caca847cd27 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:22:56 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp | 76 +++++++++++----------- kaddressbook-plugins/xxports/gmx/gmx_xxport.h | 10 +-- .../xxports/kworldclock/geo_xxport.cpp | 28 ++++---- .../xxports/kworldclock/geo_xxport.h | 6 +- 4 files changed, 60 insertions(+), 60 deletions(-) (limited to 'kaddressbook-plugins') diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp b/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp index 524ad70..4a492f0 100644 --- a/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp @@ -29,8 +29,8 @@ For further information please visit http://www.gmx.com */ -#include -#include +#include +#include #include #include @@ -48,46 +48,46 @@ K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libkaddrbk_gmx_xxport, GMXXXPort, "libka #define GMX_FILESELECTION_STRING "*.gmxa|" + i18n( "GMX addressbook file (*.gmxa)" ) -GMXXXPort::GMXXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +GMXXXPort::GMXXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createImportAction( i18n( "Import GMX Address Book..." ) ); createExportAction( i18n( "Export GMX Address Book..." ) ); } -static bool checkDateTime( const QString &dateStr, QDateTime &dt ) +static bool checkDateTime( const TQString &dateStr, TQDateTime &dt ) { if (dateStr.isEmpty()) return false; - dt = QDateTime::fromString(dateStr, Qt::ISODate); + dt = TQDateTime::fromString(dateStr, Qt::ISODate); if (dt.isValid() && dt.date().year()>1901) return true; - dt.setDate(QDate()); + dt.setDate(TQDate()); return false; } /* import */ -KABC::AddresseeList GMXXXPort::importContacts( const QString& ) const +KABC::AddresseeList GMXXXPort::importContacts( const TQString& ) const { KABC::AddresseeList addrList; - QString fileName = KFileDialog::getOpenFileName( ":xxport_gmx", + TQString fileName = KFileDialog::getOpenFileName( ":xxport_gmx", GMX_FILESELECTION_STRING, 0 ); if ( fileName.isEmpty() ) return addrList; - QFile file( fileName ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) { - QString msg = i18n( "Unable to open %1 for reading." ); + TQString msg = i18n( "Unable to open %1 for reading." ); KMessageBox::error( parentWidget(), msg.arg( fileName ) ); return addrList; } - QDateTime dt; - QTextStream gmxStream( &file ); - gmxStream.setEncoding( QTextStream::Latin1 ); - QString line, line2; + TQDateTime dt; + TQTextStream gmxStream( &file ); + gmxStream.setEncoding( TQTextStream::Latin1 ); + TQString line, line2; line = gmxStream.readLine(); line2 = gmxStream.readLine(); if (!line.startsWith("AB_ADDRESSES:") || !line2.startsWith("Address_id")) { @@ -95,15 +95,15 @@ KABC::AddresseeList GMXXXPort::importContacts( const QString& ) const return addrList; } - QStringList strList; - typedef QMap AddressMap; + TQStringList strList; + typedef TQMap AddressMap; AddressMap addrMap; // "Address_id,Nickname,Firstname,Lastname,Title,Birthday,Comments,Change_date,Status,Address_link_id,Categories" line = gmxStream.readLine(); while (!line.startsWith("####") && !gmxStream.atEnd()) { while (1) { - strList = QStringList::split('#', line, true); + strList = TQStringList::split('#', line, true); if (strList.count() >= 11) break; line.append('\n'); @@ -143,7 +143,7 @@ KABC::AddresseeList GMXXXPort::importContacts( const QString& ) const while (!line.startsWith("####") && !gmxStream.atEnd()) { while (1) { - strList = QStringList::split('#', line, true); + strList = TQStringList::split('#', line, true); if (strList.count() >= 21) break; line.append('\n'); @@ -152,7 +152,7 @@ KABC::AddresseeList GMXXXPort::importContacts( const QString& ) const KABC::Addressee *addr = addrMap[strList[0]]; if (addr) { - for ( QStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) + for ( TQStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) *it = (*it).simplifyWhiteSpace(); // strList[1] = Record_id (numbered item, ignore here) int id = strList[14].toInt(); // Record_type_id (0=work,1=home,2=other) @@ -204,7 +204,7 @@ KABC::AddresseeList GMXXXPort::importContacts( const QString& ) const /* export */ -bool GMXXXPort::exportContacts( const KABC::AddresseeList &list, const QString& ) +bool GMXXXPort::exportContacts( const KABC::AddresseeList &list, const TQString& ) { KURL url = KFileDialog::getSaveURL( ":xxport_gmx", GMX_FILESELECTION_STRING ); if ( url.isEmpty() ) @@ -213,7 +213,7 @@ bool GMXXXPort::exportContacts( const KABC::AddresseeList &list, const QString& if ( !url.isLocalFile() ) { KTempFile tmpFile; if ( tmpFile.status() != 0 ) { - QString txt = i18n( "Unable to open file %1.%2." ); + TQString txt = i18n( "Unable to open file %1.%2." ); KMessageBox::error( parentWidget(), txt.arg( url.url() ) .arg( strerror( tmpFile.status() ) ) ); return false; @@ -224,11 +224,11 @@ bool GMXXXPort::exportContacts( const KABC::AddresseeList &list, const QString& return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); } else { - QString filename = url.path(); - QFile file( filename ); + TQString filename = url.path(); + TQFile file( filename ); if ( !file.open( IO_WriteOnly ) ) { - QString txt = i18n( "Unable to open file %1." ); + TQString txt = i18n( "Unable to open file %1." ); KMessageBox::error( parentWidget(), txt.arg( filename ) ); return false; } @@ -240,25 +240,25 @@ bool GMXXXPort::exportContacts( const KABC::AddresseeList &list, const QString& } } -static const QString dateString( const QDateTime &dt ) +static const TQString dateString( const TQDateTime &dt ) { if (!dt.isValid()) - return QString::fromLatin1("1000-01-01 00:00:00"); - QString d(dt.toString(Qt::ISODate)); + return TQString::fromLatin1("1000-01-01 00:00:00"); + TQString d(dt.toString(Qt::ISODate)); d[10] = ' '; // remove the "T" in the middle of the string return d; } -void GMXXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) +void GMXXXPort::doExport( TQFile *fp, const KABC::AddresseeList &list ) { if (!fp || !list.count()) return; - QTextStream t( fp ); - t.setEncoding( QTextStream::Latin1 ); + TQTextStream t( fp ); + t.setEncoding( TQTextStream::Latin1 ); KABC::AddresseeList::ConstIterator it; - typedef QMap AddressMap; + typedef TQMap AddressMap; AddressMap addrMap; const KABC::Addressee *addr; @@ -267,7 +267,7 @@ void GMXXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) "Change_date,Status,Address_link_id,Categories\n"; int no = 0; - const QChar DELIM('#'); + const TQChar DELIM('#'); for ( it = list.begin(); it != list.end(); ++it ) { addr = &(*it); if (addr->isEmpty()) @@ -309,8 +309,8 @@ void GMXXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) cell = addr->phoneNumber(KABC::PhoneNumber::Cell); } - const QStringList emails = addr->emails(); - QString email; + const TQStringList emails = addr->emails(); + TQString email; if (emails.count()>record_id) email = emails[record_id]; t << no << DELIM // Address_id @@ -324,13 +324,13 @@ void GMXXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) << cell.number() << DELIM // Mobile << ((cell.type()&KABC::PhoneNumber::Pref)?-1:0) << DELIM // Mobile_type << email << DELIM // Email - << ((record_id==0)?addr->url().url():QString::null) << DELIM // Homepage - << ((record_id==0)?addr->role():QString::null) << DELIM // Position + << ((record_id==0)?addr->url().url():TQString::null) << DELIM // Homepage + << ((record_id==0)?addr->role():TQString::null) << DELIM // Position << DELIM // Comments << record_id << DELIM // Record_type_id (0,1,2) - see above << DELIM // Record_type (name of this additional record entry) - << ((record_id==0)?addr->organization():QString::null) << DELIM // Company - << ((record_id==0)?addr->custom("KADDRESSBOOK", "X-Department"):QString::null) << DELIM // Department + << ((record_id==0)?addr->organization():TQString::null) << DELIM // Company + << ((record_id==0)?addr->custom("KADDRESSBOOK", "X-Department"):TQString::null) << DELIM // Department << dateString(addr->revision()) << DELIM // Change_date << 5 << DELIM // Preferred << 1 << endl; // Status (should always be "1") diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxport.h b/kaddressbook-plugins/xxports/gmx/gmx_xxport.h index 9ced4da..607455c 100644 --- a/kaddressbook-plugins/xxports/gmx/gmx_xxport.h +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxport.h @@ -32,16 +32,16 @@ class GMXXXPort : public KAB::XXPort Q_OBJECT public: - GMXXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + GMXXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "gmx"; } + TQString identifier() const { return "gmx"; } public slots: - bool exportContacts( const KABC::AddresseeList &list, const QString &data ); - KABC::AddresseeList importContacts( const QString &data ) const; + bool exportContacts( const KABC::AddresseeList &list, const TQString &data ); + KABC::AddresseeList importContacts( const TQString &data ) const; private: - void doExport( QFile *fp, const KABC::AddresseeList &list ); + void doExport( TQFile *fp, const KABC::AddresseeList &list ); }; #endif diff --git a/kaddressbook-plugins/xxports/kworldclock/geo_xxport.cpp b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.cpp index a2440aa..72256b8 100644 --- a/kaddressbook-plugins/xxports/kworldclock/geo_xxport.cpp +++ b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.cpp @@ -35,39 +35,39 @@ class FlagInfo public: double latitude; double longitude; - QColor color; + TQColor color; }; K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libkaddrbk_geo_xxport, GeoXXPort, "libkaddrbk_geo_xxport" ) -GeoXXPort::GeoXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +GeoXXPort::GeoXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createExportAction( i18n( "Export Geo Data..." ) ); } -bool GeoXXPort::exportContacts( const KABC::AddresseeList &list, const QString& ) +bool GeoXXPort::exportContacts( const KABC::AddresseeList &list, const TQString& ) { KConfig config( "kworldclockrc" ); // At first we read all exiting flags and compare it with ours to // avoid duplicated flags int flags = config.readNumEntry( "Flags", 0 ); - QValueList availableFlags; + TQValueList availableFlags; if ( flags != 0 ) { for ( int i = 0; i < flags; ++i ) { FlagInfo info; - info.latitude = config.readDoubleNumEntry( QString( "Flag_%1_Latitude" ).arg( i ) ); - info.longitude = config.readDoubleNumEntry( QString( "Flag_%1_Longitude" ).arg( i ) ); - info.color = config.readColorEntry( QString( "Flag_%1_Color" ).arg( i ) ); + info.latitude = config.readDoubleNumEntry( TQString( "Flag_%1_Latitude" ).arg( i ) ); + info.longitude = config.readDoubleNumEntry( TQString( "Flag_%1_Longitude" ).arg( i ) ); + info.color = config.readColorEntry( TQString( "Flag_%1_Color" ).arg( i ) ); availableFlags.append( info ); } } - QValueList flagList; + TQValueList flagList; KABC::AddresseeList::ConstIterator addrIt; for ( addrIt = list.begin(); addrIt != list.end(); ++addrIt ) { KABC::Geo geo( (*addrIt).geo() ); @@ -75,7 +75,7 @@ bool GeoXXPort::exportContacts( const KABC::AddresseeList &list, const QString& continue; bool available = false; - QValueList::Iterator it; + TQValueList::Iterator it; for ( it = availableFlags.begin(); it != availableFlags.end(); ++it ) { if ( !( KABS( (*it).latitude - geo.latitude() ) > DBL_EPSILON ) && !( KABS( (*it).longitude - geo.longitude() ) > DBL_EPSILON ) ) { @@ -88,7 +88,7 @@ bool GeoXXPort::exportContacts( const KABC::AddresseeList &list, const QString& FlagInfo info; info.latitude = geo.latitude(); info.longitude = geo.longitude(); - info.color = QColor( 0, 255, 0 ); + info.color = TQColor( 0, 255, 0 ); flagList.append( info ); } @@ -100,11 +100,11 @@ bool GeoXXPort::exportContacts( const KABC::AddresseeList &list, const QString& flagList += availableFlags; int startVal = 0; - QValueList::Iterator it; + TQValueList::Iterator it; for ( it = flagList.begin(); it != flagList.end(); ++it, ++startVal ) { - config.writeEntry( QString( "Flag_%1_Color" ).arg( startVal ), (*it).color ); - config.writeEntry( QString( "Flag_%1_Latitude" ).arg( startVal ), (*it).latitude ); - config.writeEntry( QString( "Flag_%1_Longitude" ).arg( startVal ), (*it).longitude ); + config.writeEntry( TQString( "Flag_%1_Color" ).arg( startVal ), (*it).color ); + config.writeEntry( TQString( "Flag_%1_Latitude" ).arg( startVal ), (*it).latitude ); + config.writeEntry( TQString( "Flag_%1_Longitude" ).arg( startVal ), (*it).longitude ); } config.writeEntry( "Flags", startVal ); diff --git a/kaddressbook-plugins/xxports/kworldclock/geo_xxport.h b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.h index d3b560a..cdac56a 100644 --- a/kaddressbook-plugins/xxports/kworldclock/geo_xxport.h +++ b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.h @@ -31,12 +31,12 @@ class GeoXXPort : public KAB::XXPort Q_OBJECT public: - GeoXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + GeoXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "geo"; } + TQString identifier() const { return "geo"; } public slots: - bool exportContacts( const KABC::AddresseeList &list, const QString &data ); + bool exportContacts( const KABC::AddresseeList &list, const TQString &data ); }; #endif -- cgit v1.2.1