From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'kaddressbook/keywidget.cpp') diff --git a/kaddressbook/keywidget.cpp b/kaddressbook/keywidget.cpp index c117d34..8ebee19 100644 --- a/kaddressbook/keywidget.cpp +++ b/kaddressbook/keywidget.cpp @@ -28,6 +28,8 @@ #include #include #include +//Added by qt3to4: +#include #ifndef KAB_EMBEDDED #include @@ -36,7 +38,7 @@ #else //KAB_EMBEDDED #include #include -#include +#include #include #endif //KAB_EMBEDDED @@ -52,7 +54,7 @@ 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 ); @@ -136,7 +138,7 @@ 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( "Unable to open file %1." ) ); KMessageBox::error( this, text.arg( url.url() ) ); return; @@ -152,7 +154,7 @@ void KeyWidget::addKey() { QFile file( keyfile ); - if ( !file.open( IO_ReadOnly ) ) { + if ( !file.open( QIODevice::ReadOnly ) ) { QString text( i18n( "Unable to open file %1." ) ); QString caption( i18n( "Error" ) ); QMessageBox::critical( this, caption, text.arg( keyfile ) ); @@ -163,10 +165,10 @@ void KeyWidget::addKey() - QTextStream s( &file ); + Q3TextStream s( &file ); QString data; - s.setEncoding( QTextStream::UnicodeUTF8 ); + s.setEncoding( Q3TextStream::UnicodeUTF8 ); s >> data; file.close(); @@ -221,8 +223,8 @@ void KeyWidget::exportKey() 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(); @@ -235,15 +237,15 @@ void KeyWidget::exportKey() return; QFile file( keyfile ); - if ( !file.open( IO_ReadWrite ) ) { + if ( !file.open( QIODevice::ReadWrite ) ) { QString text( i18n( "Unable to open file %1." ) ); 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(); @@ -272,6 +274,6 @@ void KeyWidget::updateKeyCombo() mExportButton->setEnabled( state ); } -#ifndef KAB_EMBEDDED -#include "keywidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_keywidget.cpp" #endif //KAB_EMBEDDED -- cgit v0.9.0.2