• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

kdf

  • sources
  • kde-4.12
  • kdeutils
  • kdf
disklist.h
Go to the documentation of this file.
1 /*
2 * disklist.h
3 *
4 * Copyright (c) 1999 Michael Kropfberger <michael.kropfberger@gmx.net>
5 * 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef DISKLIST_H
23 #define DISKLIST_H
24 
25 // defines the os-type
26 #include <QtCore/qglobal.h>
27 
28 #include <ksharedconfig.h>
29 
30 #include "disks.h"
31 
32 static QLatin1String DF_Command = QLatin1String( "df" );
33 
34 #if defined(Q_OS_LINUX)
35  static QLatin1String DF_Args = QLatin1String( "-kT" );
36  static const bool No_FS_Type = false;
37 #else
38  static QLatin1String DF_Args = QLatin1String( "-k" );
39  static const bool No_FS_Type = true;
40 #endif
41 
42 #if defined(Q_OS_SOLARIS)
43  static QLatin1String CacheFSTAB = QLatin1String( "/etc/cachefstab" );
44  static QLatin1String FSTAB = QLatin1String( "/etc/vfstab" );
45 #else
46  static QLatin1String FSTAB = QLatin1String( "/etc/fstab" );
47 #endif
48 
49 static const QLatin1Char Separator = QLatin1Char( '|' );
50 
51 /***************************************************************************/
52 typedef QList<DiskEntry*> Disks;
53 typedef QList<DiskEntry*>::const_iterator DisksConstIterator;
54 typedef QList<DiskEntry*>::iterator DisksIterator;
55 
56 class KProcess;
57 
58 class DiskList : public QObject
59 {
60  Q_OBJECT
61 
62  public:
63  DiskList( QObject *parent=0 );
64  ~DiskList();
65 
66  int readFSTAB();
67  int readDF();
68  int find(DiskEntry* disk);
69  DiskEntry* at(uint index) { return disks->at(index); }
70  uint count() { return disks->count(); }
71  void deleteAllMountedAt(const QString &mountpoint);
72  void setUpdatesDisabled(bool disable);
73 
74  //To iterate over disks items
75  DisksConstIterator disksConstIteratorBegin() { return disks->constBegin(); }
76  DisksConstIterator disksConstIteratorEnd() { return disks->constEnd(); }
77 
78  DisksIterator disksIteratorBegin() { return disks->begin(); }
79  DisksIterator disksIteratorEnd() { return disks->end(); }
80 
81  Q_SIGNALS:
82  void readDFDone();
83  void criticallyFull(DiskEntry *disk);
84 
85  public slots:
86  void loadSettings();
87  void applySettings();
88 
89  private slots:
90  void dfDone();
91 
92  private:
93  void replaceDeviceEntry(DiskEntry *disk);
94 
95  Disks *disks;
96  KProcess *dfProc;
97  bool readingDFStdErrOut;
98  KSharedConfigPtr config;
99  bool updatesDisabled;
100 
101 };
102 /***************************************************************************/
103 
104 
105 #endif
106 
No_FS_Type
static const bool No_FS_Type
Definition: disklist.h:39
DiskList::readDFDone
void readDFDone()
DiskEntry
Definition: disks.h:30
DisksConstIterator
QList< DiskEntry * >::const_iterator DisksConstIterator
Definition: disklist.h:53
DiskList::disksIteratorEnd
DisksIterator disksIteratorEnd()
Definition: disklist.h:79
DiskList::disksConstIteratorBegin
DisksConstIterator disksConstIteratorBegin()
Definition: disklist.h:75
DiskList::at
DiskEntry * at(uint index)
Definition: disklist.h:69
Separator
static const QLatin1Char Separator
Definition: disklist.h:49
DiskList::criticallyFull
void criticallyFull(DiskEntry *disk)
QObject
DiskList::count
uint count()
Definition: disklist.h:70
disks.h
DiskList::disksConstIteratorEnd
DisksConstIterator disksConstIteratorEnd()
Definition: disklist.h:76
DF_Args
static QLatin1String DF_Args
Definition: disklist.h:38
DiskList::loadSettings
void loadSettings()
Definition: disklist.cpp:139
DiskList
Definition: disklist.h:58
DiskList::~DiskList
~DiskList()
Definition: disklist.cpp:74
DiskList::DiskList
DiskList(QObject *parent=0)
Definition: disklist.cpp:46
FSTAB
static QLatin1String FSTAB
Definition: disklist.h:46
Disks
QList< DiskEntry * > Disks
Definition: disklist.h:52
DisksIterator
QList< DiskEntry * >::iterator DisksIterator
Definition: disklist.h:54
DiskList::deleteAllMountedAt
void deleteAllMountedAt(const QString &mountpoint)
Definition: disklist.cpp:498
DF_Command
static QLatin1String DF_Command
Definition: disklist.h:32
DiskList::find
int find(DiskEntry *disk)
Definition: disklist.cpp:476
DiskList::readDF
int readDF()
Definition: disklist.cpp:326
DiskList::applySettings
void applySettings()
Definition: disklist.cpp:110
DiskList::readFSTAB
int readFSTAB()
Definition: disklist.cpp:200
DiskList::disksIteratorBegin
DisksIterator disksIteratorBegin()
Definition: disklist.h:78
DiskList::setUpdatesDisabled
void setUpdatesDisabled(bool disable)
Updated need to be disabled sometimes to avoid pulling the DiskEntry out from the popupmenu handler...
Definition: disklist.cpp:102
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:08:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdf

Skip menu "kdf"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal