summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/ostorageinfo.cpp8
-rw-r--r--libopie2/opiecore/ostorageinfo.h6
-rw-r--r--noncore/settings/backup/backuprestore.cpp12
3 files changed, 12 insertions, 14 deletions
diff --git a/libopie2/opiecore/ostorageinfo.cpp b/libopie2/opiecore/ostorageinfo.cpp
index cf9dc6c..6712282 100644
--- a/libopie2/opiecore/ostorageinfo.cpp
+++ b/libopie2/opiecore/ostorageinfo.cpp
@@ -17,78 +17,76 @@
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/ostorage.h> 30#include <opie2/ostorage.h>
31 31
32OStorageInfo::OStorageInfo( QObject *parent ) 32OStorageInfo::OStorageInfo( QObject *parent )
33 : StorageInfo( parent ) 33 : StorageInfo( parent )
34{ 34{
35} 35}
36 36
37OStorageInfo::~OStorageInfo() 37OStorageInfo::~OStorageInfo()
38{ 38{
39} 39}
40 40
41QString OStorageInfo::getCfPath() 41QString OStorageInfo::cfPath()const
42{ 42{
43 QString r = ""; 43 QString r = "";
44 44
45 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i) 45 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i)
46 { 46 {
47 if ( (*i)->disk().left( 8 ) == "/dev/hda" ) 47 if ( (*i)->disk().left( 8 ) == "/dev/hda" )
48 { 48 {
49 r = (*i)->path(); 49 r = (*i)->path();
50 break; 50 break;
51 } 51 }
52 } 52 }
53 return r; 53 return r;
54} 54}
55 55
56/*! 56/*!
57* @fn QString StorageInfo::getSdPath()
58* @brief returns the Mount-Path of Sd Card 57* @brief returns the Mount-Path of Sd Card
59* 58*
60*/ 59*/
61QString OStorageInfo::getSdPath() 60QString OStorageInfo::sdPath()const
62{ 61{
63 QString r = ""; 62 QString r = "";
64 63
65 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i) 64 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i)
66 { 65 {
67 if ( (*i)->disk().left( 9 ) == "/dev/mmcd" ) 66 if ( (*i)->disk().left( 9 ) == "/dev/mmcd" )
68 { 67 {
69 r = (*i)->path(); 68 r = (*i)->path();
70 break; 69 break;
71 } 70 }
72 } 71 }
73 return r; 72 return r;
74} 73}
75 74
76/*! 75/*!
77* @fn QString StorageInfo::getMmcPath()
78* @brief returns the Mount-Path of Mmc Card 76* @brief returns the Mount-Path of Mmc Card
79* 77*
80*/ 78*/
81QString OStorageInfo::getMmcPath() 79QString OStorageInfo::mmcPath()const
82{ 80{
83 QString r = ""; 81 QString r = "";
84 82
85 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i) 83 for (QListIterator<FileSystem> i( fileSystems() ); i.current(); ++i)
86 { 84 {
87 if ( (*i)->disk().left( 14 ) == "/dev/mmc/part1" ) 85 if ( (*i)->disk().left( 14 ) == "/dev/mmc/part1" )
88 { 86 {
89 r = (*i)->path(); 87 r = (*i)->path();
90 break; 88 break;
91 } 89 }
92 } 90 }
93 return r; 91 return r;
94} 92}
diff --git a/libopie2/opiecore/ostorageinfo.h b/libopie2/opiecore/ostorageinfo.h
index ba87ff4..9b61a2e 100644
--- a/libopie2/opiecore/ostorageinfo.h
+++ b/libopie2/opiecore/ostorageinfo.h
@@ -20,30 +20,30 @@
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#ifndef OSTORAGE_H 30#ifndef OSTORAGE_H
31#define OSTORAGE_H 31#define OSTORAGE_H
32 32
33#include <qpe/storage.h> 33#include <qpe/storage.h>
34 34
35class OStorageInfo : public StorageInfo 35class OStorageInfo : public StorageInfo
36{ 36{
37 Q_OBJECT 37 Q_OBJECT
38 38
39 public: 39 public:
40public: 40public:
41 OStorageInfo( QObject *parent=0 ); 41 OStorageInfo( QObject *parent=0 );
42 ~OStorageInfo(); 42 ~OStorageInfo();
43 43
44 QString getCfPath(); 44 QString cfPath()const;
45 QString getSdPath(); 45 QString sdPath()const;
46 QString getMmcPath(); 46 QString mmcPath()const;
47}; 47};
48 48
49#endif // OSTORAGE_H 49#endif // OSTORAGE_H
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index eb69a70..2d79384 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -49,60 +49,60 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f
49 connect(restoreButton, SIGNAL(clicked()), 49 connect(restoreButton, SIGNAL(clicked()),
50 this, SLOT(restore())); 50 this, SLOT(restore()));
51 connect(backupList, SIGNAL(clicked( QListViewItem * )), 51 connect(backupList, SIGNAL(clicked( QListViewItem * )),
52 this, SLOT(selectItem(QListViewItem*))); 52 this, SLOT(selectItem(QListViewItem*)));
53 connect(restoreSource, SIGNAL(activated( int )), 53 connect(restoreSource, SIGNAL(activated( int )),
54 this, SLOT(sourceDirChanged(int))); 54 this, SLOT(sourceDirChanged(int)));
55 connect(updateList, SIGNAL(clicked()), 55 connect(updateList, SIGNAL(clicked()),
56 this, SLOT( fileListUpdate())); 56 this, SLOT( fileListUpdate()));
57 57
58 //add directorys for backing up 58 //add directorys for backing up
59 applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); 59 applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/");
60 selectItem(applicationSettings); 60 selectItem(applicationSettings);
61 applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); 61 applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/");
62 selectItem(applicationSettings); 62 selectItem(applicationSettings);
63 documents= new QListViewItem(backupList, "Documents", "", "Documents/"); 63 documents= new QListViewItem(backupList, "Documents", "", "Documents/");
64 selectItem(documents); 64 selectItem(documents);
65 65
66 scanForApplicationSettings(); 66 scanForApplicationSettings();
67 67
68 OStorageInfo storage; 68 OStorageInfo storage;
69 69
70 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" ); 70 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" );
71 if ( storage.hasCf() ) 71 if ( storage.hasCf() )
72 { 72 {
73 backupLocations.insert( "CF", storage.getCfPath() ); 73 backupLocations.insert( "CF", storage.cfPath() );
74 qDebug( "Cf Path: " + storage.getCfPath() ); 74 qDebug( "Cf Path: " + storage.cfPath() );
75 } 75 }
76 if ( storage.hasSd() ) 76 if ( storage.hasSd() )
77 { 77 {
78 backupLocations.insert( "SD", storage.getSdPath() ); 78 backupLocations.insert( "SD", storage.sdPath() );
79 qDebug( " Sd Path: " + storage.getSdPath() ); 79 qDebug( " Sd Path: " + storage.sdPath() );
80 } 80 }
81 if ( storage.hasMmc() ) 81 if ( storage.hasMmc() )
82 { 82 {
83 backupLocations.insert( "MMC", storage.getMmcPath() ); 83 backupLocations.insert( "MMC", storage.mmcPath() );
84 qDebug( "Mmc Path: " + storage.getMmcPath() ); 84 qDebug( "Mmc Path: " + storage.mmcPath() );
85 } 85 }
86 86
87 Config config("BackupAndRestore"); 87 Config config("BackupAndRestore");
88 //read last locations 88 //read last locations
89 config.setGroup("LastLocation"); 89 config.setGroup("LastLocation");
90 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" ); 90 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" );
91 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" ); 91 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" );
92 int locationIndex = 0; 92 int locationIndex = 0;
93 93
94 QMap<QString, QString>::Iterator it; 94 QMap<QString, QString>::Iterator it;
95 for( it = backupLocations.begin(); it != backupLocations.end(); ++it ) 95 for( it = backupLocations.begin(); it != backupLocations.end(); ++it )
96 { 96 {
97 storeToLocation->insertItem(it.key()); 97 storeToLocation->insertItem(it.key());
98 restoreSource->insertItem(it.key()); 98 restoreSource->insertItem(it.key());
99 99
100 //check for last locations 100 //check for last locations
101 if ( it.key() == lastStoreLocation ) 101 if ( it.key() == lastStoreLocation )
102 storeToLocation->setCurrentItem( locationIndex ); 102 storeToLocation->setCurrentItem( locationIndex );
103 if ( it.key() == lastRestoreLocation ) 103 if ( it.key() == lastRestoreLocation )
104 restoreSource->setCurrentItem( locationIndex ); 104 restoreSource->setCurrentItem( locationIndex );
105 locationIndex++; 105 locationIndex++;
106 } 106 }
107 107
108 // Read the list of items to ignore. 108 // Read the list of items to ignore.