summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxport
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/xxport
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/xxport') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxport/csv_xxport.cpp14
-rw-r--r--kaddressbook/xxport/csvimportdialog.cpp66
-rw-r--r--kaddressbook/xxport/csvimportdialog.h12
-rw-r--r--kaddressbook/xxport/kde2_xxport.cpp4
-rw-r--r--kaddressbook/xxport/vcard_xxport.cpp20
5 files changed, 60 insertions, 56 deletions
diff --git a/kaddressbook/xxport/csv_xxport.cpp b/kaddressbook/xxport/csv_xxport.cpp
index 7281003..ed5807f 100644
--- a/kaddressbook/xxport/csv_xxport.cpp
+++ b/kaddressbook/xxport/csv_xxport.cpp
@@ -31,5 +31,5 @@ $Id$
#include <qfile.h>
#include <qregexp.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qtextcodec.h>
@@ -105,5 +105,5 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString&
} else {
QFile file( url.path() );
- if ( !file.open( IO_WriteOnly ) ) {
+ if ( !file.open( QIODevice::WriteOnly ) ) {
QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" );
KMessageBox::error( parentWidget(), txt.arg( url.path() ) );
@@ -125,5 +125,5 @@ bool CSVXXPort::exportContacts( const KABC::AddresseeList &list, const QString&
QFile file( fileName );
- if ( !file.open( IO_WriteOnly ) ) {
+ if ( !file.open( QIODevice::WriteOnly ) ) {
QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" );
KMessageBox::error( parentWidget(), txt.arg( fileName ) );
@@ -152,5 +152,5 @@ KABC::AddresseeList CSVXXPort::importContacts( const QString& ) const
void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list )
{
- QTextStream t( fp );
+ Q3TextStream t( fp );
t.setCodec( QTextCodec::codecForName("utf8") );
@@ -188,7 +188,5 @@ void CSVXXPort::doExport( QFile *fp, const KABC::AddresseeList &list )
}
-#ifndef KAB_EMBEDDED
-#include "csv_xxport.moc"
+#ifndef KAB_EMBEDDED_
+#include "moc_csv_xxport.cpp"
#endif //KAB_EMBEDDED
-
-
diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp
index 862241e..7959cac 100644
--- a/kaddressbook/xxport/csvimportdialog.cpp
+++ b/kaddressbook/xxport/csvimportdialog.cpp
@@ -28,5 +28,5 @@ $Id$
-#include <qbuttongroup.h>
+#include <q3buttongroup.h>
#include <qcheckbox.h>
#include <qcombobox.h>
@@ -40,8 +40,12 @@ $Id$
#include <qpushbutton.h>
#include <qradiobutton.h>
-#include <qtable.h>
+#include <q3table.h>
#include <qlayout.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qfile.h>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3ValueList>
+#include <Q3GridLayout>
#include <kapplication.h>
@@ -57,5 +61,5 @@ $Id$
#ifdef DESKTOP_VERSION
-#include "qtable.h"
+#include "q3table.h"
#else
#include "qcombotableitem.h"
@@ -162,5 +166,5 @@ CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent,
// if ( QApplication::desktop()->width() < 321 )
- QIconSet icon = SmallIcon("filesave");
+ QIcon icon = SmallIcon("filesave");
findButton( User2 )->setIconSet (icon ) ;
@@ -187,5 +191,5 @@ KABC::AddresseeList CSVImportDialog::contacts() const
for ( int col = 0; col < mTable->numCols(); ++col ) {
- QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, col ) );
+ Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, col ) );
if ( !item ) {
@@ -230,5 +234,5 @@ KABC::AddresseeList CSVImportDialog::contacts() const
{
QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate
- a.setBirthday(dt);
+ a.setBirthday(QDateTime(dt));
}
break;
@@ -383,7 +387,7 @@ void CSVImportDialog::initGUI()
QWidget* page = plainPage();
- QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(),
+ Q3GridLayout *layout = new Q3GridLayout( page, 1, 1, marginHintSmall(),
spacingHintSmall() );
- QHBoxLayout *hbox = new QHBoxLayout();
+ Q3HBoxLayout *hbox = new Q3HBoxLayout();
hbox->setSpacing( spacingHint() );
@@ -398,9 +402,9 @@ void CSVImportDialog::initGUI()
// Delimiter: comma, semicolon, tab, space, other
- mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page );
+ mDelimiterBox = new Q3ButtonGroup( i18n( "Delimiter" ), page );
mDelimiterBox->setColumnLayout( 0, Qt::Vertical );
mDelimiterBox->layout()->setSpacing( spacingHint() );
mDelimiterBox->layout()->setMargin( marginHint() );
- QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() );
+ Q3GridLayout *delimiterLayout = new Q3GridLayout( mDelimiterBox->layout() );
delimiterLayout->setAlignment( Qt::AlignTop );
layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 );
@@ -451,6 +455,6 @@ void CSVImportDialog::initGUI()
layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 );
- mTable = new QTable( 0, 0, page );
- mTable->setSelectionMode( QTable::NoSelection );
+ mTable = new Q3Table( 0, 0, page );
+ mTable->setSelectionMode( Q3Table::NoSelection );
//mTable->horizontalHeader()->hide();
layout->addMultiCellWidget( mTable, 5, 5, 0, 2 );
@@ -484,9 +488,9 @@ void CSVImportDialog::fillTable()
// store previous assignment
- QValueList<int> mTypeOld = mTypeStore;
+ Q3ValueList<int> mTypeOld = mTypeStore;
mTypeStore.clear();
for ( column = 0; column < mTable->numCols(); ++column ) {
- QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, column ) );
+ Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0, column ) );
if ( !item || mClearTypeStore )
@@ -507,12 +511,12 @@ void CSVImportDialog::fillTable()
}
- QTextStream inputStream( mData, IO_ReadOnly );
+ Q3TextStream inputStream( mData, QIODevice::ReadOnly );
if ( mComboCodec->currentItem () == 0 ) {
- inputStream.setEncoding( QTextStream::UnicodeUTF8 );
+ inputStream.setEncoding( Q3TextStream::UnicodeUTF8 );
} else if ( mComboCodec->currentItem () == 1 ) {
- inputStream.setEncoding( QTextStream::Latin1 );
+ inputStream.setEncoding( Q3TextStream::Latin1 );
} else {
- inputStream.setEncoding( QTextStream::Locale );
+ inputStream.setEncoding( Q3TextStream::Locale );
}
@@ -527,5 +531,5 @@ void CSVImportDialog::fillTable()
if ( x == mTextQuote ) {
state = S_QUOTED_FIELD;
- } else if ( x == mDelimiter ) {
+ } else if ( QString(x) == mDelimiter ) {
if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) )
++column;
@@ -562,5 +566,5 @@ void CSVImportDialog::fillTable()
field += x;
state = S_QUOTED_FIELD;
- } else if ( x == mDelimiter || x == '\n' ) {
+ } else if ( QString(x) == mDelimiter || x == '\n' ) {
setText( row - mStartLine + 1, column, field );
field = "";
@@ -579,5 +583,5 @@ void CSVImportDialog::fillTable()
break;
case S_END_OF_QUOTED_FIELD :
- if ( x == mDelimiter || x == '\n' ) {
+ if ( QString(x) == mDelimiter || x == '\n' ) {
setText( row - mStartLine + 1, column, field );
field = "";
@@ -602,5 +606,5 @@ void CSVImportDialog::fillTable()
}
case S_NORMAL_FIELD :
- if ( x == mDelimiter || x == '\n' ) {
+ if ( QString(x) == mDelimiter || x == '\n' ) {
setText( row - mStartLine + 1, column, field );
field = "";
@@ -618,5 +622,5 @@ void CSVImportDialog::fillTable()
}
}
- if ( x != mDelimiter )
+ if ( QString(x) != mDelimiter )
lastCharDelimiter = false;
@@ -650,5 +654,5 @@ void CSVImportDialog::fillTable()
//US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() );
- QComboTableItem *item = new QComboTableItem( mTable, keys );
+ Q3ComboTableItem *item = new Q3ComboTableItem( mTable, keys );
mTable->setItem( 0, column, item );
if ( column < mTypeStore.count() )
@@ -765,5 +769,5 @@ void CSVImportDialog::slotOk()
for ( int column = 0; column < mTable->numCols(); ++column ) {
- QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0,
+ Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0,
column ) );
if ( item && posToType( item->currentItem() ) != Undefined )
@@ -837,5 +841,5 @@ void CSVImportDialog::applyTemplate()
for ( uint column = 0; column < columnMap.count(); ++column ) {
int type = columnMap[ column ];
- QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0,
+ Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0,
column ) );
if ( item )
@@ -879,5 +883,5 @@ void CSVImportDialog::saveTemplate()
for ( uint column = 0; column < mTable->numCols(); ++column ) {
- QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0,
+ Q3ComboTableItem *item = static_cast<Q3ComboTableItem*>( mTable->item( 0,
column ) );
if ( item )
@@ -935,5 +939,5 @@ void CSVImportDialog::setFile( const QString &fileName )
QFile file( fileName );
- if ( !file.open( IO_ReadOnly ) ) {
+ if ( !file.open( QIODevice::ReadOnly ) ) {
KMessageBox::sorry( this, i18n( "Cannot open input file!" ) );
file.close();
@@ -965,5 +969,5 @@ void CSVImportDialog::urlChanged( const QString &file )
}
-#ifndef KAB_EMBEDDED
-#include <csvimportdialog.moc>
+#ifndef KAB_EMBEDDED_
+#include <moc_csvimportdialog.cpp>
#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxport/csvimportdialog.h b/kaddressbook/xxport/csvimportdialog.h
index 2661420..520f3fa 100644
--- a/kaddressbook/xxport/csvimportdialog.h
+++ b/kaddressbook/xxport/csvimportdialog.h
@@ -34,9 +34,9 @@ $Id$
#include <kdialogbase.h>
-#include <qvaluelist.h>
+#include <q3valuelist.h>
class KURLRequester;
-class QButtonGroup;
+class Q3ButtonGroup;
class QComboBox;
class QCheckBox;
@@ -44,5 +44,5 @@ class QLineEdit;
class QPushButton;
class QRadioButton;
-class QTable;
+class Q3Table;
class CSVImportDialog : public KDialogBase
@@ -86,6 +86,6 @@ class CSVImportDialog : public KDialogBase
};
- QTable* mTable;
- QButtonGroup* mDelimiterBox;
+ Q3Table* mTable;
+ Q3ButtonGroup* mDelimiterBox;
QRadioButton* mRadioComma;
QRadioButton* mRadioSemicolon;
@@ -120,5 +120,5 @@ class CSVImportDialog : public KDialogBase
int mCustomCounter;
bool mClearTypeStore;
- QValueList<int> mTypeStore;
+ Q3ValueList<int> mTypeStore;
};
diff --git a/kaddressbook/xxport/kde2_xxport.cpp b/kaddressbook/xxport/kde2_xxport.cpp
index 03efc1b..72d3fc2 100644
--- a/kaddressbook/xxport/kde2_xxport.cpp
+++ b/kaddressbook/xxport/kde2_xxport.cpp
@@ -117,5 +117,5 @@ KABC::AddresseeList KDE2XXPort::importContacts( const QString& ) const
}
-#ifndef KAB_EMBEDDED
-#include "kde2_xxport.moc"
+#ifndef KAB_EMBEDDED_
+#include "moc_kde2_xxport.cpp"
#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp
index 9a8fa68..64b9071 100644
--- a/kaddressbook/xxport/vcard_xxport.cpp
+++ b/kaddressbook/xxport/vcard_xxport.cpp
@@ -30,6 +30,8 @@
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qfileinfo.h>
+//Added by qt3to4:
+#include <Q3CString>
#include <kabc/vcardconverter.h>
@@ -103,5 +105,5 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString
QFile outFile( fileName );
- if ( !outFile.open( IO_WriteOnly ) ) {
+ if ( !outFile.open( QIODevice::WriteOnly ) ) {
QString text = i18n( "<qt>Unable to open file <b>%1</b> for export.</qt>" );
KMessageBox::error( parentWidget(), text.arg( fileName ) );
@@ -109,6 +111,6 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString
}
- QTextStream t( &outFile );
- t.setEncoding( QTextStream::UnicodeUTF8 );
+ Q3TextStream t( &outFile );
+ t.setEncoding( Q3TextStream::UnicodeUTF8 );
KABC::Addressee::List::ConstIterator it;
@@ -154,5 +156,5 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
QFile file( fileName );
- file.open( IO_ReadOnly );
+ file.open( QIODevice::ReadOnly );
QByteArray rawData = file.readAll();
file.close();
@@ -197,6 +199,6 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
}
QFile file( fileName );
- if ( file.open( IO_ReadOnly ) ) {
- QCString rawData ( file.readAll().data(),file.size()+1);
+ if ( file.open( QIODevice::ReadOnly ) ) {
+ Q3CString rawData ( file.readAll().data(),file.size()+1);
file.close();
int start = 0;
@@ -268,5 +270,5 @@ KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const
-#ifndef KAB_EMBEDDED
-#include "vcard_xxport.moc"
+#ifndef KAB_EMBEDDED_
+#include "moc_vcard_xxport.cpp"
#endif //KAB_EMBEDDED