-rw-r--r-- | libopie2/opiecore/opiecore.pro | 8 | ||||
-rw-r--r-- | libopie2/opiecore/ostorageinfo.cpp | 94 | ||||
-rw-r--r-- | libopie2/opiecore/ostorageinfo.h | 49 |
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 | |||
@@ -7,3 +7,4 @@ HEADERS = oapplication.h \ | |||
7 | oglobal.h \ | 7 | oglobal.h \ |
8 | oglobalsettings.h | 8 | oglobalsettings.h \ |
9 | ostorage.h | ||
9 | 10 | ||
@@ -13,4 +14,5 @@ SOURCES = oapplication.cpp \ | |||
13 | oglobal.cpp \ | 14 | oglobal.cpp \ |
14 | oglobalsettings.cpp | 15 | oglobalsettings.cpp \ |
15 | 16 | ostorage.cpp | |
17 | |||
16 | INTERFACES = | 18 | INTERFACES = |
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 | |||
32 | OStorageInfo::OStorageInfo( QObject *parent ) | ||
33 | : StorageInfo( parent ) | ||
34 | { | ||
35 | } | ||
36 | |||
37 | OStorageInfo::~OStorageInfo() | ||
38 | { | ||
39 | } | ||
40 | |||
41 | QString 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 | */ | ||
61 | QString 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 | */ | ||
81 | QString 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 | |||
35 | class OStorageInfo : public StorageInfo | ||
36 | { | ||
37 | Q_OBJECT | ||
38 | |||
39 | public: | ||
40 | public: | ||
41 | OStorageInfo( QObject *parent=0 ); | ||
42 | ~OStorageInfo(); | ||
43 | |||
44 | QString getCfPath(); | ||
45 | QString getSdPath(); | ||
46 | QString getMmcPath(); | ||
47 | }; | ||
48 | |||
49 | #endif // OSTORAGE_H | ||