summaryrefslogtreecommitdiffabout
path: root/microkde/kapplication.cpp
Unidiff
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
@@ -6,11 +6,14 @@
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qstring.h> 7#include <qstring.h>
8#include <qfile.h> 8#include <qfile.h>
9#include <qtextstream.h> 9#include <q3textstream.h>
10#include <qdialog.h> 10#include <qdialog.h>
11#include <qlayout.h> 11#include <qlayout.h>
12#include <qtextbrowser.h> 12#include <q3textbrowser.h>
13#include <qregexp.h> 13#include <qregexp.h>
14#include <QDesktopWidget>
15//Added by qt3to4:
16#include <Q3VBoxLayout>
14 17
15int KApplication::random() 18int KApplication::random()
16{ 19{
@@ -75,10 +78,10 @@ void KApplication::showFile(QString caption, QString fn)
75 fileName = qApp->applicationDirPath () + "/" + fn; 78 fileName = qApp->applicationDirPath () + "/" + fn;
76#endif 79#endif
77 QFile file( fileName ); 80 QFile file( fileName );
78 if (!file.open( IO_ReadOnly ) ) { 81 if (!file.open( QIODevice::ReadOnly ) ) {
79 return ; 82 return ;
80 } 83 }
81 QTextStream ts( &file ); 84 Q3TextStream ts( &file );
82 text = ts.read(); 85 text = ts.read();
83 file.close(); 86 file.close();
84 KApplication::showText( caption, text ); 87 KApplication::showText( caption, text );
@@ -89,19 +92,19 @@ bool KApplication::convert2latin1(QString fileName)
89{ 92{
90 QString text; 93 QString text;
91 QFile file( fileName ); 94 QFile file( fileName );
92 if (!file.open( IO_ReadOnly ) ) { 95 if (!file.open( QIODevice::ReadOnly ) ) {
93 return false; 96 return false;
94 97
95 } 98 }
96 QTextStream ts( &file ); 99 Q3TextStream ts( &file );
97 ts.setEncoding( QTextStream::UnicodeUTF8 ); 100 ts.setEncoding( Q3TextStream::UnicodeUTF8 );
98 text = ts.read(); 101 text = ts.read();
99 file.close(); 102 file.close();
100 if (!file.open( IO_WriteOnly ) ) { 103 if (!file.open( QIODevice::WriteOnly ) ) {
101 return false; 104 return false;
102 } 105 }
103 QTextStream tsIn( &file ); 106 Q3TextStream tsIn( &file );
104 tsIn.setEncoding( QTextStream::Latin1 ); 107 tsIn.setEncoding( Q3TextStream::Latin1 );
105 tsIn << text.latin1(); 108 tsIn << text.latin1();
106 file.close(); 109 file.close();
107 return true; 110 return true;
@@ -112,11 +115,11 @@ void KApplication::showText(QString caption, QString text)
112{ 115{
113 QDialog dia( 0, "name", true ); ; 116 QDialog dia( 0, "name", true ); ;
114 dia.setCaption( caption ); 117 dia.setCaption( caption );
115 QVBoxLayout* lay = new QVBoxLayout( &dia ); 118 Q3VBoxLayout* lay = new Q3VBoxLayout( &dia );
116 lay->setSpacing( 3 ); 119 lay->setSpacing( 3 );
117 lay->setMargin( 3 ); 120 lay->setMargin( 3 );
118 KTextEdit tb ( &dia ); 121 KTextEdit tb ( &dia );
119 tb.setWordWrap( QMultiLineEdit::WidgetWidth ); 122 tb.setWordWrap( Q3MultiLineEdit::WidgetWidth );
120 lay->addWidget( &tb ); 123 lay->addWidget( &tb );
121 tb.setText( text ); 124 tb.setText( text );
122#ifdef DESKTOP_VERSION 125#ifdef DESKTOP_VERSION
@@ -133,7 +136,7 @@ void KApplication::showText(QString caption, QString text)
133#include <qlayout.h> 136#include <qlayout.h>
134#include <qdir.h> 137#include <qdir.h>
135#include <qradiobutton.h> 138#include <qradiobutton.h>
136#include <qbuttongroup.h> 139#include <q3buttongroup.h>
137#include "kglobal.h" 140#include "kglobal.h"
138#include "klocale.h" 141#include "klocale.h"
139 142
@@ -144,12 +147,12 @@ class KBackupPrefs : public QDialog
144 QDialog( parent, name, true ) 147 QDialog( parent, name, true )
145 { 148 {
146 setCaption( i18n("Backup Failed!") ); 149 setCaption( i18n("Backup Failed!") );
147 QVBoxLayout* lay = new QVBoxLayout( this ); 150 Q3VBoxLayout* lay = new Q3VBoxLayout( this );
148 lay->setSpacing( 3 ); 151 lay->setSpacing( 3 );
149 lay->setMargin( 3 ); 152 lay->setMargin( 3 );
150 QLabel * lab = new QLabel( message, this ); 153 QLabel * lab = new QLabel( message, this );
151 lay->addWidget( lab ); 154 lay->addWidget( lab );
152 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Choose action"), this ); 155 Q3ButtonGroup* format = new Q3ButtonGroup( 1, Qt::Horizontal, i18n("Choose action"), this );
153 lay->addWidget( format ); 156 lay->addWidget( format );
154 format->setExclusive ( true ) ; 157 format->setExclusive ( true ) ;
155 vcal = new QRadioButton(i18n("Try again now"), format ); 158 vcal = new QRadioButton(i18n("Try again now"), format );