summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/backup/backup.pro2
-rw-r--r--noncore/settings/backup/backuprestore.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/noncore/settings/backup/backup.pro b/noncore/settings/backup/backup.pro
index 7a8ad6d..4ef3e46 100644
--- a/noncore/settings/backup/backup.pro
+++ b/noncore/settings/backup/backup.pro
@@ -1,10 +1,10 @@
1 CONFIG = qt warn_on release quick-app 1 CONFIG = qt warn_on release quick-app
2 HEADERS = backuprestore.h 2 HEADERS = backuprestore.h
3 SOURCES = main.cpp backuprestore.cpp 3 SOURCES = main.cpp backuprestore.cpp
4 INCLUDEPATH+= $(OPIEDIR)/include 4 INCLUDEPATH+= $(OPIEDIR)/include
5 DEPENDPATH+= $(OPIEDIR)/include 5 DEPENDPATH+= $(OPIEDIR)/include
6LIBS += -lqpe 6LIBS += -lqpe -lopiecore2
7 INTERFACES= backuprestorebase.ui errordialog.ui 7 INTERFACES= backuprestorebase.ui errordialog.ui
8 TARGET = backup 8 TARGET = backup
9 9
10include ( $(OPIEDIR)/include.pro ) 10include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 1b34105..eb69a70 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -1,92 +1,92 @@
1 1
2#include "backuprestore.h" 2#include "backuprestore.h"
3//#include "output.h" 3//#include "output.h"
4#include "errordialog.h" 4#include "errordialog.h"
5 5
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qmultilineedit.h> 7#include <qmultilineedit.h>
8 8
9#include <qdir.h> 9#include <qdir.h>
10#include <qfile.h> 10#include <qfile.h>
11#include <qfileinfo.h> 11#include <qfileinfo.h>
12#include <qlistview.h> 12#include <qlistview.h>
13#include <qpushbutton.h> 13#include <qpushbutton.h>
14#include <qheader.h> 14#include <qheader.h>
15#include <qpe/resource.h> 15#include <qpe/resource.h>
16#include <qpe/config.h> 16#include <qpe/config.h>
17#include <qmessagebox.h> 17#include <qmessagebox.h>
18#include <qcombobox.h> 18#include <qcombobox.h>
19#include <qlist.h> 19#include <qlist.h>
20#include <stdlib.h> 20#include <stdlib.h>
21#include <qregexp.h> 21#include <qregexp.h>
22#include <qtextstream.h> 22#include <qtextstream.h>
23#include <qtextview.h> 23#include <qtextview.h>
24#include <qpe/storage.h> 24#include <opie2/ostorage.h>
25 25
26#include <errno.h> 26#include <errno.h>
27#include <stdlib.h> 27#include <stdlib.h>
28#include <unistd.h> 28#include <unistd.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#include <dirent.h> 30#include <dirent.h>
31 31
32#define HEADER_NAME 0 32#define HEADER_NAME 0
33#define HEADER_BACKUP 1 33#define HEADER_BACKUP 1
34#define BACKUP_LOCATION 2 34#define BACKUP_LOCATION 2
35 35
36#define EXTENSION ".bck" 36#define EXTENSION ".bck"
37 37
38const QString tempFileName = "/tmp/backup.err"; 38const QString tempFileName = "/tmp/backup.err";
39 39
40 40
41BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) 41BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl)
42 : BackupAndRestoreBase(parent, name, fl) 42 : BackupAndRestoreBase(parent, name, fl)
43{ 43{
44 this->showMaximized(); 44 this->showMaximized();
45 backupList->header()->hide(); 45 backupList->header()->hide();
46 restoreList->header()->hide(); 46 restoreList->header()->hide();
47 connect(backupButton, SIGNAL(clicked()), 47 connect(backupButton, SIGNAL(clicked()),
48 this, SLOT(backup())); 48 this, SLOT(backup()));
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 StorageInfo 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.getCfPath() );
74 qDebug( "Cf Path: " + storage.getCfPath() ); 74 qDebug( "Cf Path: " + storage.getCfPath() );
75 } 75 }
76 if ( storage.hasSd() ) 76 if ( storage.hasSd() )
77 { 77 {
78 backupLocations.insert( "SD", storage.getSdPath() ); 78 backupLocations.insert( "SD", storage.getSdPath() );
79 qDebug( " Sd Path: " + storage.getSdPath() ); 79 qDebug( " Sd Path: " + storage.getSdPath() );
80 } 80 }
81 if ( storage.hasMmc() ) 81 if ( storage.hasMmc() )
82 { 82 {
83 backupLocations.insert( "MMC", storage.getMmcPath() ); 83 backupLocations.insert( "MMC", storage.getMmcPath() );
84 qDebug( "Mmc Path: " + storage.getMmcPath() ); 84 qDebug( "Mmc Path: " + storage.getMmcPath() );
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;