-rw-r--r-- | microkde/kapplication.cpp | 14 | ||||
-rw-r--r-- | microkde/kapplication.h | 1 |
2 files changed, 10 insertions, 5 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index f0de71e..ad0b78e 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -40,16 +40,20 @@ int KApplication::execDialog( QDialog* d ) | |||
40 | } | 40 | } |
41 | void KApplication::showLicence() | 41 | void KApplication::showLicence() |
42 | { | 42 | { |
43 | QString fileName ; | 43 | KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/LICENCE.TXT" ); |
44 | } | ||
45 | |||
46 | void KApplication::showFile(QString caption, QString fn) | ||
47 | { | ||
44 | QString text; | 48 | QString text; |
49 | QString fileName; | ||
45 | #ifndef DESKTOP_VERSION | 50 | #ifndef DESKTOP_VERSION |
46 | fileName = getenv("QPEDIR"); | 51 | fileName = getenv("QPEDIR"); |
47 | fileName += "/pics/kdepim/LICENCE.TXT" ; | 52 | fileName += "/pics/" + fn ; |
48 | #else | 53 | #else |
49 | fileName = qApp->applicationDirPath () + "/kdepim/LICENCE.TXT"; | 54 | fileName = qApp->applicationDirPath () + "/" + fn; |
50 | #endif | 55 | #endif |
51 | QFile file( fileName ); | 56 | QFile file( fileName ); |
52 | qDebug("Licence file name %s ",fileName.latin1() ); | ||
53 | if (!file.open( IO_ReadOnly ) ) { | 57 | if (!file.open( IO_ReadOnly ) ) { |
54 | return ; | 58 | return ; |
55 | } | 59 | } |
@@ -58,7 +62,7 @@ void KApplication::showLicence() | |||
58 | file.close(); | 62 | file.close(); |
59 | 63 | ||
60 | QDialog dia( 0, "name", true ); ; | 64 | QDialog dia( 0, "name", true ); ; |
61 | dia.setCaption( "KDE-Pim/Pi licence" ); | 65 | dia.setCaption( caption ); |
62 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 66 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
63 | lay->setSpacing( 3 ); | 67 | lay->setSpacing( 3 ); |
64 | lay->setMargin( 3 ); | 68 | lay->setMargin( 3 ); |
diff --git a/microkde/kapplication.h b/microkde/kapplication.h index 9515c60..5ae5c00 100644 --- a/microkde/kapplication.h +++ b/microkde/kapplication.h | |||
@@ -18,6 +18,7 @@ class KApplication | |||
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 | }; | 22 | }; |
22 | 23 | ||
23 | 24 | ||