-rw-r--r-- | kaddressbook/keywidget.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/kaddressbook/keywidget.cpp b/kaddressbook/keywidget.cpp index c117d34..8ebee19 100644 --- a/kaddressbook/keywidget.cpp +++ b/kaddressbook/keywidget.cpp @@ -27,17 +27,19 @@ #include <qlabel.h> #include <qlayout.h> #include <qpushbutton.h> +//Added by qt3to4: +#include <Q3GridLayout> #ifndef KAB_EMBEDDED #include <kaccelmanager.h> #include <kio/netaccess.h> #include <kmessagebox.h> #else //KAB_EMBEDDED #include <qmap.h> #include <qmessagebox.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <kurl.h> #endif //KAB_EMBEDDED #include <kapplication.h> @@ -51,9 +53,9 @@ KeyWidget::KeyWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *layout = new QGridLayout( this, 2, 2, KDialog::marginHint(), + Q3GridLayout *layout = new Q3GridLayout( this, 2, 2, KDialog::marginHint(), KDialog::spacingHint() ); QLabel *label = new QLabel( i18n( "Keys:" ), this ); layout->addWidget( label, 0, 0 ); @@ -135,9 +137,9 @@ void KeyWidget::addKey() QString tmpFile; if ( KIO::NetAccess::download( url, tmpFile ) ) { QFile file( tmpFile ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); KMessageBox::error( this, text.arg( url.url() ) ); return; } @@ -151,9 +153,9 @@ void KeyWidget::addKey() return; { QFile file( keyfile ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); QString caption( i18n( "Error" ) ); QMessageBox::critical( this, caption, text.arg( keyfile ) ); return; @@ -162,12 +164,12 @@ void KeyWidget::addKey() #endif //KAB_EMBEDDED - QTextStream s( &file ); + Q3TextStream s( &file ); QString data; - s.setEncoding( QTextStream::UnicodeUTF8 ); + s.setEncoding( Q3TextStream::UnicodeUTF8 ); s >> data; file.close(); KABC::Key key( data, type ); @@ -220,10 +222,10 @@ void KeyWidget::exportKey() #ifndef KAB_EMBEDDED KURL url = KFileDialog::getSaveURL(); KTempFile tempFile; - QTextStream *s = tempFile.textStream(); - s->setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream *s = tempFile.textStream(); + s->setEncoding( Q3TextStream::UnicodeUTF8 ); (*s) << key.textData(); tempFile.close(); KIO::NetAccess::upload( tempFile.name(), url, kapp->mainWidget() ); @@ -234,17 +236,17 @@ void KeyWidget::exportKey() if ( keyfile.isEmpty() ) return; QFile file( keyfile ); - if ( !file.open( IO_ReadWrite ) ) { + if ( !file.open( QIODevice::ReadWrite ) ) { QString text( i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ) ); QString caption( i18n( "Error" ) ); QMessageBox::critical( this, caption, text.arg( keyfile ) ); return; } - QTextStream s( &file ); - s.setEncoding( QTextStream::UnicodeUTF8 ); + Q3TextStream s( &file ); + s.setEncoding( Q3TextStream::UnicodeUTF8 ); s << key.textData(); file.close(); @@ -271,7 +273,7 @@ void KeyWidget::updateKeyCombo() mRemoveButton->setEnabled( state ); mExportButton->setEnabled( state ); } -#ifndef KAB_EMBEDDED -#include "keywidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_keywidget.cpp" #endif //KAB_EMBEDDED |