summaryrefslogtreecommitdiff
authoralwin <alwin>2005-03-01 23:42:48 (UTC)
committer alwin <alwin>2005-03-01 23:42:48 (UTC)
commit374cb9f45664c307ab7d0ed88fea5e76631518d9 (patch) (unidiff)
tree97d63c360117877ff26aca8fc6c61ebc14c528b5
parentbb6be9cbe75892a7cc1d7c234f1c48023f9c9592 (diff)
downloadopie-374cb9f45664c307ab7d0ed88fea5e76631518d9.zip
opie-374cb9f45664c307ab7d0ed88fea5e76631518d9.tar.gz
opie-374cb9f45664c307ab7d0ed88fea5e76631518d9.tar.bz2
mmc/sd cards may mounted via /dev/mmcblk* within linux 2.6
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/ostorageinfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libopie2/opiecore/ostorageinfo.cpp b/libopie2/opiecore/ostorageinfo.cpp
index 8fcf5fc..6c7c138 100644
--- a/libopie2/opiecore/ostorageinfo.cpp
+++ b/libopie2/opiecore/ostorageinfo.cpp
@@ -1,87 +1,88 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3              Copyright (C) 2004 Andreas 'ar' Richter <ar@oszine.de> 3              Copyright (C) 2004 Andreas 'ar' Richter <ar@oszine.de>
4 =. 4 =.
5 .=l. 5 .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#include <opie2/ostorageinfo.h> 30#include <opie2/ostorageinfo.h>
31 31
32using namespace Opie::Core; 32using namespace Opie::Core;
33 33
34OStorageInfo::OStorageInfo( QObject *parent ) 34OStorageInfo::OStorageInfo( QObject *parent )
35 : StorageInfo( parent ) 35 : StorageInfo( parent )
36{ 36{
37} 37}
38 38
39OStorageInfo::~OStorageInfo() 39OStorageInfo::~OStorageInfo()
40{ 40{
41} 41}
42 42
43QString OStorageInfo::cfPath()const 43QString OStorageInfo::cfPath()const
44{ 44{
45 QString r = ""; 45 QString r = "";
46 46
47 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i) 47 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i)
48 { 48 {
49 if ( (*i)->disk().left( 8 ) == "/dev/hda" ) 49 if ( (*i)->disk().left( 8 ) == "/dev/hda" )
50 { 50 {
51 r = (*i)->path(); 51 r = (*i)->path();
52 break; 52 break;
53 } 53 }
54 } 54 }
55 return r; 55 return r;
56} 56}
57 57
58QString OStorageInfo::sdPath()const 58QString OStorageInfo::sdPath()const
59{ 59{
60 QString r = ""; 60 QString r = "";
61 61
62 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i) 62 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i)
63 { 63 {
64 if ( (*i)->disk().left( 9 ) == "/dev/mmcd" ) 64 if ( (*i)->disk().left( 9 ) == "/dev/mmcd" )
65 { 65 {
66 r = (*i)->path(); 66 r = (*i)->path();
67 break; 67 break;
68 } 68 }
69 } 69 }
70 return r; 70 return r;
71} 71}
72 72
73QString OStorageInfo::mmcPath()const 73QString OStorageInfo::mmcPath()const
74{ 74{
75 QString r = ""; 75 QString r = "";
76 76
77 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i) 77 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i)
78 { 78 {
79 if ( (*i)->disk().left( 14 ) == "/dev/mmc/part1" ) 79 if ( (*i)->disk().left( 14 ) == "/dev/mmc/part1"||
80 (*i)->disk().left(11) == "/dev/mmcblk" )
80 { 81 {
81 r = (*i)->path(); 82 r = (*i)->path();
82 break; 83 break;
83 } 84 }
84 } 85 }
85 return r; 86 return r;
86} 87}
87 88