author | zautrix <zautrix> | 2004-10-14 06:42:01 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-14 06:42:01 (UTC) |
commit | a6dff815a9c6d3a91094573d23c28a8553fc7cc2 (patch) (unidiff) | |
tree | a8830e9adcd72faa8178d4ee2517bfc31cda8653 /microkde | |
parent | 909d25797c50fc38c435834a68aaf60bf87e32f9 (diff) | |
download | kdepimpi-a6dff815a9c6d3a91094573d23c28a8553fc7cc2.zip kdepimpi-a6dff815a9c6d3a91094573d23c28a8553fc7cc2.tar.gz kdepimpi-a6dff815a9c6d3a91094573d23c28a8553fc7cc2.tar.bz2 |
fixes umlaute in beaming
-rw-r--r-- | microkde/kapplication.cpp | 22 | ||||
-rw-r--r-- | microkde/kapplication.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index 98ef2f2..56c01af 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -61,12 +61,34 @@ void KApplication::showFile(QString caption, QString fn) | |||
61 | text = ts.read(); | 61 | text = ts.read(); |
62 | file.close(); | 62 | file.close(); |
63 | KApplication::showText( caption, text ); | 63 | KApplication::showText( caption, text ); |
64 | 64 | ||
65 | } | 65 | } |
66 | 66 | ||
67 | bool KApplication::convert2latin1(QString fileName) | ||
68 | { | ||
69 | QString text; | ||
70 | QFile file( fileName ); | ||
71 | if (!file.open( IO_ReadOnly ) ) { | ||
72 | return false; | ||
73 | |||
74 | } | ||
75 | QTextStream ts( &file ); | ||
76 | ts.setEncoding( QTextStream::UnicodeUTF8 ); | ||
77 | text = ts.read(); | ||
78 | file.close(); | ||
79 | if (!file.open( IO_WriteOnly ) ) { | ||
80 | return false; | ||
81 | } | ||
82 | QTextStream tsIn( &file ); | ||
83 | tsIn.setEncoding( QTextStream::Latin1 ); | ||
84 | tsIn << text.latin1(); | ||
85 | file.close(); | ||
86 | |||
87 | |||
88 | } | ||
67 | void KApplication::showText(QString caption, QString text) | 89 | void KApplication::showText(QString caption, QString text) |
68 | { | 90 | { |
69 | QDialog dia( 0, "name", true ); ; | 91 | QDialog dia( 0, "name", true ); ; |
70 | dia.setCaption( caption ); | 92 | dia.setCaption( caption ); |
71 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 93 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
72 | lay->setSpacing( 3 ); | 94 | lay->setSpacing( 3 ); |
diff --git a/microkde/kapplication.h b/microkde/kapplication.h index 79cdb33..41546a0 100644 --- a/microkde/kapplication.h +++ b/microkde/kapplication.h | |||
@@ -17,10 +17,11 @@ class KApplication | |||
17 | */ | 17 | */ |
18 | static QString randomString(int length); | 18 | static QString randomString(int length); |
19 | static int execDialog( QDialog* ); | 19 | static int execDialog( QDialog* ); |
20 | static void showLicence(); | 20 | static void showLicence(); |
21 | static void showFile(QString caption, QString file); | 21 | static void showFile(QString caption, QString file); |
22 | static void showText(QString caption, QString text); | 22 | static void showText(QString caption, QString text); |
23 | static bool convert2latin1(QString file); | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | 26 | ||
26 | #endif | 27 | #endif |