summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-04-24 05:48:32 (UTC)
committer mickeyl <mickeyl>2005-04-24 05:48:32 (UTC)
commitceaea9869115287b48781fabc938bd51cb67625c (patch) (side-by-side diff)
tree4590e122439ac35ded56cad8b22f327d73e72844
parent07f375f59f19a001685db1b78e9ba9040c73bbeb (diff)
downloadopie-ceaea9869115287b48781fabc938bd51cb67625c.zip
opie-ceaea9869115287b48781fabc938bd51cb67625c.tar.gz
opie-ceaea9869115287b48781fabc938bd51cb67625c.tar.bz2
fix crash on kernels without swap support. patch courtesy Seneca Cunningham
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog3
-rw-r--r--noncore/applets/memoryapplet/swapfile.cpp8
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f2c8b4c..d2c386c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,3 +5,3 @@
------------
- * OpieStumbler: New application (skyhusker)
+ * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker)
@@ -17,2 +17,3 @@
* n.a. - scale BluezApplet appropriately (mickeyl)
+ * n.a. - memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham)
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp
index 4609c13..50c173b 100644
--- a/noncore/applets/memoryapplet/swapfile.cpp
+++ b/noncore/applets/memoryapplet/swapfile.cpp
@@ -2,4 +2,5 @@
** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2002-2005 the Opie Team <opie-devel@handhelds.org>
**
-** This file is part of Qtopia Environment.
+** This file is part of Opie Environment.
**
@@ -58,2 +59,7 @@ Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
{
+ if ( !QFile::exists( "/proc/swaps" ) )
+ {
+ QLabel *text = new QLabel( tr( "Swap disabled in kernel" ), this );
+ return;
+ }
// are we running as root?