From ceaea9869115287b48781fabc938bd51cb67625c Mon Sep 17 00:00:00 2001 From: mickeyl Date: Sun, 24 Apr 2005 05:48:32 +0000 Subject: fix crash on kernels without swap support. patch courtesy Seneca Cunningham --- diff --git a/ChangeLog b/ChangeLog index f2c8b4c..d2c386c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,7 @@ New Features ------------ - * OpieStumbler: New application (skyhusker) + * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker) Fixed Bugs ---------- @@ -15,6 +15,7 @@ * n.a. - libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) * n.a. - Wellenreiter: relax WE version matching test a bit (mickeyl) * n.a. - scale BluezApplet appropriately (mickeyl) + * n.a. - memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham) Internal -------- 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 @@ -1,7 +1,8 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (C) 2002-2005 the Opie Team ** -** This file is part of Qtopia Environment. +** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software @@ -56,6 +57,11 @@ using namespace Opie::Core; Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) : QWidget( parent, name, f ) { + if ( !QFile::exists( "/proc/swaps" ) ) + { + QLabel *text = new QLabel( tr( "Swap disabled in kernel" ), this ); + return; + } // are we running as root? isRoot = geteuid() == 0; -- cgit v0.9.0.2