diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kaddressbook/xxport | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kaddressbook/xxport')
26 files changed, 447 insertions, 447 deletions
diff --git a/kaddressbook/xxport/bookmark_xxport.cpp b/kaddressbook/xxport/bookmark_xxport.cpp index 0a8d71bef..2cfdf98ca 100644 --- a/kaddressbook/xxport/bookmark_xxport.cpp +++ b/kaddressbook/xxport/bookmark_xxport.cpp @@ -33,15 +33,15 @@ K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_bookmark_xxport, BookmarkXXPort ) -BookmarkXXPort::BookmarkXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +BookmarkXXPort::BookmarkXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createExportAction( i18n( "Export Bookmarks Menu..." ) ); } -bool BookmarkXXPort::exportContacts( const KABC::AddresseeList &list, const QString& ) +bool BookmarkXXPort::exportContacts( const KABC::AddresseeList &list, const TQString& ) { - QString fileName = locateLocal( "data", "kabc/bookmarks.xml" ); + TQString fileName = locateLocal( "data", "kabc/bookmarks.xml" ); KBookmarkManager *mgr = KBookmarkManager::managerForFile( fileName ); KBookmarkDomBuilder *builder = new KBookmarkDomBuilder( mgr->root(), mgr ); @@ -51,8 +51,8 @@ bool BookmarkXXPort::exportContacts( const KABC::AddresseeList &list, const QStr emit newFolder( i18n( "AddressBook" ), false, "" ); for ( it = list.begin(); it != list.end(); ++it ) { if ( !(*it).url().isEmpty() ) { - QString name = (*it).givenName() + " " + (*it).familyName(); - emit newBookmark( name, (*it).url().url().latin1(), QString( "" ) ); + TQString name = (*it).givenName() + " " + (*it).familyName(); + emit newBookmark( name, (*it).url().url().latin1(), TQString( "" ) ); } } emit endFolder(); diff --git a/kaddressbook/xxport/bookmark_xxport.h b/kaddressbook/xxport/bookmark_xxport.h index 5cc186ed6..f12ed8e28 100644 --- a/kaddressbook/xxport/bookmark_xxport.h +++ b/kaddressbook/xxport/bookmark_xxport.h @@ -32,20 +32,20 @@ class BookmarkXXPort : public KAB::XXPort Q_OBJECT public: - BookmarkXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + BookmarkXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "bookmark"; } + TQString identifier() const { return "bookmark"; } public slots: - bool exportContacts( const KABC::AddresseeList &list, const QString &data ); + bool exportContacts( const KABC::AddresseeList &list, const TQString &data ); signals: /** The following signals are used for building a bookmarks file using KBookmarkDomBuilder. */ - void newBookmark( const QString &text, const QCString &url, const QString &additionnalInfo ); - void newFolder( const QString &text, bool open, const QString &additionnalInfo ); + void newBookmark( const TQString &text, const TQCString &url, const TQString &additionnalInfo ); + void newFolder( const TQString &text, bool open, const TQString &additionnalInfo ); void newSeparator(); void endFolder(); }; diff --git a/kaddressbook/xxport/csv_xxport.cpp b/kaddressbook/xxport/csv_xxport.cpp index 31611f390..fa4be2c9b 100644 --- a/kaddressbook/xxport/csv_xxport.cpp +++ b/kaddressbook/xxport/csv_xxport.cpp @@ -21,7 +21,7 @@ without including the source code for Qt in the source distribution. */ -#include <qfile.h> +#include <tqfile.h> #include <kfiledialog.h> #include <kio/netaccess.h> @@ -36,14 +36,14 @@ K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_csv_xxport, CSVXXPort ) -CSVXXPort::CSVXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +CSVXXPort::CSVXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createImportAction( i18n( "Import CSV List..." ) ); createExportAction( i18n( "Export CSV List..." ) ); } -bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString& ) +bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const TQString& ) { KURL url = KFileDialog::getSaveURL( "addressbook.csv" ); if ( url.isEmpty() ) @@ -52,7 +52,7 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString& if ( !url.isLocalFile() ) { KTempFile tmpFile; if ( tmpFile.status() != 0 ) { - QString txt = i18n( "<qt>Unable to open file <b>%1</b>.%2.</qt>" ); + TQString txt = i18n( "<qt>Unable to open file <b>%1</b>.%2.</qt>" ); KMessageBox::error( parentWidget(), txt.arg( url.url() ) .arg( strerror( tmpFile.status() ) ) ); return false; @@ -63,9 +63,9 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString& return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); } else { - QFile file( url.path() ); + TQFile file( url.path() ); if ( !file.open( IO_WriteOnly ) ) { - QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); + TQString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); KMessageBox::error( parentWidget(), txt.arg( url.path() ) ); return false; } @@ -79,7 +79,7 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString& } } -KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const +KABC::AddresseeList CSVXXPort::importContacts( const TQString& ) const { CSVImportDialog dlg( addressBook(), parentWidget() ); if ( dlg.exec() ) @@ -88,10 +88,10 @@ KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const return KABC::AddresseeList(); } -void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) +void CSVXXPort::doExport( TQFile *fp, const KABC::AddresseeList &list ) { - QTextStream t( fp ); - t.setEncoding( QTextStream::Locale ); + TQTextStream t( fp ); + t.setEncoding( TQTextStream::Locale ); KABC::AddresseeList::ConstIterator iter; KABC::Field::List fields = addressBook()->fields(); diff --git a/kaddressbook/xxport/csv_xxport.h b/kaddressbook/xxport/csv_xxport.h index 972f4cad4..b957299d4 100644 --- a/kaddressbook/xxport/csv_xxport.h +++ b/kaddressbook/xxport/csv_xxport.h @@ -31,16 +31,16 @@ class CSVXXPort : public KAB::XXPort Q_OBJECT public: - CSVXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + CSVXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "csv"; } + TQString identifier() const { return "csv"; } 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/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp index f89222aff..cfcac0fec 100644 --- a/kaddressbook/xxport/csvimportdialog.cpp +++ b/kaddressbook/xxport/csvimportdialog.cpp @@ -20,17 +20,17 @@ */ -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qtable.h> -#include <qtextcodec.h> -#include <qtooltip.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqradiobutton.h> +#include <tqtable.h> +#include <tqtextcodec.h> +#include <tqtooltip.h> #include <kapplication.h> #include <kdebug.h> @@ -50,7 +50,7 @@ enum { Local = 0, Guess = 1, Latin1 = 2, Uni = 3, MSBug = 4, Codec = 5 }; -CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, +CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, TQWidget *parent, const char * name ) : KDialogBase( Plain, i18n ( "CSV Import Dialog" ), Ok | Cancel | User1 | User2, Ok, parent, name, true, true ), @@ -121,33 +121,33 @@ CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, reloadCodecs(); - connect( mDelimiterBox, SIGNAL( clicked( int ) ), - this, SLOT( delimiterClicked( int ) ) ); - connect( mDelimiterEdit, SIGNAL( returnPressed() ), - this, SLOT( returnPressed() ) ); - connect( mDelimiterEdit, SIGNAL( textChanged ( const QString& ) ), - this, SLOT( textChanged ( const QString& ) ) ); - connect( mComboLine, SIGNAL( activated( const QString& ) ), - this, SLOT( lineSelected( const QString& ) ) ); - connect( mComboQuote, SIGNAL( activated( const QString& ) ), - this, SLOT( textquoteSelected( const QString& ) ) ); - connect( mIgnoreDuplicates, SIGNAL( stateChanged( int ) ), - this, SLOT( ignoreDuplicatesChanged( int ) ) ); - connect( mCodecCombo, SIGNAL( activated( const QString& ) ), - this, SLOT( codecChanged() ) ); - - connect( mUrlRequester, SIGNAL( returnPressed( const QString& ) ), - this, SLOT( setFile( const QString& ) ) ); - connect( mUrlRequester, SIGNAL( urlSelected( const QString& ) ), - this, SLOT( setFile( const QString& ) ) ); - connect( mUrlRequester->lineEdit(), SIGNAL( textChanged ( const QString& ) ), - this, SLOT( urlChanged( const QString& ) ) ); - - connect( this, SIGNAL( user1Clicked() ), - this, SLOT( applyTemplate() ) ); - - connect( this, SIGNAL( user2Clicked() ), - this, SLOT( saveTemplate() ) ); + connect( mDelimiterBox, TQT_SIGNAL( clicked( int ) ), + this, TQT_SLOT( delimiterClicked( int ) ) ); + connect( mDelimiterEdit, TQT_SIGNAL( returnPressed() ), + this, TQT_SLOT( returnPressed() ) ); + connect( mDelimiterEdit, TQT_SIGNAL( textChanged ( const TQString& ) ), + this, TQT_SLOT( textChanged ( const TQString& ) ) ); + connect( mComboLine, TQT_SIGNAL( activated( const TQString& ) ), + this, TQT_SLOT( lineSelected( const TQString& ) ) ); + connect( mComboQuote, TQT_SIGNAL( activated( const TQString& ) ), + this, TQT_SLOT( textquoteSelected( const TQString& ) ) ); + connect( mIgnoreDuplicates, TQT_SIGNAL( stateChanged( int ) ), + this, TQT_SLOT( ignoreDuplicatesChanged( int ) ) ); + connect( mCodecCombo, TQT_SIGNAL( activated( const TQString& ) ), + this, TQT_SLOT( codecChanged() ) ); + + connect( mUrlRequester, TQT_SIGNAL( returnPressed( const TQString& ) ), + this, TQT_SLOT( setFile( const TQString& ) ) ); + connect( mUrlRequester, TQT_SIGNAL( urlSelected( const TQString& ) ), + this, TQT_SLOT( setFile( const TQString& ) ) ); + connect( mUrlRequester->lineEdit(), TQT_SIGNAL( textChanged ( const TQString& ) ), + this, TQT_SLOT( urlChanged( const TQString& ) ) ); + + connect( this, TQT_SIGNAL( user1Clicked() ), + this, TQT_SLOT( applyTemplate() ) ); + + connect( this, TQT_SIGNAL( user2Clicked() ), + this, TQT_SLOT( saveTemplate() ) ); } CSVImportDialog::~CSVImportDialog() @@ -174,15 +174,15 @@ KABC::AddresseeList CSVImportDialog::contacts() const KABC::Address addrHome( KABC::Address::Home ); KABC::Address addrWork( KABC::Address::Work ); for ( int col = 0; col < mTable->numCols(); ++col ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + TQComboTableItem *item = static_cast<TQComboTableItem*>( mTable->item( 0, col ) ); if ( !item ) { kdError() << "ERROR: item cast failed" << endl; continue; } - QString value = mTable->text( row, col ); - if ( 1 == row && static_cast<QTableItem *>(item)->text() == value ) + TQString value = mTable->text( row, col ); + if ( 1 == row && static_cast<TQTableItem *>(item)->text() == value ) // we are looking at a header row, stop now break; @@ -367,12 +367,12 @@ void CSVImportDialog::initGUI() { mPage = plainPage(); - QGridLayout *layout = new QGridLayout( mPage, 1, 1, marginHint(), + TQGridLayout *layout = new TQGridLayout( mPage, 1, 1, marginHint(), spacingHint() ); - QHBoxLayout *hbox = new QHBoxLayout(); + TQHBoxLayout *hbox = new TQHBoxLayout(); hbox->setSpacing( spacingHint() ); - QLabel *label = new QLabel( i18n( "File to import:" ), mPage ); + TQLabel *label = new TQLabel( i18n( "File to import:" ), mPage ); hbox->addWidget( label ); mUrlRequester = new KURLRequester( mPage ); @@ -382,46 +382,46 @@ void CSVImportDialog::initGUI() layout->addMultiCellLayout( hbox, 0, 0, 0, 4 ); // Delimiter: comma, semicolon, tab, space, other - mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), mPage ); + mDelimiterBox = new TQButtonGroup( i18n( "Delimiter" ), mPage ); mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); mDelimiterBox->layout()->setSpacing( spacingHint() ); mDelimiterBox->layout()->setMargin( marginHint() ); - QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); + TQGridLayout *delimiterLayout = new TQGridLayout( mDelimiterBox->layout() ); delimiterLayout->setAlignment( Qt::AlignTop ); layout->addMultiCellWidget( mDelimiterBox, 1, 4, 0, 0 ); - mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); + mRadioComma = new TQRadioButton( i18n( "Comma" ), mDelimiterBox ); mRadioComma->setChecked( true ); delimiterLayout->addWidget( mRadioComma, 0, 0 ); - mRadioSemicolon = new QRadioButton( i18n( "Semicolon" ), mDelimiterBox ); + mRadioSemicolon = new TQRadioButton( i18n( "Semicolon" ), mDelimiterBox ); delimiterLayout->addWidget( mRadioSemicolon, 0, 1 ); - mRadioTab = new QRadioButton( i18n( "Tabulator" ), mDelimiterBox ); + mRadioTab = new TQRadioButton( i18n( "Tabulator" ), mDelimiterBox ); delimiterLayout->addWidget( mRadioTab, 1, 0 ); - mRadioSpace = new QRadioButton( i18n( "Space" ), mDelimiterBox ); + mRadioSpace = new TQRadioButton( i18n( "Space" ), mDelimiterBox ); delimiterLayout->addWidget( mRadioSpace, 1, 1 ); - mRadioOther = new QRadioButton( i18n( "Other" ), mDelimiterBox ); + mRadioOther = new TQRadioButton( i18n( "Other" ), mDelimiterBox ); delimiterLayout->addWidget( mRadioOther, 0, 2 ); - mDelimiterEdit = new QLineEdit( mDelimiterBox ); + mDelimiterEdit = new TQLineEdit( mDelimiterBox ); delimiterLayout->addWidget( mDelimiterEdit, 1, 2 ); - mComboLine = new QComboBox( false, mPage ); + mComboLine = new TQComboBox( false, mPage ); mComboLine->insertItem( i18n( "1" ) ); layout->addWidget( mComboLine, 2, 3 ); - mComboQuote = new QComboBox( false, mPage ); + mComboQuote = new TQComboBox( false, mPage ); mComboQuote->insertItem( i18n( "\"" ), 0 ); mComboQuote->insertItem( i18n( "'" ), 1 ); mComboQuote->insertItem( i18n( "None" ), 2 ); layout->addWidget( mComboQuote, 2, 2 ); - mDatePatternEdit = new QLineEdit( mPage ); + mDatePatternEdit = new TQLineEdit( mPage ); mDatePatternEdit->setText( "Y-M-D" ); // ISO 8601 format as default - QToolTip::add( mDatePatternEdit, i18n( "<ul><li>y: year with 2 digits</li>" + TQToolTip::add( mDatePatternEdit, i18n( "<ul><li>y: year with 2 digits</li>" "<li>Y: year with 4 digits</li>" "<li>m: month with 1 or 2 digits</li>" "<li>M: month with 2 digits</li>" @@ -429,24 +429,24 @@ void CSVImportDialog::initGUI() "<li>D: day with 2 digits</li></ul>" ) ); layout->addWidget( mDatePatternEdit, 2, 4 ); - label = new QLabel( i18n( "Start at line:" ), mPage ); + label = new TQLabel( i18n( "Start at line:" ), mPage ); layout->addWidget( label, 1, 3 ); - label = new QLabel( i18n( "Textquote:" ), mPage ); + label = new TQLabel( i18n( "Textquote:" ), mPage ); layout->addWidget( label, 1, 2 ); - label = new QLabel( i18n( "Date format:" ), mPage ); + label = new TQLabel( i18n( "Date format:" ), mPage ); layout->addWidget( label, 1, 4 ); - mIgnoreDuplicates = new QCheckBox( mPage ); + mIgnoreDuplicates = new TQCheckBox( mPage ); mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); layout->addMultiCellWidget( mIgnoreDuplicates, 3, 3, 2, 4 ); - mCodecCombo = new QComboBox( mPage ); + mCodecCombo = new TQComboBox( mPage ); layout->addMultiCellWidget( mCodecCombo, 4, 4, 2, 4 ); - mTable = new QTable( 0, 0, mPage ); - mTable->setSelectionMode( QTable::NoSelection ); + mTable = new TQTable( 0, 0, mPage ); + mTable->setSelectionMode( TQTable::NoSelection ); mTable->horizontalHeader()->hide(); layout->addMultiCellWidget( mTable, 5, 5, 0, 4 ); @@ -468,13 +468,13 @@ void CSVImportDialog::fillTable() enum { S_START, S_QUOTED_FIELD, S_MAYBE_END_OF_QUOTED_FIELD, S_END_OF_QUOTED_FIELD, S_MAYBE_NORMAL_FIELD, S_NORMAL_FIELD } state = S_START; - QChar x; - QString field; + TQChar x; + TQString field; // store previous assignment mTypeStore.clear(); for ( column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + TQComboTableItem *item = static_cast<TQComboTableItem*>( mTable->item( 0, column ) ); if ( !item || mClearTypeStore ) mTypeStore.append( typeToPos( Undefined ) ); @@ -486,22 +486,22 @@ void CSVImportDialog::fillTable() row = column = 1; - QTextStream inputStream( mFileArray, IO_ReadOnly ); + TQTextStream inputStream( mFileArray, IO_ReadOnly ); // find the current codec int code = mCodecCombo->currentItem(); if ( code == Local ) - inputStream.setEncoding( QTextStream::Locale ); + inputStream.setEncoding( TQTextStream::Locale ); else if ( code >= Codec ) inputStream.setCodec( mCodecs.at( code - Codec ) ); else if ( code == Uni ) - inputStream.setEncoding( QTextStream::Unicode ); + inputStream.setEncoding( TQTextStream::Unicode ); else if ( code == MSBug ) - inputStream.setEncoding( QTextStream::UnicodeReverse ); + inputStream.setEncoding( TQTextStream::UnicodeReverse ); else if ( code == Latin1 ) - inputStream.setEncoding( QTextStream::Latin1 ); + inputStream.setEncoding( TQTextStream::Latin1 ); else if ( code == Guess ) { - QTextCodec* codec = QTextCodec::codecForContent( mFileArray.data(), mFileArray.size() ); + TQTextCodec* codec = TQTextCodec::codecForContent( mFileArray.data(), mFileArray.size() ); if ( codec ) { KMessageBox::information( this, i18n( "Using codec '%1'" ).arg( codec->name() ), i18n( "Encoding" ) ); inputStream.setCodec( codec ); @@ -627,7 +627,7 @@ void CSVImportDialog::fillTable() mTable->setNumCols( maxColumn ); for ( column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); + TQComboTableItem *item = new TQComboTableItem( mTable, mTypeMap.keys() ); mTable->setItem( 0, column, item ); if ( column < (int)mTypeStore.count() ) item->setCurrentItem( mTypeStore[ column ] ); @@ -650,7 +650,7 @@ void CSVImportDialog::fillComboBox() { mComboLine->clear(); for ( int row = 1; row < mTable->numRows() + 1; ++row ) - mComboLine->insertItem( QString::number( row ), row - 1 ); + mComboLine->insertItem( TQString::number( row ), row - 1 ); } void CSVImportDialog::reloadCodecs() @@ -659,11 +659,11 @@ void CSVImportDialog::reloadCodecs() mCodecs.clear(); - QTextCodec *codec; - for ( int i = 0; ( codec = QTextCodec::codecForIndex( i ) ); i++ ) + TQTextCodec *codec; + for ( int i = 0; ( codec = TQTextCodec::codecForIndex( i ) ); i++ ) mCodecs.append( codec ); - mCodecCombo->insertItem( i18n( "Local (%1)" ).arg( QTextCodec::codecForLocale()->name() ), Local ); + mCodecCombo->insertItem( i18n( "Local (%1)" ).arg( TQTextCodec::codecForLocale()->name() ), Local ); mCodecCombo->insertItem( i18n( "[guess]" ), Guess ); mCodecCombo->insertItem( i18n( "Latin1" ), Latin1 ); mCodecCombo->insertItem( i18n( "Unicode" ), Uni ); @@ -673,7 +673,7 @@ void CSVImportDialog::reloadCodecs() mCodecCombo->insertItem( mCodecs.at( i )->name(), Codec + i ); } -void CSVImportDialog::setText( int row, int col, const QString& text ) +void CSVImportDialog::setText( int row, int col, const TQString& text ) { if ( row < 1 ) // skipped by the user return; @@ -702,10 +702,10 @@ void CSVImportDialog::adjustRows( int rows ) void CSVImportDialog::resizeColumns() { - QFontMetrics fm = fontMetrics(); + TQFontMetrics fm = fontMetrics(); int width = 0; - QMap<QString, uint>::ConstIterator it; + TQMap<TQString, uint>::ConstIterator it; for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it ) { width = QMAX( width, fm.width( it.key() ) ); } @@ -723,7 +723,7 @@ void CSVImportDialog::returnPressed() fillTable(); } -void CSVImportDialog::textChanged ( const QString& ) +void CSVImportDialog::textChanged ( const TQString& ) { mRadioOther->setChecked ( true ); delimiterClicked( 4 ); // other @@ -752,7 +752,7 @@ void CSVImportDialog::delimiterClicked( int id ) fillTable(); } -void CSVImportDialog::textquoteSelected( const QString& mark ) +void CSVImportDialog::textquoteSelected( const TQString& mark ) { if ( mComboQuote->currentItem() == 2 ) mTextQuote = 0; @@ -762,7 +762,7 @@ void CSVImportDialog::textquoteSelected( const QString& mark ) fillTable(); } -void CSVImportDialog::lineSelected( const QString& line ) +void CSVImportDialog::lineSelected( const TQString& line ) { mStartLine = line.toInt() - 1; fillTable(); @@ -773,7 +773,7 @@ void CSVImportDialog::slotOk() bool assigned = false; for ( int column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + TQComboTableItem *item = static_cast<TQComboTableItem*>( mTable->item( 0, column ) ); if ( item && posToType( item->currentItem() ) != Undefined ) assigned = true; @@ -787,15 +787,15 @@ void CSVImportDialog::slotOk() void CSVImportDialog::applyTemplate() { - QMap<uint,int> columnMap; - QMap<QString, QString> fileMap; - QStringList templates; + TQMap<uint,int> columnMap; + TQMap<TQString, TQString> fileMap; + TQStringList templates; // load all template files - QStringList list = KGlobal::dirs()->findAllResources( "data" , QString( kapp->name() ) + + TQStringList list = KGlobal::dirs()->findAllResources( "data" , TQString( kapp->name() ) + "/csv-templates/*.desktop", true, true ); - for ( QStringList::iterator it = list.begin(); it != list.end(); ++it ) + for ( TQStringList::iterator it = list.begin(); it != list.end(); ++it ) { KSimpleConfig config( *it, true ); @@ -809,7 +809,7 @@ void CSVImportDialog::applyTemplate() // let the user chose, what to take bool ok = false; - QString tmp; + TQString tmp; tmp = KInputDialog::getItem( i18n( "Template Selection" ), i18n( "Please select a template, that matches the CSV file:" ), templates, 0, false, &ok, this ); @@ -831,14 +831,14 @@ void CSVImportDialog::applyTemplate() // create the column map config.setGroup( "csv column map" ); for ( uint i = 0; i < numColumns; ++i ) { - int col = config.readNumEntry( QString::number( i ) ); + int col = config.readNumEntry( TQString::number( i ) ); columnMap.insert( i, col ); } // apply the column map for ( uint column = 0; column < columnMap.count(); ++column ) { int type = columnMap[ column ]; - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + TQComboTableItem *item = static_cast<TQComboTableItem*>( mTable->item( 0, column ) ); if ( item ) item->setCurrentItem( typeToPos( type ) ); @@ -847,8 +847,8 @@ void CSVImportDialog::applyTemplate() void CSVImportDialog::saveTemplate() { - QString fileName = KFileDialog::getSaveFileName( - locateLocal( "data", QString( kapp->name() ) + "/csv-templates/" ), + TQString fileName = KFileDialog::getSaveFileName( + locateLocal( "data", TQString( kapp->name() ) + "/csv-templates/" ), "*.desktop", this ); if ( fileName.isEmpty() ) @@ -857,7 +857,7 @@ void CSVImportDialog::saveTemplate() if ( !fileName.contains( ".desktop" ) ) fileName += ".desktop"; - QString name = KInputDialog::getText( i18n( "Template Name" ), i18n( "Please enter a name for the template:" ) ); + TQString name = KInputDialog::getText( i18n( "Template Name" ), i18n( "Please enter a name for the template:" ) ); if ( name.isEmpty() ) return; @@ -876,19 +876,19 @@ void CSVImportDialog::saveTemplate() config.setGroup( "csv column map" ); for ( int column = 0; column < mTable->numCols(); ++column ) { - QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, + TQComboTableItem *item = static_cast<TQComboTableItem*>( mTable->item( 0, column ) ); if ( item ) - config.writeEntry( QString::number( column ), posToType( + config.writeEntry( TQString::number( column ), posToType( item->currentItem() ) ); else - config.writeEntry( QString::number( column ), 0 ); + config.writeEntry( TQString::number( column ), 0 ); } config.sync(); } -QString CSVImportDialog::getText( int row, int col ) +TQString CSVImportDialog::getText( int row, int col ) { return mTable->text( row, col ); } @@ -896,7 +896,7 @@ QString CSVImportDialog::getText( int row, int col ) uint CSVImportDialog::posToType( int pos ) const { uint counter = 0; - QMap<QString, uint>::ConstIterator it; + TQMap<TQString, uint>::ConstIterator it; for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) if ( counter == (uint)pos ) return it.data(); @@ -907,7 +907,7 @@ uint CSVImportDialog::posToType( int pos ) const int CSVImportDialog::typeToPos( uint type ) const { uint counter = 0; - QMap<QString, uint>::ConstIterator it; + TQMap<TQString, uint>::ConstIterator it; for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) if ( it.data() == type ) return counter; @@ -920,12 +920,12 @@ void CSVImportDialog::ignoreDuplicatesChanged( int ) fillTable(); } -void CSVImportDialog::setFile( const QString &fileName ) +void CSVImportDialog::setFile( const TQString &fileName ) { if ( fileName.isEmpty() ) return; - QFile file( fileName ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) { KMessageBox::sorry( this, i18n( "Cannot open input file." ) ); file.close(); @@ -945,7 +945,7 @@ void CSVImportDialog::setFile( const QString &fileName ) fillComboBox(); } -void CSVImportDialog::urlChanged( const QString &file ) +void CSVImportDialog::urlChanged( const TQString &file ) { bool state = !file.isEmpty(); diff --git a/kaddressbook/xxport/csvimportdialog.h b/kaddressbook/xxport/csvimportdialog.h index 8e9dd0710..a34f681e6 100644 --- a/kaddressbook/xxport/csvimportdialog.h +++ b/kaddressbook/xxport/csvimportdialog.h @@ -26,7 +26,7 @@ #include <kabc/addresseelist.h> #include <kdialogbase.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> class KURLRequester; @@ -43,7 +43,7 @@ class CSVImportDialog : public KDialogBase Q_OBJECT public: - CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, + CSVImportDialog( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); ~CSVImportDialog(); @@ -55,12 +55,12 @@ class CSVImportDialog : public KDialogBase private slots: void returnPressed(); void delimiterClicked( int id ); - void lineSelected( const QString& line ); - void textquoteSelected( const QString& mark ); - void textChanged ( const QString & ); + void lineSelected( const TQString& line ); + void textquoteSelected( const TQString& mark ); + void textChanged ( const TQString & ); void ignoreDuplicatesChanged( int ); - void setFile( const QString& ); - void urlChanged( const QString& ); + void setFile( const TQString& ); + void urlChanged( const TQString& ); void codecChanged(); void applyTemplate(); @@ -78,47 +78,47 @@ class CSVImportDialog : public KDialogBase Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL }; - QTable* mTable; - QButtonGroup* mDelimiterBox; - QRadioButton* mRadioComma; - QRadioButton* mRadioSemicolon; - QRadioButton* mRadioTab; - QRadioButton* mRadioSpace; - QRadioButton* mRadioOther; - QLineEdit* mDelimiterEdit; - QLineEdit* mDatePatternEdit; - QComboBox* mComboLine; - QComboBox* mComboQuote; - QCheckBox* mIgnoreDuplicates; - QComboBox* mCodecCombo; - QWidget* mPage; + TQTable* mTable; + TQButtonGroup* mDelimiterBox; + TQRadioButton* mRadioComma; + TQRadioButton* mRadioSemicolon; + TQRadioButton* mRadioTab; + TQRadioButton* mRadioSpace; + TQRadioButton* mRadioOther; + TQLineEdit* mDelimiterEdit; + TQLineEdit* mDatePatternEdit; + TQComboBox* mComboLine; + TQComboBox* mComboQuote; + TQCheckBox* mIgnoreDuplicates; + TQComboBox* mCodecCombo; + TQWidget* mPage; KURLRequester* mUrlRequester; void initGUI(); void fillTable(); void clearTable(); void fillComboBox(); - void setText( int row, int col, const QString& text ); + void setText( int row, int col, const TQString& text ); void adjustRows( int rows ); void resizeColumns(); - QString getText( int row, int col ); + TQString getText( int row, int col ); uint posToType( int pos ) const; int typeToPos( uint type ) const; void reloadCodecs(); - QTextCodec *currentCodec(); - QPtrList<QTextCodec> mCodecs; + TQTextCodec *currentCodec(); + TQPtrList<TQTextCodec> mCodecs; bool mAdjustRows; int mStartLine; - QChar mTextQuote; - QString mDelimiter; - QByteArray mFileArray; - QMap<QString, uint> mTypeMap; + TQChar mTextQuote; + TQString mDelimiter; + TQByteArray mFileArray; + TQMap<TQString, uint> mTypeMap; KABC::AddressBook *mAddressBook; int mCustomCounter; bool mClearTypeStore; - QValueList<int> mTypeStore; + TQValueList<int> mTypeStore; }; #endif diff --git a/kaddressbook/xxport/dateparser.cpp b/kaddressbook/xxport/dateparser.cpp index ed485e0dd..2052407a6 100644 --- a/kaddressbook/xxport/dateparser.cpp +++ b/kaddressbook/xxport/dateparser.cpp @@ -21,11 +21,11 @@ without including the source code for Qt in the source distribution. */ -#include <qdatetime.h> +#include <tqdatetime.h> #include "dateparser.h" -DateParser::DateParser( const QString &pattern ) +DateParser::DateParser( const TQString &pattern ) : mPattern( pattern ) { } @@ -34,7 +34,7 @@ DateParser::~DateParser() { } -QDate DateParser::parse( const QString &dateStr ) const +TQDate DateParser::parse( const TQString &dateStr ) const { int year, month, day; year = month = day = 0; @@ -46,13 +46,13 @@ QDate DateParser::parse( const QString &dateStr ) const year = 1900 + dateStr.mid( currPos, 2 ).toInt(); currPos += 2; } else - return QDate(); + return TQDate(); } else if ( mPattern[ i ] == 'Y' ) { // YYYY if ( currPos + 3 < dateStr.length() ) { year = dateStr.mid( currPos, 4 ).toInt(); currPos += 4; } else - return QDate(); + return TQDate(); } else if ( mPattern[ i ] == 'm' ) { // M or MM if ( currPos + 1 < dateStr.length() ) { if ( dateStr[ currPos ].isDigit() ) { @@ -71,13 +71,13 @@ QDate DateParser::parse( const QString &dateStr ) const } } - return QDate(); + return TQDate(); } else if ( mPattern[ i ] == 'M' ) { // 0M or MM if ( currPos + 1 < dateStr.length() ) { month = dateStr.mid( currPos, 2 ).toInt(); currPos += 2; } else - return QDate(); + return TQDate(); } else if ( mPattern[ i ] == 'd' ) { // D or DD if ( currPos + 1 < dateStr.length() ) { if ( dateStr[ currPos ].isDigit() ) { @@ -96,17 +96,17 @@ QDate DateParser::parse( const QString &dateStr ) const } } - return QDate(); + return TQDate(); } else if ( mPattern[ i ] == 'D' ) { // 0D or DD if ( currPos + 1 < dateStr.length() ) { day = dateStr.mid( currPos, 2 ).toInt(); currPos += 2; } else - return QDate(); + return TQDate(); } else { currPos++; } } - return QDate( year, month, day ); + return TQDate( year, month, day ); } diff --git a/kaddressbook/xxport/dateparser.h b/kaddressbook/xxport/dateparser.h index 93eb597da..3087d339a 100644 --- a/kaddressbook/xxport/dateparser.h +++ b/kaddressbook/xxport/dateparser.h @@ -24,7 +24,7 @@ #ifndef DATEPARSER_H #define DATEPARSER_H -#include <qstring.h> +#include <tqstring.h> /** This class parses the date out of a given string with the @@ -40,12 +40,12 @@ class DateParser { public: - DateParser( const QString &pattern ); + DateParser( const TQString &pattern ); ~DateParser(); - QDate parse( const QString &dateStr ) const; + TQDate parse( const TQString &dateStr ) const; private: - QString mPattern; + TQString mPattern; }; #endif diff --git a/kaddressbook/xxport/eudora_xxport.cpp b/kaddressbook/xxport/eudora_xxport.cpp index bb4ae373b..d31cd1115 100644 --- a/kaddressbook/xxport/eudora_xxport.cpp +++ b/kaddressbook/xxport/eudora_xxport.cpp @@ -21,7 +21,7 @@ without including the source code for Qt in the source distribution. */ -#include <qfile.h> +#include <tqfile.h> #include <kfiledialog.h> #include <kio/netaccess.h> @@ -38,25 +38,25 @@ K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_eudora_xxport, EudoraXXPort ) -EudoraXXPort::EudoraXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +EudoraXXPort::EudoraXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createImportAction( i18n( "Import Eudora Addressbook..." ) ); } -KABC::AddresseeList EudoraXXPort::importContacts( const QString& ) const +KABC::AddresseeList EudoraXXPort::importContacts( const TQString& ) const { - QString fileName = KFileDialog::getOpenFileName( QDir::homeDirPath(), + TQString fileName = KFileDialog::getOpenFileName( TQDir::homeDirPath(), "*.[tT][xX][tT]|" + i18n("Eudora Light Addressbook (*.txt)"), 0 ); if ( fileName.isEmpty() ) return KABC::AddresseeList(); - QFile file( fileName ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) return KABC::AddresseeList(); - QString line; - QTextStream stream( &file ); + TQString line; + TQTextStream stream( &file ); KABC::Addressee *a = 0; int bytesRead = 0; @@ -65,7 +65,7 @@ KABC::AddresseeList EudoraXXPort::importContacts( const QString& ) const while( !stream.eof() ) { line = stream.readLine(); bytesRead += line.length(); - QString tmp; + TQString tmp; if ( line.startsWith( "alias" ) ) { if ( a ) { // Write it out @@ -120,10 +120,10 @@ KABC::AddresseeList EudoraXXPort::importContacts( const QString& ) const return list; } -QString EudoraXXPort::key( const QString& line) const +TQString EudoraXXPort::key( const TQString& line) const { int e; - QString result; + TQString result; int b = line.find( '\"', 0 ); if ( b == -1 ) { @@ -148,10 +148,10 @@ QString EudoraXXPort::key( const QString& line) const return result; } -QString EudoraXXPort::email( const QString& line ) const +TQString EudoraXXPort::email( const TQString& line ) const { int b; - QString result; + TQString result; b = line.findRev( '\"' ); if ( b == -1 ) { b = line.findRev( ' ' ); @@ -163,10 +163,10 @@ QString EudoraXXPort::email( const QString& line ) const return result; } -QString EudoraXXPort::comment( const QString& line ) const +TQString EudoraXXPort::comment( const TQString& line ) const { int b; - QString result; + TQString result; uint i; b = line.findRev( '>' ); if ( b == -1 ) { @@ -184,24 +184,24 @@ QString EudoraXXPort::comment( const QString& line ) const return result; } -QString EudoraXXPort::get( const QString& line, const QString& key ) const +TQString EudoraXXPort::get( const TQString& line, const TQString& key ) const { - QString fd = "<" + key + ":"; + TQString fd = "<" + key + ":"; int b, e; uint i; // Find formatted key, return on error b = line.find( fd ); if ( b == -1 ) - return QString::null; + return TQString::null; b += fd.length(); e = line.find( '>', b ); if ( e == -1 ) - return QString::null; + return TQString::null; e--; - QString result = line.mid( b, e - b + 1 ); + TQString result = line.mid( b, e - b + 1 ); for ( i = 0; i < result.length(); i++ ) { if ( result[ i ] == CTRL_C ) result[ i ] = '\n'; diff --git a/kaddressbook/xxport/eudora_xxport.h b/kaddressbook/xxport/eudora_xxport.h index be1df8ead..0181aa318 100644 --- a/kaddressbook/xxport/eudora_xxport.h +++ b/kaddressbook/xxport/eudora_xxport.h @@ -31,19 +31,19 @@ class EudoraXXPort : public KAB::XXPort Q_OBJECT public: - EudoraXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + EudoraXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "eudora"; } + TQString identifier() const { return "eudora"; } public slots: - KABC::AddresseeList importContacts( const QString &data ) const; + KABC::AddresseeList importContacts( const TQString &data ) const; private: - QString get( const QString& line, const QString& key ) const; - QString comment( const QString& line ) const; - QString email( const QString& line ) const; - QString key( const QString& line ) const; - int find( const QString& key ) const; + TQString get( const TQString& line, const TQString& key ) const; + TQString comment( const TQString& line ) const; + TQString email( const TQString& line ) const; + TQString key( const TQString& line ) const; + int find( const TQString& key ) const; }; #endif 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" diff --git a/kaddressbook/xxport/gnokii_xxport.h b/kaddressbook/xxport/gnokii_xxport.h index 64176fcaf..edee6abbe 100644 --- a/kaddressbook/xxport/gnokii_xxport.h +++ b/kaddressbook/xxport/gnokii_xxport.h @@ -31,13 +31,13 @@ class GNOKIIXXPort : public KAB::XXPort Q_OBJECT public: - GNOKIIXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + GNOKIIXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "gnokii"; } + TQString identifier() const { return "gnokii"; } 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; }; #endif diff --git a/kaddressbook/xxport/kde2_xxport.cpp b/kaddressbook/xxport/kde2_xxport.cpp index 03a524e9f..8e754b39c 100644 --- a/kaddressbook/xxport/kde2_xxport.cpp +++ b/kaddressbook/xxport/kde2_xxport.cpp @@ -21,7 +21,7 @@ without including the source code for Qt in the source distribution. */ -#include <qfile.h> +#include <tqfile.h> #include <kdebug.h> #include <kfiledialog.h> @@ -39,16 +39,16 @@ K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_kde2_xxport, KDE2XXPort ) -KDE2XXPort::KDE2XXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +KDE2XXPort::KDE2XXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createImportAction( i18n( "Import KDE 2 Addressbook..." ) ); } -KABC::AddresseeList KDE2XXPort::importContacts( const QString& ) const +KABC::AddresseeList KDE2XXPort::importContacts( const TQString& ) const { - QString fileName = locateLocal( "data", "kabc/std.vcf" ); - if ( !QFile::exists( fileName ) ) { + TQString fileName = locateLocal( "data", "kabc/std.vcf" ); + if ( !TQFile::exists( fileName ) ) { KMessageBox::sorry( parentWidget(), i18n( "<qt>Could not find a KDE 2 address book <b>%1</b>.</qt>" ).arg( fileName ) ); return KABC::AddresseeList(); } diff --git a/kaddressbook/xxport/kde2_xxport.h b/kaddressbook/xxport/kde2_xxport.h index 4f5f2edb0..a56bc0288 100644 --- a/kaddressbook/xxport/kde2_xxport.h +++ b/kaddressbook/xxport/kde2_xxport.h @@ -31,12 +31,12 @@ class KDE2XXPort : public KAB::XXPort Q_OBJECT public: - KDE2XXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + KDE2XXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "kde2"; } + TQString identifier() const { return "kde2"; } public slots: - KABC::AddresseeList importContacts( const QString &data ) const; + KABC::AddresseeList importContacts( const TQString &data ) const; }; #endif diff --git a/kaddressbook/xxport/ldif_xxport.cpp b/kaddressbook/xxport/ldif_xxport.cpp index 342ff9d81..d632d449b 100644 --- a/kaddressbook/xxport/ldif_xxport.cpp +++ b/kaddressbook/xxport/ldif_xxport.cpp @@ -33,7 +33,7 @@ into your KDE Addressbook. */ -#include <qfile.h> +#include <tqfile.h> #include <kfiledialog.h> #include <kio/netaccess.h> @@ -50,7 +50,7 @@ K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_ldif_xxport, LDIFXXPort ) -LDIFXXPort::LDIFXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +LDIFXXPort::LDIFXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createImportAction( i18n( "Import LDIF Addressbook..." ) ); @@ -59,26 +59,26 @@ LDIFXXPort::LDIFXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name /* import */ -KABC::AddresseeList LDIFXXPort::importContacts( const QString& ) const +KABC::AddresseeList LDIFXXPort::importContacts( const TQString& ) const { KABC::AddresseeList addrList; - QString fileName = KFileDialog::getOpenFileName( QDir::homeDirPath(), + TQString fileName = KFileDialog::getOpenFileName( TQDir::homeDirPath(), "text/x-ldif", 0 ); if ( fileName.isEmpty() ) return addrList; - QFile file( fileName ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) { - QString msg = i18n( "<qt>Unable to open <b>%1</b> for reading.</qt>" ); + TQString msg = i18n( "<qt>Unable to open <b>%1</b> for reading.</qt>" ); KMessageBox::error( parentWidget(), msg.arg( fileName ) ); return addrList; } - QTextStream t( &file ); - t.setEncoding( QTextStream::Latin1 ); - QString wholeFile = t.read(); - QDateTime dtDefault = QFileInfo(file).lastModified(); + TQTextStream t( &file ); + t.setEncoding( TQTextStream::Latin1 ); + TQString wholeFile = t.read(); + TQDateTime dtDefault = TQFileInfo(file).lastModified(); file.close(); KABC::LDIFConverter::LDIFToAddressee( wholeFile, addrList, dtDefault ); @@ -89,9 +89,9 @@ KABC::AddresseeList LDIFXXPort::importContacts( const QString& ) const /* export */ -bool LDIFXXPort::exportContacts( const KABC::AddresseeList &list, const QString& ) +bool LDIFXXPort::exportContacts( const KABC::AddresseeList &list, const TQString& ) { - KURL url = KFileDialog::getSaveURL( QDir::homeDirPath() + "/addressbook.ldif", + KURL url = KFileDialog::getSaveURL( TQDir::homeDirPath() + "/addressbook.ldif", "text/x-ldif" ); if ( url.isEmpty() ) return true; @@ -99,7 +99,7 @@ bool LDIFXXPort::exportContacts( const KABC::AddresseeList &list, const QString& if ( !url.isLocalFile() ) { KTempFile tmpFile; if ( tmpFile.status() != 0 ) { - QString txt = i18n( "<qt>Unable to open file <b>%1</b>.%2.</qt>" ); + TQString txt = i18n( "<qt>Unable to open file <b>%1</b>.%2.</qt>" ); KMessageBox::error( parentWidget(), txt.arg( url.url() ) .arg( strerror( tmpFile.status() ) ) ); return false; @@ -110,11 +110,11 @@ bool LDIFXXPort::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( "<qt>Unable to open file <b>%1</b>.</qt>" ); + TQString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); KMessageBox::error( parentWidget(), txt.arg( filename ) ); return false; } @@ -126,13 +126,13 @@ bool LDIFXXPort::exportContacts( const KABC::AddresseeList &list, const QString& } } -void LDIFXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) +void LDIFXXPort::doExport( TQFile *fp, const KABC::AddresseeList &list ) { - QString str; + TQString str; KABC::LDIFConverter::addresseeToLDIF( list, str ); - QTextStream t( fp ); - t.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream t( fp ); + t.setEncoding( TQTextStream::UnicodeUTF8 ); t << str; } diff --git a/kaddressbook/xxport/ldif_xxport.h b/kaddressbook/xxport/ldif_xxport.h index d5ae2cdd3..72c047d64 100644 --- a/kaddressbook/xxport/ldif_xxport.h +++ b/kaddressbook/xxport/ldif_xxport.h @@ -32,16 +32,16 @@ class LDIFXXPort : public KAB::XXPort Q_OBJECT public: - LDIFXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + LDIFXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "ldif"; } + TQString identifier() const { return "ldif"; } 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/xxport/opera_xxport.cpp b/kaddressbook/xxport/opera_xxport.cpp index c3d707b88..474a66723 100644 --- a/kaddressbook/xxport/opera_xxport.cpp +++ b/kaddressbook/xxport/opera_xxport.cpp @@ -22,8 +22,8 @@ without including the source code for Qt in the source distribution. */ -#include <qfile.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqregexp.h> #include <kfiledialog.h> #include <kio/netaccess.h> @@ -38,39 +38,39 @@ K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_opera_xxport, OperaXXPort ) -OperaXXPort::OperaXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +OperaXXPort::OperaXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createImportAction( i18n( "Import Opera Addressbook..." ) ); } -KABC::AddresseeList OperaXXPort::importContacts( const QString& ) const +KABC::AddresseeList OperaXXPort::importContacts( const TQString& ) const { KABC::AddresseeList addrList; - QString fileName = KFileDialog::getOpenFileName( QDir::homeDirPath() + QString::fromLatin1( "/.opera/contacts.adr" ) ); + TQString fileName = KFileDialog::getOpenFileName( TQDir::homeDirPath() + TQString::fromLatin1( "/.opera/contacts.adr" ) ); if ( fileName.isEmpty() ) return addrList; - QFile file( fileName ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) { - QString msg = i18n( "<qt>Unable to open <b>%1</b> for reading.</qt>" ); + TQString msg = i18n( "<qt>Unable to open <b>%1</b> for reading.</qt>" ); KMessageBox::error( parentWidget(), msg.arg( fileName ) ); return addrList; } - QTextStream stream( &file ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); - QString line, key, value; + TQTextStream stream( &file ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); + TQString line, key, value; bool parseContact = false; KABC::Addressee addr; - QRegExp separator( "\x02\x02" ); + TQRegExp separator( "\x02\x02" ); while ( !stream.atEnd() ) { line = stream.readLine(); line = line.stripWhiteSpace(); - if ( line == QString::fromLatin1( "#CONTACT" ) ) { + if ( line == TQString::fromLatin1( "#CONTACT" ) ) { parseContact = true; addr = KABC::Addressee(); continue; @@ -87,31 +87,31 @@ KABC::AddresseeList OperaXXPort::importContacts( const QString& ) const int sep = line.find( '=' ); key = line.left( sep ).lower(); value = line.mid( sep + 1 ); - if ( key == QString::fromLatin1( "name" ) ) + if ( key == TQString::fromLatin1( "name" ) ) addr.setNameFromString( value ); - else if ( key == QString::fromLatin1( "mail" ) ) { - QStringList emails = QStringList::split( separator, value ); + else if ( key == TQString::fromLatin1( "mail" ) ) { + TQStringList emails = TQStringList::split( separator, value ); - QStringList::Iterator it = emails.begin(); + TQStringList::Iterator it = emails.begin(); bool preferred = true; for ( ; it != emails.end(); ++it ) { addr.insertEmail( *it, preferred ); preferred = false; } - } else if ( key == QString::fromLatin1( "phone" ) ) + } else if ( key == TQString::fromLatin1( "phone" ) ) addr.insertPhoneNumber( KABC::PhoneNumber( value ) ); - else if ( key == QString::fromLatin1( "fax" ) ) + else if ( key == TQString::fromLatin1( "fax" ) ) addr.insertPhoneNumber( KABC::PhoneNumber( value, KABC::PhoneNumber::Fax | KABC::PhoneNumber::Home ) ); - else if ( key == QString::fromLatin1( "postaladdress" ) ) { + else if ( key == TQString::fromLatin1( "postaladdress" ) ) { KABC::Address address( KABC::Address::Home ); address.setLabel( value.replace( separator, "\n" ) ); addr.insertAddress( address ); - } else if ( key == QString::fromLatin1( "description" ) ) + } else if ( key == TQString::fromLatin1( "description" ) ) addr.setNote( value.replace( separator, "\n" ) ); - else if ( key == QString::fromLatin1( "url" ) ) + else if ( key == TQString::fromLatin1( "url" ) ) addr.setUrl( KURL( value ) ); - else if ( key == QString::fromLatin1( "pictureurl" ) ) { + else if ( key == TQString::fromLatin1( "pictureurl" ) ) { KABC::Picture pic( value ); addr.setPhoto( pic ); } diff --git a/kaddressbook/xxport/opera_xxport.h b/kaddressbook/xxport/opera_xxport.h index ec4838be1..7730dde56 100644 --- a/kaddressbook/xxport/opera_xxport.h +++ b/kaddressbook/xxport/opera_xxport.h @@ -32,12 +32,12 @@ class OperaXXPort : public KAB::XXPort Q_OBJECT public: - OperaXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + OperaXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "opera"; } + TQString identifier() const { return "opera"; } public slots: - KABC::AddresseeList importContacts( const QString &data ) const; + KABC::AddresseeList importContacts( const TQString &data ) const; }; #endif diff --git a/kaddressbook/xxport/pab_mapihd.cpp b/kaddressbook/xxport/pab_mapihd.cpp index bcf541d75..6d61cb339 100644 --- a/kaddressbook/xxport/pab_mapihd.cpp +++ b/kaddressbook/xxport/pab_mapihd.cpp @@ -151,7 +151,7 @@ pabrec_entry e=pr_unknown; return e; } -pabfields_t::pabfields_t(pabrec & R, QWidget * /*parent*/) +pabfields_t::pabfields_t(pabrec & R, TQWidget * /*parent*/) { // Skip the first two words, because they're always the // same 000c 0014 ==> 0014 gives us the types, so we @@ -180,11 +180,11 @@ pabfields_t::pabfields_t(pabrec & R, QWidget * /*parent*/) for(i=2,k=0;i<R.N() && k<tags.size();i++,k++) { if (!isUsed(k)) { i-=1; } else {pabrec_entry e; - QString E; + TQString E; e=isWhat(k); E=R.getEntry(i); - { QString s=E; + { TQString s=E; s=s.stripWhiteSpace(); E=s; } diff --git a/kaddressbook/xxport/pab_mapihd.h b/kaddressbook/xxport/pab_mapihd.h index c4bb58a77..c54be4500 100644 --- a/kaddressbook/xxport/pab_mapihd.h +++ b/kaddressbook/xxport/pab_mapihd.h @@ -18,7 +18,7 @@ #ifndef _MAPIHD_H_ #define _MAPIHD_H_ -#include <qmemarray.h> +#include <tqmemarray.h> #include "pab_xxport.h" @@ -90,9 +90,9 @@ class pabfields_t { private: - QMemArray<mapitag_t> tags,context_tags; + TQMemArray<mapitag_t> tags,context_tags; pabrec *m_R; - QString givenName,email, + TQString givenName,email, title,firstName,additionalName,lastName, address,town,state,zip,country, organization,department,subDep,job, @@ -105,7 +105,7 @@ word_t literal(int k); content_t order(int k); public: - pabfields_t(pabrec & R, QWidget *parent); + pabfields_t(pabrec & R, TQWidget *parent); public: KABC::Addressee get( ); bool isOK(void) { return OK; } diff --git a/kaddressbook/xxport/pab_pablib.cpp b/kaddressbook/xxport/pab_pablib.cpp index c56c4e9a3..344647f6f 100644 --- a/kaddressbook/xxport/pab_pablib.cpp +++ b/kaddressbook/xxport/pab_pablib.cpp @@ -45,7 +45,7 @@ bool pab::convert(void) adr_t A; bool ret; - if (!in.isOpen()) {QString msg; + if (!in.isOpen()) {TQString msg; msg=i18n("Cannot open %1 for reading").arg(pabfile); // info->alert(msg); return false; @@ -242,7 +242,7 @@ bool pab::knownPAB(void) { content_t id; id=go(0); - if (id!=PAB_FILE_ID) {QString msg; + if (id!=PAB_FILE_ID) {TQString msg; msg=i18n("%1 has no PAB id that I know of, cannot convert this").arg(pabfile); // info->alert(msg); return false; diff --git a/kaddressbook/xxport/pab_pablib.h b/kaddressbook/xxport/pab_pablib.h index ff54a32a2..c26cbdf23 100644 --- a/kaddressbook/xxport/pab_pablib.h +++ b/kaddressbook/xxport/pab_pablib.h @@ -20,7 +20,7 @@ #define PAB_LIB_HXX #include <klocale.h> -#include <qfile.h> +#include <tqfile.h> #include "pab_mapihd.h" @@ -33,10 +33,10 @@ class pab friend class pabrec; private: - QFile in; + TQFile in; const char *pabfile; - QString cap; - QWidget *parent; + TQString cap; + TQWidget *parent; public: pab(const char *pabFile); ~pab(); diff --git a/kaddressbook/xxport/pab_xxport.cpp b/kaddressbook/xxport/pab_xxport.cpp index 621e5d2c2..21ac67c07 100644 --- a/kaddressbook/xxport/pab_xxport.cpp +++ b/kaddressbook/xxport/pab_xxport.cpp @@ -22,7 +22,7 @@ without including the source code for Qt in the source distribution. */ -#include <qfile.h> +#include <tqfile.h> #include <kdebug.h> #include <kfiledialog.h> @@ -40,26 +40,26 @@ K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_pab_xxport, PABXXPort ) -PABXXPort::PABXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +PABXXPort::PABXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createImportAction( i18n("Import MS Exchange Personal Address Book (.PAB)") ); } -KABC::AddresseeList PABXXPort::importContacts( const QString& ) const +KABC::AddresseeList PABXXPort::importContacts( const TQString& ) const { KABC::AddresseeList addrList; - QString fileName = KFileDialog::getOpenFileName( QDir::homeDirPath(), + TQString fileName = KFileDialog::getOpenFileName( TQDir::homeDirPath(), "*.[pP][aA][bB]|" + i18n("MS Exchange Personal Address Book Files (*.pab)"), 0 ); if ( fileName.isEmpty() ) return addrList; - if ( !QFile::exists( fileName ) ) { + if ( !TQFile::exists( fileName ) ) { KMessageBox::sorry( parentWidget(), i18n( "<qt>Could not find a MS Exchange Personal Address Book <b>%1</b>.</qt>" ).arg( fileName ) ); return addrList; } - // pab PAB(QFile::encodeName(file),this,info); + // pab PAB(TQFile::encodeName(file),this,info); // info->setFrom(file); // PAB.convert(); diff --git a/kaddressbook/xxport/pab_xxport.h b/kaddressbook/xxport/pab_xxport.h index 5c1edb508..e98b56bfa 100644 --- a/kaddressbook/xxport/pab_xxport.h +++ b/kaddressbook/xxport/pab_xxport.h @@ -32,15 +32,15 @@ class PABXXPort : public KAB::XXPort Q_OBJECT public: - PABXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + PABXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "pab"; } + TQString identifier() const { return "pab"; } public slots: - KABC::AddresseeList importContacts( const QString &data ) const; + KABC::AddresseeList importContacts( const TQString &data ) const; private: - void doExport( QFile *fp, const KABC::AddresseeList &list ); + void doExport( TQFile *fp, const KABC::AddresseeList &list ); }; diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp index 9fb368278..85cf8c763 100644 --- a/kaddressbook/xxport/vcard_xxport.cpp +++ b/kaddressbook/xxport/vcard_xxport.cpp @@ -21,12 +21,12 @@ without including the source code for Qt in the source distribution. */ -#include <qcheckbox.h> -#include <qfile.h> -#include <qfont.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> +#include <tqcheckbox.h> +#include <tqfile.h> +#include <tqfont.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> #include <kabc/vcardconverter.h> #include <kdialogbase.h> @@ -56,7 +56,7 @@ class VCardViewerDialog : public KDialogBase { public: VCardViewerDialog( const KABC::Addressee::List &list, - QWidget *parent, const char *name = 0 ); + TQWidget *parent, const char *name = 0 ); KABC::Addressee::List contacts() const; @@ -78,7 +78,7 @@ class VCardViewerDialog : public KDialogBase class VCardExportSelectionDialog : public KDialogBase { public: - VCardExportSelectionDialog( QWidget *parent, const char *name = 0 ); + VCardExportSelectionDialog( TQWidget *parent, const char *name = 0 ); ~VCardExportSelectionDialog(); bool exportPrivateFields() const; @@ -87,13 +87,13 @@ class VCardExportSelectionDialog : public KDialogBase bool exportEncryptionKeys() const; private: - QCheckBox *mPrivateBox; - QCheckBox *mBusinessBox; - QCheckBox *mOtherBox; - QCheckBox *mEncryptionKeys; + TQCheckBox *mPrivateBox; + TQCheckBox *mBusinessBox; + TQCheckBox *mOtherBox; + TQCheckBox *mEncryptionKeys; }; -VCardXXPort::VCardXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) +VCardXXPort::VCardXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createImportAction( i18n( "Import vCard..." ) ); @@ -101,7 +101,7 @@ VCardXXPort::VCardXXPort( KABC::AddressBook *ab, QWidget *parent, const char *na createExportAction( i18n( "Export vCard 3.0..." ), "v30" ); } -bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const QString &data ) +bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQString &data ) { KABC::VCardConverter converter; KURL url; @@ -122,10 +122,10 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const QSt else ok = doExport( url, converter.createVCards( list, KABC::VCardConverter::v3_0 ) ); } else { - QString msg = i18n( "You have selected a list of contacts, shall they be " + TQString msg = i18n( "You have selected a list of contacts, shall they be " "exported to several files?" ); - switch ( KMessageBox::questionYesNo( parentWidget(), msg, QString::null, i18n("Export to Several Files"), i18n("Export to One File") ) ) { + switch ( KMessageBox::questionYesNo( parentWidget(), msg, TQString::null, i18n("Export to Several Files"), i18n("Export to One File") ) ) { case KMessageBox::Yes: { KURL baseUrl = KFileDialog::getExistingURL(); if ( baseUrl.isEmpty() ) @@ -134,15 +134,15 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const QSt KABC::AddresseeList::ConstIterator it; uint counter = 0; for ( it = list.begin(); it != list.end(); ++it ) { - QString testUrl; + TQString testUrl; if ( (*it).givenName().isEmpty() && (*it).familyName().isEmpty() ) testUrl = baseUrl.url() + "/" + (*it).organization(); else testUrl = baseUrl.url() + "/" + (*it).givenName() + "_" + (*it).familyName(); - if ( KIO::NetAccess::exists( testUrl + (counter == 0 ? "" : QString::number( counter )) + ".vcf", false, parentWidget() ) ) { + if ( KIO::NetAccess::exists( testUrl + (counter == 0 ? "" : TQString::number( counter )) + ".vcf", false, parentWidget() ) ) { counter++; - url = testUrl + QString::number( counter ) + ".vcf"; + url = testUrl + TQString::number( counter ) + ".vcf"; } else url = testUrl + ".vcf"; @@ -176,9 +176,9 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const QSt return ok; } -KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const +KABC::AddresseeList VCardXXPort::importContacts( const TQString& ) const { - QString fileName; + TQString fileName; KABC::AddresseeList addrList; KURL::List urls; @@ -186,7 +186,7 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const addrList = parseVCard( XXPortManager::importData ); else { if ( XXPortManager::importURL.isEmpty() ) - urls = KFileDialog::getOpenURLs( QString::null, "*.vcf|vCards", parentWidget(), + urls = KFileDialog::getOpenURLs( TQString::null, "*.vcf|vCards", parentWidget(), i18n( "Select vCard to Import" ) ); else urls.append( XXPortManager::importURL ); @@ -194,31 +194,31 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const if ( urls.count() == 0 ) return addrList; - QString caption( i18n( "vCard Import Failed" ) ); + TQString caption( i18n( "vCard Import Failed" ) ); bool anyFailures = false; KURL::List::Iterator it; for ( it = urls.begin(); it != urls.end(); ++it ) { if ( KIO::NetAccess::download( *it, fileName, parentWidget() ) ) { - QFile file( fileName ); + TQFile file( fileName ); if ( file.open( IO_ReadOnly ) ) { - QByteArray rawData = file.readAll(); + TQByteArray rawData = file.readAll(); file.close(); if ( rawData.size() > 0 ) addrList += parseVCard( rawData ); KIO::NetAccess::removeTempFile( fileName ); } else { - QString text = i18n( "<qt>When trying to read the vCard, there was an error opening the file '%1': %2</qt>" ); + TQString text = i18n( "<qt>When trying to read the vCard, there was an error opening the file '%1': %2</qt>" ); text = text.arg( (*it).url() ); - text = text.arg( kapp->translate( "QFile", + text = text.arg( kapp->translate( "TQFile", file.errorString().latin1() ) ); KMessageBox::error( parentWidget(), text, caption ); anyFailures = true; } } else { - QString text = i18n( "<qt>Unable to access vCard: %1</qt>" ); + TQString text = i18n( "<qt>Unable to access vCard: %1</qt>" ); text = text.arg( KIO::NetAccess::lastErrorString() ); KMessageBox::error( parentWidget(), text, caption ); anyFailures = true; @@ -243,20 +243,20 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const return addrList; } -KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const +KABC::AddresseeList VCardXXPort::parseVCard( const TQString &data ) const { KABC::VCardConverter converter; return converter.parseVCards( data ); } -bool VCardXXPort::doExport( const KURL &url, const QString &data ) +bool VCardXXPort::doExport( const KURL &url, const TQString &data ) { KTempFile tmpFile; tmpFile.setAutoDelete( true ); - QTextStream stream( tmpFile.file() ); - stream.setEncoding( QTextStream::UnicodeUTF8 ); + TQTextStream stream( tmpFile.file() ); + stream.setEncoding( TQTextStream::UnicodeUTF8 ); stream << data; tmpFile.close(); @@ -364,7 +364,7 @@ KABC::AddresseeList VCardXXPort::filterContacts( const KABC::AddresseeList &addr void VCardXXPort::addKey( KABC::Addressee &addr, KABC::Key::Types type ) { - QString fingerprint = addr.custom( "KADDRESSBOOK", + TQString fingerprint = addr.custom( "KADDRESSBOOK", (type == KABC::Key::PGP ? "OPENPGPFP" : "SMIMEFP") ); if ( fingerprint.isEmpty() ) return; @@ -398,23 +398,23 @@ void VCardXXPort::addKey( KABC::Addressee &addr, KABC::Key::Types type ) // ---------- VCardViewer Dialog ---------------- // VCardViewerDialog::VCardViewerDialog( const KABC::Addressee::List &list, - QWidget *parent, const char *name ) + TQWidget *parent, const char *name ) : KDialogBase( Plain, i18n( "Import vCard" ), Yes | No | Apply | Cancel, Yes, parent, name, true, true, KStdGuiItem::no(), KStdGuiItem::yes() ), mContacts( list ) { - QFrame *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); + TQFrame *page = plainPage(); + TQVBoxLayout *layout = new TQVBoxLayout( page, marginHint(), spacingHint() ); - QLabel *label = new QLabel( i18n( "Do you want to import this contact in your address book?" ), page ); - QFont font = label->font(); + TQLabel *label = new TQLabel( i18n( "Do you want to import this contact in your address book?" ), page ); + TQFont font = label->font(); font.setBold( true ); label->setFont( font ); layout->addWidget( label ); mView = new KPIM::AddresseeView( page ); mView->enableLinks( 0 ); - mView->setVScrollBarMode( QScrollView::Auto ); + mView->setVScrollBarMode( TQScrollView::Auto ); layout->addWidget( mView ); setButtonText( Apply, i18n( "Import All..." ) ); @@ -459,39 +459,39 @@ void VCardViewerDialog::slotUser2() void VCardViewerDialog::slotApply() { - QDialog::accept(); + TQDialog::accept(); } void VCardViewerDialog::slotCancel() { mContacts.clear(); - QDialog::accept(); + TQDialog::accept(); } // ---------- VCardExportSelection Dialog ---------------- // -VCardExportSelectionDialog::VCardExportSelectionDialog( QWidget *parent, +VCardExportSelectionDialog::VCardExportSelectionDialog( TQWidget *parent, const char *name ) : KDialogBase( Plain, i18n( "Select vCard Fields" ), Ok | Cancel, Ok, parent, name, true, true ) { - QFrame *page = plainPage(); + TQFrame *page = plainPage(); - QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); + TQVBoxLayout *layout = new TQVBoxLayout( page, marginHint(), spacingHint() ); - QLabel *label = new QLabel( i18n( "Select the fields which shall be exported in the vCard." ), page ); + TQLabel *label = new TQLabel( i18n( "Select the fields which shall be exported in the vCard." ), page ); layout->addWidget( label ); - mPrivateBox = new QCheckBox( i18n( "Private fields" ), page ); + mPrivateBox = new TQCheckBox( i18n( "Private fields" ), page ); layout->addWidget( mPrivateBox ); - mBusinessBox = new QCheckBox( i18n( "Business fields" ), page ); + mBusinessBox = new TQCheckBox( i18n( "Business fields" ), page ); layout->addWidget( mBusinessBox ); - mOtherBox = new QCheckBox( i18n( "Other fields" ), page ); + mOtherBox = new TQCheckBox( i18n( "Other fields" ), page ); layout->addWidget( mOtherBox ); - mEncryptionKeys = new QCheckBox( i18n( "Encryption keys" ), page ); + mEncryptionKeys = new TQCheckBox( i18n( "Encryption keys" ), page ); layout->addWidget( mEncryptionKeys ); KConfig config( "kaddressbookrc" ); diff --git a/kaddressbook/xxport/vcard_xxport.h b/kaddressbook/xxport/vcard_xxport.h index d67aaeffe..8208e23c6 100644 --- a/kaddressbook/xxport/vcard_xxport.h +++ b/kaddressbook/xxport/vcard_xxport.h @@ -31,17 +31,17 @@ class VCardXXPort : public KAB::XXPort Q_OBJECT public: - VCardXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + VCardXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name = 0 ); - QString identifier() const { return "vcard"; } + TQString identifier() const { return "vcard"; } 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: - KABC::AddresseeList parseVCard( const QString &data ) const; - bool doExport( const KURL &url, const QString &data ); + KABC::AddresseeList parseVCard( const TQString &data ) const; + bool doExport( const KURL &url, const TQString &data ); void addKey( KABC::Addressee &addr, KABC::Key::Types type ); KABC::AddresseeList filterContacts( const KABC::AddresseeList& ); |