summaryrefslogtreecommitdiffabout
path: root/microkde/kapplication.cpp
Unidiff
Diffstat (limited to 'microkde/kapplication.cpp') (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 f36c5ae..d7c12bb 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -30,55 +30,57 @@ QString KApplication::randomString(int length)
30 if (r>57) r+=7; 30 if (r>57) r+=7;
31 if (r>90) r+=6; 31 if (r>90) r+=6;
32 str += char(r); 32 str += char(r);
33 // so what if I work backwards? 33 // so what if I work backwards?
34 } 34 }
35 return str; 35 return str;
36} 36}
37int KApplication::execDialog( QDialog* d ) 37int KApplication::execDialog( QDialog* d )
38{ 38{
39 if (QApplication::desktop()->width() <= 640 ) 39 if (QApplication::desktop()->width() <= 640 )
40 d->showMaximized(); 40 d->showMaximized();
41 else 41 else
42 ;//d->resize( 800, 600 ); 42 ;//d->resize( 800, 600 );
43 return d->exec(); 43 return d->exec();
44} 44}
45void KApplication::showLicence() 45void KApplication::showLicence()
46{ 46{
47 KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" ); 47 KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" );
48} 48}
49 49
50void KApplication::testCoords( int* x, int* y, int* wid, int * hei ) 50void KApplication::testCoords( int* x, int* y, int* wid, int * hei )
51{ 51{
52 int dWid = QApplication::desktop()->width() ; 52 int dWid = QApplication::desktop()->width() ;
53 int dHei = QApplication::desktop()->height(); 53 int dHei = QApplication::desktop()->height();
54 if ( *x < 0 ) *x = 0;
55 if ( *y < 20 ) *y = 20 ;
54 if ( *x + *wid > dWid ) { 56 if ( *x + *wid > dWid ) {
55 *x = 0; 57 *x = 0;
56 if ( *wid > dWid ) 58 if ( *wid > dWid )
57 *wid = dWid; 59 *wid = dWid;
58 } 60 }
59 if ( *y + *hei > dHei ) { 61 if ( *y + *hei > dHei ) {
60 *y = 0; 62 *y = 20;
61 if ( *hei > dHei ) 63 if ( *hei > dHei )
62 *hei = dHei; 64 *hei = dHei;
63 } 65 }
64} 66}
65void KApplication::showFile(QString caption, QString fn) 67void KApplication::showFile(QString caption, QString fn)
66{ 68{
67 QString text; 69 QString text;
68 QString fileName; 70 QString fileName;
69#ifndef DESKTOP_VERSION 71#ifndef DESKTOP_VERSION
70 fileName = getenv("QPEDIR"); 72 fileName = getenv("QPEDIR");
71 fileName += "/pics/" + fn ; 73 fileName += "/pics/" + fn ;
72#else 74#else
73 fileName = qApp->applicationDirPath () + "/" + fn; 75 fileName = qApp->applicationDirPath () + "/" + fn;
74#endif 76#endif
75 QFile file( fileName ); 77 QFile file( fileName );
76 if (!file.open( IO_ReadOnly ) ) { 78 if (!file.open( IO_ReadOnly ) ) {
77 return ; 79 return ;
78 } 80 }
79 QTextStream ts( &file ); 81 QTextStream ts( &file );
80 text = ts.read(); 82 text = ts.read();
81 file.close(); 83 file.close();
82 KApplication::showText( caption, text ); 84 KApplication::showText( caption, text );
83 85
84} 86}