Diffstat (limited to 'noncore/settings/backup/backuprestore.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index d028379..8928cda 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp | |||
@@ -78,25 +78,24 @@ const QString tempFileName = "/tmp/backup.err"; | |||
78 | BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) | 78 | BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) |
79 | : BackupAndRestoreBase(parent, name, fl) | 79 | : BackupAndRestoreBase(parent, name, fl) |
80 | { | 80 | { |
81 | backupList->header()->hide(); | 81 | backupList->header()->hide(); |
82 | restoreList->header()->hide(); | 82 | restoreList->header()->hide(); |
83 | locationList->header()->hide(); | 83 | locationList->header()->hide(); |
84 | connect( backupButton, SIGNAL( clicked() ), this, SLOT( backup() ) ); | 84 | connect( backupButton, SIGNAL( clicked() ), this, SLOT( backup() ) ); |
85 | connect( restoreButton, SIGNAL( clicked() ), this, SLOT( restore() ) ); | 85 | connect( restoreButton, SIGNAL( clicked() ), this, SLOT( restore() ) ); |
86 | connect( backupList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectItem( QListViewItem* ) ) ); | 86 | connect( backupList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectItem( QListViewItem* ) ) ); |
87 | connect( restoreSource, SIGNAL( activated( int ) ), this, SLOT( sourceDirChanged( int ) ) ); | 87 | connect( restoreSource, SIGNAL( activated( int ) ), this, SLOT( sourceDirChanged( int ) ) ); |
88 | connect( addLocationButton, SIGNAL( clicked() ), this, SLOT( addLocation() ) ); | 88 | connect( addLocationButton, SIGNAL( clicked() ), this, SLOT( addLocation() ) ); |
89 | connect( removeLocationButton, SIGNAL( clicked() ), this, SLOT( removeLocation() ) ); | 89 | connect( removeLocationButton, SIGNAL( clicked() ), this, SLOT( removeLocation() ) ); |
90 | connect( saveLocationsButton, SIGNAL( clicked() ), this, SLOT( saveLocations() ) ); | ||
91 | connect( selectLocationButton, SIGNAL( clicked() ), this, SLOT( selectLocation() ) ); | 90 | connect( selectLocationButton, SIGNAL( clicked() ), this, SLOT( selectLocation() ) ); |
92 | 91 | ||
93 | //add directorys for backing up | 92 | //add directorys for backing up |
94 | applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); | 93 | applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); |
95 | selectItem(applicationSettings); | 94 | selectItem(applicationSettings); |
96 | applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); | 95 | applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); |
97 | selectItem(applicationSettings); | 96 | selectItem(applicationSettings); |
98 | documents= new QListViewItem(backupList, "Documents", "", "Documents/"); | 97 | documents= new QListViewItem(backupList, "Documents", "", "Documents/"); |
99 | selectItem(documents); | 98 | selectItem(documents); |
100 | 99 | ||
101 | scanForApplicationSettings(); | 100 | scanForApplicationSettings(); |
102 | refreshLocations(); | 101 | refreshLocations(); |
@@ -718,32 +717,34 @@ void BackupAndRestore::refreshLocations() | |||
718 | for ( QStringList::Iterator it = locations.begin(); it != locations.end(); ++it ) { | 717 | for ( QStringList::Iterator it = locations.begin(); it != locations.end(); ++it ) { |
719 | (void) new QListViewItem( locationList, *it ); | 718 | (void) new QListViewItem( locationList, *it ); |
720 | } | 719 | } |
721 | } | 720 | } |
722 | 721 | ||
723 | void BackupAndRestore::addLocation() | 722 | void BackupAndRestore::addLocation() |
724 | { | 723 | { |
725 | if ( ( !locationEdit->text().isEmpty() ) && | 724 | if ( ( !locationEdit->text().isEmpty() ) && |
726 | ( QDir( locationEdit->text() ).exists() ) ) | 725 | ( QDir( locationEdit->text() ).exists() ) ) |
727 | { | 726 | { |
728 | (void) new QListViewItem( locationList, locationEdit->text() ); | 727 | (void) new QListViewItem( locationList, locationEdit->text() ); |
729 | locationEdit->setText( "" ); | 728 | locationEdit->setText( "" ); |
729 | saveLocations(); | ||
730 | } | 730 | } |
731 | } | 731 | } |
732 | 732 | ||
733 | void BackupAndRestore::removeLocation() | 733 | void BackupAndRestore::removeLocation() |
734 | { | 734 | { |
735 | if ( locationList->selectedItem() ) | 735 | if ( locationList->selectedItem() ) |
736 | { | 736 | { |
737 | delete( locationList->selectedItem() ); | 737 | delete( locationList->selectedItem() ); |
738 | saveLocations(); | ||
738 | } | 739 | } |
739 | } | 740 | } |
740 | 741 | ||
741 | void BackupAndRestore::saveLocations() | 742 | void BackupAndRestore::saveLocations() |
742 | { | 743 | { |
743 | Config config("BackupAndRestore"); | 744 | Config config("BackupAndRestore"); |
744 | config.setGroup("Locations"); | 745 | config.setGroup("Locations"); |
745 | 746 | ||
746 | QStringList locations; | 747 | QStringList locations; |
747 | for ( QListViewItemIterator it( locationList ); it.current(); ++it ) | 748 | for ( QListViewItemIterator it( locationList ); it.current(); ++it ) |
748 | { | 749 | { |
749 | locations.append( it.current()->text( 0 ) ); | 750 | locations.append( it.current()->text( 0 ) ); |