summaryrefslogtreecommitdiffabout
path: root/microkde/kapplication.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kapplication.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index d7c12bb..b058d54 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -1,21 +1,24 @@
#include <stdlib.h>
#include <stdio.h>
#include "kapplication.h"
#include "ktextedit.h"
#include <qapplication.h>
#include <qstring.h>
#include <qfile.h>
-#include <qtextstream.h>
+#include <q3textstream.h>
#include <qdialog.h>
#include <qlayout.h>
-#include <qtextbrowser.h>
+#include <q3textbrowser.h>
#include <qregexp.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
int KApplication::random()
{
return rand();
}
//US
QString KApplication::randomString(int length)
@@ -70,91 +73,91 @@ void KApplication::showFile(QString caption, QString fn)
QString fileName;
#ifndef DESKTOP_VERSION
fileName = getenv("QPEDIR");
fileName += "/pics/" + fn ;
#else
fileName = qApp->applicationDirPath () + "/" + fn;
#endif
QFile file( fileName );
- if (!file.open( IO_ReadOnly ) ) {
+ if (!file.open( QIODevice::ReadOnly ) ) {
return ;
}
- QTextStream ts( &file );
+ Q3TextStream ts( &file );
text = ts.read();
file.close();
KApplication::showText( caption, text );
}
bool KApplication::convert2latin1(QString fileName)
{
QString text;
QFile file( fileName );
- if (!file.open( IO_ReadOnly ) ) {
+ if (!file.open( QIODevice::ReadOnly ) ) {
return false;
}
- QTextStream ts( &file );
- ts.setEncoding( QTextStream::UnicodeUTF8 );
+ Q3TextStream ts( &file );
+ ts.setEncoding( Q3TextStream::UnicodeUTF8 );
text = ts.read();
file.close();
- if (!file.open( IO_WriteOnly ) ) {
+ if (!file.open( QIODevice::WriteOnly ) ) {
return false;
}
- QTextStream tsIn( &file );
- tsIn.setEncoding( QTextStream::Latin1 );
+ Q3TextStream tsIn( &file );
+ tsIn.setEncoding( Q3TextStream::Latin1 );
tsIn << text.latin1();
file.close();
return true;
}
void KApplication::showText(QString caption, QString text)
{
QDialog dia( 0, "name", true ); ;
dia.setCaption( caption );
- QVBoxLayout* lay = new QVBoxLayout( &dia );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( &dia );
lay->setSpacing( 3 );
lay->setMargin( 3 );
KTextEdit tb ( &dia );
- tb.setWordWrap( QMultiLineEdit::WidgetWidth );
+ tb.setWordWrap( Q3MultiLineEdit::WidgetWidth );
lay->addWidget( &tb );
tb.setText( text );
#ifdef DESKTOP_VERSION
dia.resize( 640, 480);
#else
dia.showMaximized();
#endif
dia.exec();
}
#include <qlabel.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qdir.h>
#include <qradiobutton.h>
-#include <qbuttongroup.h>
+#include <q3buttongroup.h>
#include "kglobal.h"
#include "klocale.h"
class KBackupPrefs : public QDialog
{
public:
KBackupPrefs( QString message , QWidget *parent=0, const char *name=0 ) :
QDialog( parent, name, true )
{
setCaption( i18n("Backup Failed!") );
- QVBoxLayout* lay = new QVBoxLayout( this );
+ Q3VBoxLayout* lay = new Q3VBoxLayout( this );
lay->setSpacing( 3 );
lay->setMargin( 3 );
QLabel * lab = new QLabel( message, this );
lay->addWidget( lab );
- QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Choose action"), this );
+ Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Choose action"), this );
lay->addWidget( format );
format->setExclusive ( true ) ;
vcal = new QRadioButton(i18n("Try again now"), format );
tcal = new QRadioButton(i18n("Try again later"), format );
ical = new QRadioButton(i18n("Try again tomorrow"), format );
ocal = new QRadioButton(i18n("Disable backup"), format );
vcal->setChecked( true );
QPushButton * ok = new QPushButton( i18n("OK"), this );