summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/opiecore.pro8
-rw-r--r--libopie2/opiecore/ostorageinfo.cpp94
-rw-r--r--libopie2/opiecore/ostorageinfo.h49
3 files changed, 148 insertions, 3 deletions
diff --git a/libopie2/opiecore/opiecore.pro b/libopie2/opiecore/opiecore.pro
index 4f70db7..a8769e5 100644
--- a/libopie2/opiecore/opiecore.pro
+++ b/libopie2/opiecore/opiecore.pro
@@ -5,14 +5,16 @@ HEADERS = oapplication.h \
5 oconfig.h \ 5 oconfig.h \
6 odebug.h \ 6 odebug.h \
7 oglobal.h \ 7 oglobal.h \
8 oglobalsettings.h 8 oglobalsettings.h \
9 ostorage.h
9 10
10SOURCES = oapplication.cpp \ 11SOURCES = oapplication.cpp \
11 oconfig.cpp \ 12 oconfig.cpp \
12 odebug.cpp \ 13 odebug.cpp \
13 oglobal.cpp \ 14 oglobal.cpp \
14 oglobalsettings.cpp 15 oglobalsettings.cpp \
15 16 ostorage.cpp
17
16INTERFACES = 18INTERFACES =
17TARGET = opiecore2 19TARGET = opiecore2
18VERSION = 1.8.2 20VERSION = 1.8.2
diff --git a/libopie2/opiecore/ostorageinfo.cpp b/libopie2/opiecore/ostorageinfo.cpp
new file mode 100644
index 0000000..cf9dc6c
--- a/dev/null
+++ b/libopie2/opiecore/ostorageinfo.cpp
@@ -0,0 +1,94 @@
1/*
2                 This file is part of the Opie Project
3              Copyright (C) 2004 Andreas 'ar' Richter <ar@oszine.de>
4 =.
5 .=l.
6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28*/
29
30#include <opie2/ostorage.h>
31
32OStorageInfo::OStorageInfo( QObject *parent )
33 : StorageInfo( parent )
34{
35}
36
37OStorageInfo::~OStorageInfo()
38{
39}
40
41QString OStorageInfo::getCfPath()
42{
43 QString r = "";
44
45 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i)
46 {
47 if ( (*i)->disk().left( 8 ) == "/dev/hda" )
48 {
49 r = (*i)->path();
50 break;
51 }
52 }
53 return r;
54}
55
56/*!
57* @fn QString StorageInfo::getSdPath()
58* @brief returns the Mount-Path of Sd Card
59*
60*/
61QString OStorageInfo::getSdPath()
62{
63 QString r = "";
64
65 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i)
66 {
67 if ( (*i)->disk().left( 9 ) == "/dev/mmcd" )
68 {
69 r = (*i)->path();
70 break;
71 }
72 }
73 return r;
74}
75
76/*!
77* @fn QString StorageInfo::getMmcPath()
78* @brief returns the Mount-Path of Mmc Card
79*
80*/
81QString OStorageInfo::getMmcPath()
82{
83 QString r = "";
84
85 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i)
86 {
87 if ( (*i)->disk().left( 14 ) == "/dev/mmc/part1" )
88 {
89 r = (*i)->path();
90 break;
91 }
92 }
93 return r;
94}
diff --git a/libopie2/opiecore/ostorageinfo.h b/libopie2/opiecore/ostorageinfo.h
new file mode 100644
index 0000000..ba87ff4
--- a/dev/null
+++ b/libopie2/opiecore/ostorageinfo.h
@@ -0,0 +1,49 @@
1/*
2                 This file is part of the Opie Project
3              Copyright (C) 2004 Andreas 'ar' Richter <ar@oszine.de>
4 =.
5 .=l.
6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28*/
29
30#ifndef OSTORAGE_H
31#define OSTORAGE_H
32
33#include <qpe/storage.h>
34
35class OStorageInfo : public StorageInfo
36{
37 Q_OBJECT
38
39 public:
40public:
41 OStorageInfo( QObject *parent=0 );
42 ~OStorageInfo();
43
44 QString getCfPath();
45 QString getSdPath();
46 QString getMmcPath();
47};
48
49#endif // OSTORAGE_H