-rw-r--r-- | noncore/settings/sysinfo/main.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/sysinfo/storage.cpp | 27 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.h | 1 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.pro | 9 |
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 @@ -21,14 +21,7 @@ #include "sysinfo.h" #include <qpe/qpeapplication.h> +#include <opie/oapplicationfactory.h> -int main( int argc, char *argv[] ) -{ - QPEApplication a( argc, argv ); - - SystemInfo *si = new SystemInfo(); - a.showMainWidget( si ); - - return a.exec(); -} +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 @@ -50,7 +50,7 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) storage = new StorageInfo( this ); connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) ); - + lines.setAutoDelete(TRUE); rebuildDisks = TRUE; @@ -58,6 +58,7 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) startTimer( 5000 ); } + void FileSysInfo::timerEvent(QTimerEvent*) { updateMounts(); @@ -66,31 +67,22 @@ void FileSysInfo::timerEvent(QTimerEvent*) void FileSysInfo::updateMounts() { storage->update(); - + if ( rebuildDisks ) { - // Cannot auto delete QDict<MountInfo> disks because it seems to delete - // the filesystem object as well causing a segfault - MountInfo *mi; - for ( QDictIterator<MountInfo> delit(disks); delit.current(); ++delit ) - { - mi = delit.current(); - mi->fs = 0x0; - delete mi; - } disks.clear(); lines.clear(); - + delete vb; vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ ); bool frst=TRUE; - + FileSystem *fs; for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it ) { fs = it.current(); - + if ( !frst ) { QFrame *f = new QFrame( container ); @@ -100,7 +92,7 @@ void FileSysInfo::updateMounts() f->show(); } frst = FALSE; - + MountInfo *mi = new MountInfo( fs, container ); vb->addWidget( mi ); disks.insert( fs->path(), mi ); @@ -126,7 +118,7 @@ void FileSysInfo::updateMounts() for (QDictIterator<MountInfo> i(disks); i.current(); ++i) i.current()->updateData(); } - + rebuildDisks = FALSE; } @@ -145,7 +137,7 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) fs = filesys; title = fs->name(); - + data = new GraphData(); graph = new BarGraph( this ); graph->setFrameStyle( QFrame::Panel | QFrame::Sunken ); @@ -163,7 +155,6 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) MountInfo::~MountInfo() { delete data; - delete fs; } void MountInfo::updateData() 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 @@ -29,5 +29,6 @@ class SystemInfo : public QWidget Q_OBJECT public: SystemInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); + static QString appName() { return QString::fromLatin1("sysinfo"); } }; 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,6 +1,4 @@ -TEMPLATE = app -CONFIG = qt warn_on release -DESTDIR = $(OPIEDIR)/bin +CONFIG = qt warn_on release quick-app HEADERS = memory.h \ graph.h \ load.h \ @@ -20,11 +18,12 @@ SOURCES = main.cpp \ detail.cpp \ versioninfo.cpp \ sysinfo.cpp -INTERFACES = + INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopie -TARGET = sysinfo + +TARGET = sysinfo TRANSLATIONS = ../../../i18n/de/sysinfo.ts \ ../../../i18n/nl/sysinfo.ts \ |