summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo
authormickeyl <mickeyl>2003-10-27 19:51:32 (UTC)
committer mickeyl <mickeyl>2003-10-27 19:51:32 (UTC)
commit951d1d4125a80dc814f95d2956853bf53ca52e9a (patch) (unidiff)
tree46c7a70b80a7eebb54cd59c46204c28335f3821c /noncore/settings/sysinfo
parentf0a15a9866f9eddfe10596e63a1e6300b92b9e3f (diff)
downloadopie-951d1d4125a80dc814f95d2956853bf53ca52e9a.zip
opie-951d1d4125a80dc814f95d2956853bf53ca52e9a.tar.gz
opie-951d1d4125a80dc814f95d2956853bf53ca52e9a.tar.bz2
merge noncore/apps/* except
- advancedfm (ljp, please...) - odict (tille, please...)
Diffstat (limited to 'noncore/settings/sysinfo') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/main.cpp11
-rw-r--r--noncore/settings/sysinfo/storage.cpp27
-rw-r--r--noncore/settings/sysinfo/sysinfo.h1
-rw-r--r--noncore/settings/sysinfo/sysinfo.pro9
4 files changed, 16 insertions, 32 deletions
diff --git a/noncore/settings/sysinfo/main.cpp b/noncore/settings/sysinfo/main.cpp
index 6e889db..02b1098 100644
--- a/noncore/settings/sysinfo/main.cpp
+++ b/noncore/settings/sysinfo/main.cpp
@@ -20,15 +20,8 @@
20 20
21#include "sysinfo.h" 21#include "sysinfo.h"
22 22
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <opie/oapplicationfactory.h>
24 25
25int main( int argc, char *argv[] )
26{
27 QPEApplication a( argc, argv );
28
29 SystemInfo *si = new SystemInfo();
30 a.showMainWidget( si );
31
32 return a.exec();
33}
34 26
27OPIE_EXPORT_APP( OApplicationFactory<SystemInfo> )
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp
index c4474d5..4ef7122 100644
--- a/noncore/settings/sysinfo/storage.cpp
+++ b/noncore/settings/sysinfo/storage.cpp
@@ -49,49 +49,41 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name )
49 vb = 0x0; 49 vb = 0x0;
50 50
51 storage = new StorageInfo( this ); 51 storage = new StorageInfo( this );
52 connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) ); 52 connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) );
53 53
54 lines.setAutoDelete(TRUE); 54 lines.setAutoDelete(TRUE);
55 55
56 rebuildDisks = TRUE; 56 rebuildDisks = TRUE;
57 updateMounts(); 57 updateMounts();
58 startTimer( 5000 ); 58 startTimer( 5000 );
59} 59}
60 60
61
61void FileSysInfo::timerEvent(QTimerEvent*) 62void FileSysInfo::timerEvent(QTimerEvent*)
62{ 63{
63 updateMounts(); 64 updateMounts();
64} 65}
65 66
66void FileSysInfo::updateMounts() 67void FileSysInfo::updateMounts()
67{ 68{
68 storage->update(); 69 storage->update();
69 70
70 if ( rebuildDisks ) 71 if ( rebuildDisks )
71 { 72 {
72 // Cannot auto delete QDict<MountInfo> disks because it seems to delete
73 // the filesystem object as well causing a segfault
74 MountInfo *mi;
75 for ( QDictIterator<MountInfo> delit(disks); delit.current(); ++delit )
76 {
77 mi = delit.current();
78 mi->fs = 0x0;
79 delete mi;
80 }
81 disks.clear(); 73 disks.clear();
82 lines.clear(); 74 lines.clear();
83 75
84 delete vb; 76 delete vb;
85 vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ ); 77 vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ );
86 78
87 bool frst=TRUE; 79 bool frst=TRUE;
88 80
89 FileSystem *fs; 81 FileSystem *fs;
90 for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it ) 82 for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it )
91 { 83 {
92 fs = it.current(); 84 fs = it.current();
93 85
94 if ( !frst ) 86 if ( !frst )
95 { 87 {
96 QFrame *f = new QFrame( container ); 88 QFrame *f = new QFrame( container );
97 vb->addWidget(f); 89 vb->addWidget(f);
@@ -99,9 +91,9 @@ void FileSysInfo::updateMounts()
99 lines.append(f); 91 lines.append(f);
100 f->show(); 92 f->show();
101 } 93 }
102 frst = FALSE; 94 frst = FALSE;
103 95
104 MountInfo *mi = new MountInfo( fs, container ); 96 MountInfo *mi = new MountInfo( fs, container );
105 vb->addWidget( mi ); 97 vb->addWidget( mi );
106 disks.insert( fs->path(), mi ); 98 disks.insert( fs->path(), mi );
107 mi->show(); 99 mi->show();
@@ -125,9 +117,9 @@ void FileSysInfo::updateMounts()
125 { 117 {
126 for (QDictIterator<MountInfo> i(disks); i.current(); ++i) 118 for (QDictIterator<MountInfo> i(disks); i.current(); ++i)
127 i.current()->updateData(); 119 i.current()->updateData();
128 } 120 }
129 121
130 rebuildDisks = FALSE; 122 rebuildDisks = FALSE;
131} 123}
132 124
133void FileSysInfo::disksChanged() 125void FileSysInfo::disksChanged()
@@ -144,9 +136,9 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name )
144 vb->addWidget( totalSize ); 136 vb->addWidget( totalSize );
145 137
146 fs = filesys; 138 fs = filesys;
147 title = fs->name(); 139 title = fs->name();
148 140
149 data = new GraphData(); 141 data = new GraphData();
150 graph = new BarGraph( this ); 142 graph = new BarGraph( this );
151 graph->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 143 graph->setFrameStyle( QFrame::Panel | QFrame::Sunken );
152 vb->addWidget( graph, 1 ); 144 vb->addWidget( graph, 1 );
@@ -162,9 +154,8 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name )
162 154
163MountInfo::~MountInfo() 155MountInfo::~MountInfo()
164{ 156{
165 delete data; 157 delete data;
166 delete fs;
167} 158}
168 159
169void MountInfo::updateData() 160void MountInfo::updateData()
170{ 161{
diff --git a/noncore/settings/sysinfo/sysinfo.h b/noncore/settings/sysinfo/sysinfo.h
index d69346a..94c3876 100644
--- a/noncore/settings/sysinfo/sysinfo.h
+++ b/noncore/settings/sysinfo/sysinfo.h
@@ -28,6 +28,7 @@ class SystemInfo : public QWidget
28{ 28{
29 Q_OBJECT 29 Q_OBJECT
30public: 30public:
31 SystemInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 31 SystemInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
32 static QString appName() { return QString::fromLatin1("sysinfo"); }
32}; 33};
33 34
diff --git a/noncore/settings/sysinfo/sysinfo.pro b/noncore/settings/sysinfo/sysinfo.pro
index 2582ea2..2322989 100644
--- a/noncore/settings/sysinfo/sysinfo.pro
+++ b/noncore/settings/sysinfo/sysinfo.pro
@@ -1,7 +1,5 @@
1TEMPLATE = app 1CONFIG = qt warn_on release quick-app
2CONFIG = qt warn_on release
3DESTDIR = $(OPIEDIR)/bin
4HEADERS = memory.h \ 2HEADERS = memory.h \
5 graph.h \ 3 graph.h \
6 load.h \ 4 load.h \
7 storage.h \ 5 storage.h \
@@ -19,13 +17,14 @@ SOURCES = main.cpp \
19 modulesinfo.cpp \ 17 modulesinfo.cpp \
20 detail.cpp \ 18 detail.cpp \
21 versioninfo.cpp \ 19 versioninfo.cpp \
22 sysinfo.cpp 20 sysinfo.cpp
23INTERFACES = 21
24INCLUDEPATH += $(OPIEDIR)/include 22INCLUDEPATH += $(OPIEDIR)/include
25DEPENDPATH += $(OPIEDIR)/include 23DEPENDPATH += $(OPIEDIR)/include
26LIBS += -lqpe -lopie 24LIBS += -lqpe -lopie
27TARGET = sysinfo 25
26 TARGET= sysinfo
28 27
29TRANSLATIONS = ../../../i18n/de/sysinfo.ts \ 28TRANSLATIONS = ../../../i18n/de/sysinfo.ts \
30 ../../../i18n/nl/sysinfo.ts \ 29 ../../../i18n/nl/sysinfo.ts \
31 ../../../i18n/xx/sysinfo.ts \ 30 ../../../i18n/xx/sysinfo.ts \