summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/versioninfo.cpp
Unidiff
Diffstat (limited to 'noncore/settings/sysinfo/versioninfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/versioninfo.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp
index 1984823..c44a05a 100644
--- a/noncore/settings/sysinfo/versioninfo.cpp
+++ b/noncore/settings/sysinfo/versioninfo.cpp
@@ -13,32 +13,28 @@
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include <qpe/resource.h> 21#include <qpe/resource.h>
22#include <qpe/version.h> 22#include <qpe/version.h>
23 23
24#include <qfile.h> 24#include <qfile.h>
25#include <qimage.h>
26#include <qlabel.h> 25#include <qlabel.h>
27#include <qlayout.h> 26#include <qlayout.h>
28#include <qpixmap.h>
29#include <qpainter.h>
30#include <qscrollview.h> 27#include <qscrollview.h>
31#include <qtextstream.h> 28#include <qtextstream.h>
32#include <qtimer.h>
33#include <qwhatsthis.h> 29#include <qwhatsthis.h>
34 30
35#include "versioninfo.h" 31#include "versioninfo.h"
36 32
37#include <opie/odevice.h> 33#include <opie/odevice.h>
38 34
39using namespace Opie; 35using namespace Opie;
40 36
41VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) 37VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f )
42 : QWidget( parent, name, f ) 38 : QWidget( parent, name, f )
43{ 39{
44 setMinimumSize( 200, 150 ); 40 setMinimumSize( 200, 150 );
@@ -49,33 +45,33 @@ VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f )
49 sv->setResizePolicy( QScrollView::AutoOneFit ); 45 sv->setResizePolicy( QScrollView::AutoOneFit );
50 sv->setFrameStyle( QFrame::NoFrame ); 46 sv->setFrameStyle( QFrame::NoFrame );
51 QWidget *container = new QWidget( sv->viewport() ); 47 QWidget *container = new QWidget( sv->viewport() );
52 sv->addChild( container ); 48 sv->addChild( container );
53 49
54 QVBoxLayout *vb = new QVBoxLayout( container, 3 ); 50 QVBoxLayout *vb = new QVBoxLayout( container, 3 );
55 51
56 QString kernelVersionString; 52 QString kernelVersionString;
57 QFile file( "/proc/version" ); 53 QFile file( "/proc/version" );
58 if ( file.open( IO_ReadOnly ) ) 54 if ( file.open( IO_ReadOnly ) )
59 { 55 {
60 QTextStream t( &file ); 56 QTextStream t( &file );
61 QString v; 57 QStringList strList;
62 t >> v; t >> v; t >> v; 58
63 v = v.left( 20 ); 59 strList = QStringList::split( " " , t.read(), false );
60
64 kernelVersionString = "<qt>" + tr( "<b>Linux Kernel</b><p>Version: " ); 61 kernelVersionString = "<qt>" + tr( "<b>Linux Kernel</b><p>Version: " );
65 kernelVersionString.append( v ); 62 kernelVersionString.append( strList[2] );
66 kernelVersionString.append( "<br>" ); 63 kernelVersionString.append( "<br>" );
67 t >> v;
68 kernelVersionString.append( tr( "Compiled by: " ) ); 64 kernelVersionString.append( tr( "Compiled by: " ) );
69 kernelVersionString.append( v ); 65 kernelVersionString.append( strList[3] );
70 kernelVersionString.append("</qt>"); 66 kernelVersionString.append("</qt>");
71 file.close(); 67 file.close();
72 } 68 }
73 69
74 QString palmtopVersionString = "<qt>" + tr( "<b>Opie</b><p>Version: " ); 70 QString palmtopVersionString = "<qt>" + tr( "<b>Opie</b><p>Version: " );
75 palmtopVersionString.append( QPE_VERSION ); 71 palmtopVersionString.append( QPE_VERSION );
76 palmtopVersionString.append( "<br>" ); 72 palmtopVersionString.append( "<br>" );
77#ifdef QPE_VENDOR 73#ifdef QPE_VENDOR
78 QString builder = QPE_VENDOR; 74 QString builder = QPE_VENDOR;
79#else 75#else
80 QString builder = "Unknown"; 76 QString builder = "Unknown";
81#endif 77#endif