author | zautrix <zautrix> | 2005-04-21 22:27:41 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-21 22:27:41 (UTC) |
commit | abf935a18e55fcbe221d5a7c652840af279e2e3f (patch) (unidiff) | |
tree | 9ac85aa9f7c281f41a9f5685db971f15399b5a47 | |
parent | 6284b1d7d597463347b471ed8ec2770f4e2d449b (diff) | |
download | kdepimpi-abf935a18e55fcbe221d5a7c652840af279e2e3f.zip kdepimpi-abf935a18e55fcbe221d5a7c652840af279e2e3f.tar.gz kdepimpi-abf935a18e55fcbe221d5a7c652840af279e2e3f.tar.bz2 |
cf
-rw-r--r-- | microkde/kapplication.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index 539397b..566bb41 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -1,76 +1,77 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | 3 | ||
4 | #include "kapplication.h" | 4 | #include "kapplication.h" |
5 | #include "ktextedit.h" | 5 | #include "ktextedit.h" |
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 <qtextstream.h> |
10 | #include <qdialog.h> | 10 | #include <qdialog.h> |
11 | #include <qlayout.h> | 11 | #include <qlayout.h> |
12 | #include <qtextbrowser.h> | 12 | #include <qtextbrowser.h> |
13 | #include <qregexp.h> | ||
13 | 14 | ||
14 | int KApplication::random() | 15 | int KApplication::random() |
15 | { | 16 | { |
16 | return rand(); | 17 | return rand(); |
17 | } | 18 | } |
18 | 19 | ||
19 | //US | 20 | //US |
20 | QString KApplication::randomString(int length) | 21 | QString KApplication::randomString(int length) |
21 | { | 22 | { |
22 | if (length <=0 ) return QString::null; | 23 | if (length <=0 ) return QString::null; |
23 | 24 | ||
24 | QString str; | 25 | QString str; |
25 | while (length--) | 26 | while (length--) |
26 | { | 27 | { |
27 | int r=random() % 62; | 28 | int r=random() % 62; |
28 | r+=48; | 29 | r+=48; |
29 | if (r>57) r+=7; | 30 | if (r>57) r+=7; |
30 | if (r>90) r+=6; | 31 | if (r>90) r+=6; |
31 | str += char(r); | 32 | str += char(r); |
32 | // so what if I work backwards? | 33 | // so what if I work backwards? |
33 | } | 34 | } |
34 | return str; | 35 | return str; |
35 | } | 36 | } |
36 | int KApplication::execDialog( QDialog* d ) | 37 | int KApplication::execDialog( QDialog* d ) |
37 | { | 38 | { |
38 | if (QApplication::desktop()->width() <= 640 ) | 39 | if (QApplication::desktop()->width() <= 640 ) |
39 | d->showMaximized(); | 40 | d->showMaximized(); |
40 | else | 41 | else |
41 | ;//d->resize( 800, 600 ); | 42 | ;//d->resize( 800, 600 ); |
42 | return d->exec(); | 43 | return d->exec(); |
43 | } | 44 | } |
44 | void KApplication::showLicence() | 45 | void KApplication::showLicence() |
45 | { | 46 | { |
46 | KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" ); | 47 | KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" ); |
47 | } | 48 | } |
48 | 49 | ||
49 | void KApplication::testCoords( int* x, int* y, int* wid, int * hei ) | 50 | void KApplication::testCoords( int* x, int* y, int* wid, int * hei ) |
50 | { | 51 | { |
51 | int dWid = QApplication::desktop()->width() ; | 52 | int dWid = QApplication::desktop()->width() ; |
52 | int dHei = QApplication::desktop()->height(); | 53 | int dHei = QApplication::desktop()->height(); |
53 | if ( *x + *wid > dWid ) { | 54 | if ( *x + *wid > dWid ) { |
54 | *x = 0; | 55 | *x = 0; |
55 | if ( *wid > dWid ) | 56 | if ( *wid > dWid ) |
56 | *wid = dWid; | 57 | *wid = dWid; |
57 | } | 58 | } |
58 | if ( *y + *hei > dHei ) { | 59 | if ( *y + *hei > dHei ) { |
59 | *y = 0; | 60 | *y = 0; |
60 | if ( *hei > dHei ) | 61 | if ( *hei > dHei ) |
61 | *hei = dHei; | 62 | *hei = dHei; |
62 | } | 63 | } |
63 | } | 64 | } |
64 | void KApplication::showFile(QString caption, QString fn) | 65 | void KApplication::showFile(QString caption, QString fn) |
65 | { | 66 | { |
66 | QString text; | 67 | QString text; |
67 | QString fileName; | 68 | QString fileName; |
68 | #ifndef DESKTOP_VERSION | 69 | #ifndef DESKTOP_VERSION |
69 | fileName = getenv("QPEDIR"); | 70 | fileName = getenv("QPEDIR"); |
70 | fileName += "/pics/" + fn ; | 71 | fileName += "/pics/" + fn ; |
71 | #else | 72 | #else |
72 | fileName = qApp->applicationDirPath () + "/" + fn; | 73 | fileName = qApp->applicationDirPath () + "/" + fn; |
73 | #endif | 74 | #endif |
74 | QFile file( fileName ); | 75 | QFile file( fileName ); |
75 | if (!file.open( IO_ReadOnly ) ) { | 76 | if (!file.open( IO_ReadOnly ) ) { |
76 | return ; | 77 | return ; |