-rw-r--r-- | noncore/settings/sysinfo/main.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/sysinfo/storage.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.h | 1 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.pro | 7 |
4 files changed, 7 insertions, 23 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 | |||
@@ -18,17 +18,10 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
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 | ||
25 | int 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 | ||
27 | OPIE_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 | |||
@@ -55,32 +55,24 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) | |||
55 | 55 | ||
56 | rebuildDisks = TRUE; | 56 | rebuildDisks = TRUE; |
57 | updateMounts(); | 57 | updateMounts(); |
58 | startTimer( 5000 ); | 58 | startTimer( 5000 ); |
59 | } | 59 | } |
60 | 60 | ||
61 | |||
61 | void FileSysInfo::timerEvent(QTimerEvent*) | 62 | void FileSysInfo::timerEvent(QTimerEvent*) |
62 | { | 63 | { |
63 | updateMounts(); | 64 | updateMounts(); |
64 | } | 65 | } |
65 | 66 | ||
66 | void FileSysInfo::updateMounts() | 67 | void 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 | ||
@@ -160,13 +152,12 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) | |||
160 | updateData(); | 152 | updateData(); |
161 | } | 153 | } |
162 | 154 | ||
163 | MountInfo::~MountInfo() | 155 | MountInfo::~MountInfo() |
164 | { | 156 | { |
165 | delete data; | 157 | delete data; |
166 | delete fs; | ||
167 | } | 158 | } |
168 | 159 | ||
169 | void MountInfo::updateData() | 160 | void MountInfo::updateData() |
170 | { | 161 | { |
171 | long mult = fs->blockSize() / 1024; | 162 | long mult = fs->blockSize() / 1024; |
172 | long div = 1024 / fs->blockSize(); | 163 | long div = 1024 / fs->blockSize(); |
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 | |||
@@ -26,8 +26,9 @@ | |||
26 | 26 | ||
27 | class SystemInfo : public QWidget | 27 | class SystemInfo : public QWidget |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | public: | 30 | public: |
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,9 +1,7 @@ | |||
1 | TEMPLATE = app | 1 | CONFIG = qt warn_on release quick-app |
2 | CONFIG = qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = memory.h \ | 2 | HEADERS = memory.h \ |
5 | graph.h \ | 3 | graph.h \ |
6 | load.h \ | 4 | load.h \ |
7 | storage.h \ | 5 | storage.h \ |
8 | processinfo.h \ | 6 | processinfo.h \ |
9 | modulesinfo.h \ | 7 | modulesinfo.h \ |
@@ -17,16 +15,17 @@ SOURCES = main.cpp \ | |||
17 | storage.cpp \ | 15 | storage.cpp \ |
18 | processinfo.cpp \ | 16 | processinfo.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 |
23 | INTERFACES = | 21 | |
24 | INCLUDEPATH += $(OPIEDIR)/include | 22 | INCLUDEPATH += $(OPIEDIR)/include |
25 | DEPENDPATH += $(OPIEDIR)/include | 23 | DEPENDPATH += $(OPIEDIR)/include |
26 | LIBS += -lqpe -lopie | 24 | LIBS += -lqpe -lopie |
25 | |||
27 | TARGET = sysinfo | 26 | TARGET = sysinfo |
28 | 27 | ||
29 | TRANSLATIONS = ../../../i18n/de/sysinfo.ts \ | 28 | TRANSLATIONS = ../../../i18n/de/sysinfo.ts \ |
30 | ../../../i18n/nl/sysinfo.ts \ | 29 | ../../../i18n/nl/sysinfo.ts \ |
31 | ../../../i18n/xx/sysinfo.ts \ | 30 | ../../../i18n/xx/sysinfo.ts \ |
32 | ../../../i18n/en/sysinfo.ts \ | 31 | ../../../i18n/en/sysinfo.ts \ |