author | mickeyl <mickeyl> | 2005-04-24 05:48:32 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-04-24 05:48:32 (UTC) |
commit | ceaea9869115287b48781fabc938bd51cb67625c (patch) (unidiff) | |
tree | 4590e122439ac35ded56cad8b22f327d73e72844 | |
parent | 07f375f59f19a001685db1b78e9ba9040c73bbeb (diff) | |
download | opie-ceaea9869115287b48781fabc938bd51cb67625c.zip opie-ceaea9869115287b48781fabc938bd51cb67625c.tar.gz opie-ceaea9869115287b48781fabc938bd51cb67625c.tar.bz2 |
fix crash on kernels without swap support. patch courtesy Seneca Cunningham
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/swapfile.cpp | 8 |
2 files changed, 9 insertions, 2 deletions
@@ -1,25 +1,26 @@ | |||
1 | 2005-??-??Opie 1.2.1 | 1 | 2005-??-??Opie 1.2.1 |
2 | 2 | ||
3 | 3 | ||
4 | New Features | 4 | New Features |
5 | ------------ | 5 | ------------ |
6 | * OpieStumbler: New application (skyhusker) | 6 | * OpieStumbler: Scans WiFi networks using the wireless extension scanning (skyhusker) |
7 | 7 | ||
8 | Fixed Bugs | 8 | Fixed Bugs |
9 | ---------- | 9 | ---------- |
10 | * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller) | 10 | * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller) |
11 | * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller) | 11 | * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller) |
12 | * #1614 - Make Opie-console start in $HOME instead of / (skyhusker) | 12 | * #1614 - Make Opie-console start in $HOME instead of / (skyhusker) |
13 | * n.a.- always show volume and wireless applet popups inside visible screen (deller) | 13 | * n.a.- always show volume and wireless applet popups inside visible screen (deller) |
14 | * n.a. - scale O-Menu-Applets appropriately (mickeyl) | 14 | * n.a. - scale O-Menu-Applets appropriately (mickeyl) |
15 | * n.a.- libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) | 15 | * n.a.- libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) |
16 | * n.a.- Wellenreiter: relax WE version matching test a bit (mickeyl) | 16 | * n.a.- Wellenreiter: relax WE version matching test a bit (mickeyl) |
17 | * n.a.- scale BluezApplet appropriately (mickeyl) | 17 | * n.a.- scale BluezApplet appropriately (mickeyl) |
18 | * n.a.- memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham) | ||
18 | 19 | ||
19 | Internal | 20 | Internal |
20 | -------- | 21 | -------- |
21 | * make BluezApplet use OTaskbarApplet (mickeyl) | 22 | * make BluezApplet use OTaskbarApplet (mickeyl) |
22 | 23 | ||
23 | 2005-03-25Opie 1.2.0 | 24 | 2005-03-25Opie 1.2.0 |
24 | 25 | ||
25 | Fixed Bugs | 26 | Fixed Bugs |
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,12 +1,13 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** Copyright (C) 2002-2005 the Opie Team <opie-devel@handhelds.org> | ||
3 | ** | 4 | ** |
4 | ** This file is part of Qtopia Environment. | 5 | ** This file is part of Opie Environment. |
5 | ** | 6 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 7 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 8 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 9 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 10 | ** packaging of this file. |
10 | ** | 11 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
@@ -51,16 +52,21 @@ using namespace Opie::Core; | |||
51 | #include <sys/vfs.h> | 52 | #include <sys/vfs.h> |
52 | #include <mntent.h> | 53 | #include <mntent.h> |
53 | #include <unistd.h> | 54 | #include <unistd.h> |
54 | #include <sys/types.h> | 55 | #include <sys/types.h> |
55 | 56 | ||
56 | Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) | 57 | Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) |
57 | : QWidget( parent, name, f ) | 58 | : QWidget( parent, name, f ) |
58 | { | 59 | { |
60 | if ( !QFile::exists( "/proc/swaps" ) ) | ||
61 | { | ||
62 | QLabel *text = new QLabel( tr( "Swap disabled in kernel" ), this ); | ||
63 | return; | ||
64 | } | ||
59 | // are we running as root? | 65 | // are we running as root? |
60 | isRoot = geteuid() == 0; | 66 | isRoot = geteuid() == 0; |
61 | 67 | ||
62 | QVBoxLayout* vb = new QVBoxLayout(this, 5); | 68 | QVBoxLayout* vb = new QVBoxLayout(this, 5); |
63 | 69 | ||
64 | QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this); | 70 | QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this); |
65 | cfsdRBG->setRadioButtonExclusive(true); | 71 | cfsdRBG->setRadioButtonExclusive(true); |
66 | vb->addWidget(cfsdRBG); | 72 | vb->addWidget(cfsdRBG); |