summaryrefslogtreecommitdiffabout
path: root/microkde
authorzautrix <zautrix>2004-10-30 17:07:04 (UTC)
committer zautrix <zautrix>2004-10-30 17:07:04 (UTC)
commit28df10a0eb5ff343191755a06391bc6ce2fd84b0 (patch) (unidiff)
tree930882e7400006887d68fd434939e3a376b8631b /microkde
parentc8662dc632987a317386b923e24acb9507859528 (diff)
downloadkdepimpi-28df10a0eb5ff343191755a06391bc6ce2fd84b0.zip
kdepimpi-28df10a0eb5ff343191755a06391bc6ce2fd84b0.tar.gz
kdepimpi-28df10a0eb5ff343191755a06391bc6ce2fd84b0.tar.bz2
ompi fixes
Diffstat (limited to 'microkde') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kapplication.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index 56c01af..d6f556d 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -15,53 +15,55 @@ int KApplication::random()
15 return rand(); 15 return rand();
16} 16}
17 17
18//US 18//US
19QString KApplication::randomString(int length) 19QString KApplication::randomString(int length)
20{ 20{
21 if (length <=0 ) return QString::null; 21 if (length <=0 ) return QString::null;
22 22
23 QString str; 23 QString str;
24 while (length--) 24 while (length--)
25 { 25 {
26 int r=random() % 62; 26 int r=random() % 62;
27 r+=48; 27 r+=48;
28 if (r>57) r+=7; 28 if (r>57) r+=7;
29 if (r>90) r+=6; 29 if (r>90) r+=6;
30 str += char(r); 30 str += char(r);
31 // so what if I work backwards? 31 // so what if I work backwards?
32 } 32 }
33 return str; 33 return str;
34} 34}
35int KApplication::execDialog( QDialog* d ) 35int KApplication::execDialog( QDialog* d )
36{ 36{
37 if (QApplication::desktop()->width() <= 640 ) 37 if (QApplication::desktop()->width() <= 640 )
38 d->showMaximized(); 38 d->showMaximized();
39 else
40 ;//d->resize( 800, 600 );
39 return d->exec(); 41 return d->exec();
40} 42}
41void KApplication::showLicence() 43void KApplication::showLicence()
42{ 44{
43 KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/LICENCE.TXT" ); 45 KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" );
44} 46}
45 47
46void KApplication::showFile(QString caption, QString fn) 48void KApplication::showFile(QString caption, QString fn)
47{ 49{
48 QString text; 50 QString text;
49 QString fileName; 51 QString fileName;
50#ifndef DESKTOP_VERSION 52#ifndef DESKTOP_VERSION
51 fileName = getenv("QPEDIR"); 53 fileName = getenv("QPEDIR");
52 fileName += "/pics/" + fn ; 54 fileName += "/pics/" + fn ;
53#else 55#else
54 fileName = qApp->applicationDirPath () + "/" + fn; 56 fileName = qApp->applicationDirPath () + "/" + fn;
55#endif 57#endif
56 QFile file( fileName ); 58 QFile file( fileName );
57 if (!file.open( IO_ReadOnly ) ) { 59 if (!file.open( IO_ReadOnly ) ) {
58 return ; 60 return ;
59 } 61 }
60 QTextStream ts( &file ); 62 QTextStream ts( &file );
61 text = ts.read(); 63 text = ts.read();
62 file.close(); 64 file.close();
63 KApplication::showText( caption, text ); 65 KApplication::showText( caption, text );
64 66
65} 67}
66 68
67bool KApplication::convert2latin1(QString fileName) 69bool KApplication::convert2latin1(QString fileName)