Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BackupAndRestore Class Reference

#include </home/clem/local/src/opie/noncore/settings/backup/backuprestore.h>

Collaboration diagram for BackupAndRestore:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BackupAndRestore (QWidget *parent=0, const char *name=0, WFlags fl=0)
 ~BackupAndRestore ()

Static Public Member Functions

static QString appName ()

Private Slots

void backup ()
void restore ()
void selectItem (QListViewItem *currentItem)
void sourceDirChanged (int)
void rescanFolder (QString directory)
void fileListUpdate ()
void addLocation ()
void removeLocation ()
void saveLocations ()
void selectLocation ()

Private Member Functions

void scanForApplicationSettings ()
int getBackupFiles (QString &backupFiles, QListViewItem *parent)
QString getExcludeFile ()
QList< QListViewItem > getAllItems (QListViewItem *item, QList< QListViewItem > &list)
void refreshBackupLocations ()
void refreshLocations ()
void backupUserData ()
void backupRootFs ()

Private Attributes

QMap< QString, QStringbackupLocations
QListViewItem * systemSettings
QListViewItem * applicationSettings
QListViewItem * documents

Constructor & Destructor Documentation

BackupAndRestore::BackupAndRestore QWidget *  parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

Definition at line 80 of file backuprestore.cpp.

References addLocation(), applicationSettings, backup(), documents, getAllItems(), HEADER_NAME, i, list, Config::readEntry(), Config::readNumEntry(), refreshBackupLocations(), refreshLocations(), removeLocation(), restore(), scanForApplicationSettings(), selectItem(), selectLocation(), Config::setGroup(), QPEApplication::showWidget(), sourceDirChanged(), and text.

BackupAndRestore::~BackupAndRestore  ) 
 

Definition at line 136 of file backuprestore.cpp.

References Config::clearGroup(), QFile::exists(), getAllItems(), HEADER_BACKUP, HEADER_NAME, i, list, QFile::remove(), Config::setGroup(), and Config::writeEntry().


Member Function Documentation

void BackupAndRestore::addLocation  )  [private, slot]
 

Definition at line 731 of file backuprestore.cpp.

References saveLocations().

Referenced by BackupAndRestore().

static QString BackupAndRestore::appName  )  [inline, static]
 

Definition at line 50 of file backuprestore.h.

References QString::fromLatin1().

void BackupAndRestore::backup  )  [private, slot]
 

The "Backup" button has been pressed. Get a list of all of the files that should be backed up. If there are no files, emit and error and exit. Determine the file name to store the backup in. Backup the file(s) using tar and gzip --best. Report failure or success

Definition at line 274 of file backuprestore.cpp.

References backupUserData().

Referenced by BackupAndRestore().

void BackupAndRestore::backupRootFs  )  [private]
 

Definition at line 284 of file backuprestore.cpp.

References QString::append(), QTextStream::atEnd(), backupLocations, QDateTime::currentDateTime(), QDateTime::date(), device, QFile::exists(), Opie::Ui::OWait::hide(), i, Opie::ODevice::inst(), IO_ReadOnly, model, Opie::Core::Model_Zaurus_SL5000, Opie::Core::Model_Zaurus_SL5500, QString::number(), odebug, oendl, on, QFile::open(), owarn, Opie::Core::perror(), qApp, QTextStream::readLine(), QString::right(), QString::rightJustify(), Opie::Ui::OWait::show(), size, QString::startsWith(), Global::statusMessage(), tr, and type.

void BackupAndRestore::backupUserData  )  [private]
 

Definition at line 392 of file backuprestore.cpp.

References backupLocations, QDateTime::currentDateTime(), QDateTime::date(), QTextStream::eof(), QPEApplication::execDialog(), QFile::exists(), EXTENSION, getBackupFiles(), getExcludeFile(), Opie::Ui::OWait::hide(), QDir::homeDirPath(), IO_ReadOnly, QString::latin1(), NULL, QString::number(), odebug, oendl, QFile::open(), owarn, Opie::Core::perror(), qApp, QTextStream::readLine(), QString::rightJustify(), s, Config::setGroup(), Opie::Ui::OWait::show(), Global::statusMessage(), t, tr, and Config::writeEntry().

Referenced by backup().

void BackupAndRestore::fileListUpdate  )  [private, slot]
 

Definition at line 537 of file backuprestore.cpp.

References backupLocations, oendl, owarn, and rescanFolder().

QList< QListViewItem > BackupAndRestore::getAllItems QListViewItem *  item,
QList< QListViewItem > &  list
[private]
 

Definition at line 215 of file backuprestore.cpp.

Referenced by BackupAndRestore(), and ~BackupAndRestore().

int BackupAndRestore::getBackupFiles QString backupFiles,
QListViewItem *  parent
[private]
 

Definition at line 495 of file backuprestore.cpp.

References BACKUP_LOCATION, HEADER_BACKUP, HEADER_NAME, and NULL.

Referenced by backupUserData().

QString BackupAndRestore::getExcludeFile  )  [private]
 

Check for exclude in Applications/backup If it does not exist, the function will create the file with *.bck as content The exclude_files is read by tar and will provide to exclude special files out from backup. e.g. alle *.bck files (backup-files) will not be backed up by default

Definition at line 695 of file backuprestore.cpp.

References Global::applicationFileName(), QFile::exists(), IO_WriteOnly, QString::null, QFile::open(), and true.

Referenced by backupUserData().

void BackupAndRestore::refreshBackupLocations  )  [private]
 

Definition at line 161 of file backuprestore.cpp.

References backupLocations, QMap< Key, T >::begin(), Opie::Core::OStorageInfo::cfPath(), QMap< Key, T >::clear(), QMap< Key, T >::end(), StorageInfo::hasCf(), StorageInfo::hasMmc(), StorageInfo::hasSd(), QDir::homeDirPath(), QMap< Key, T >::insert(), Opie::Core::OStorageInfo::mmcPath(), odebug, oendl, Config::readEntry(), Opie::Core::OStorageInfo::sdPath(), and Config::setGroup().

Referenced by BackupAndRestore(), and saveLocations().

void BackupAndRestore::refreshLocations  )  [private]
 

Definition at line 716 of file backuprestore.cpp.

References QValueList< T >::begin(), QValueList< T >::end(), Config::readListEntry(), and Config::setGroup().

Referenced by BackupAndRestore().

void BackupAndRestore::removeLocation  )  [private, slot]
 

Definition at line 742 of file backuprestore.cpp.

References saveLocations().

Referenced by BackupAndRestore().

void BackupAndRestore::rescanFolder QString  directory  )  [private, slot]
 

Scans directory for any backup files. Will recursivly go down, but will not follow symlinks.

Parameters:
directory - the directory to look in.

Definition at line 549 of file backuprestore.cpp.

References QPtrListIterator< type >::current(), d, QDir::Dirs, QDir::entryInfoList(), QDir::exists(), EXTENSION, QFileInfo::fileName(), QDir::Files, QDir::Hidden, QFileInfo::isDir(), list, and QDir::setFilter().

Referenced by fileListUpdate(), and sourceDirChanged().

void BackupAndRestore::restore  )  [private, slot]
 

Restore a backup file. Report errors or success

Definition at line 584 of file backuprestore.cpp.

References backupLocations, QTextStream::eof(), QPEApplication::execDialog(), Opie::Ui::OWait::hide(), QDir::homeDirPath(), IO_ReadOnly, QString::latin1(), NULL, odebug, oendl, QFile::open(), owarn, qApp, QTextStream::readLine(), s, Config::setGroup(), Opie::Ui::OWait::show(), Global::statusMessage(), t, tr, warning(), and Config::writeEntry().

Referenced by BackupAndRestore().

void BackupAndRestore::saveLocations  )  [private, slot]
 

Definition at line 751 of file backuprestore.cpp.

References QValueList< T >::append(), refreshBackupLocations(), Config::setGroup(), and Config::writeEntry().

Referenced by addLocation(), and removeLocation().

void BackupAndRestore::scanForApplicationSettings  )  [private]
 

Definition at line 249 of file backuprestore.cpp.

References applicationSettings, BACKUP_LOCATION, QPtrListIterator< type >::current(), d, QDir::Dirs, QDir::entryInfoList(), QFileInfo::fileName(), QDir::Files, QDir::homeDirPath(), list, QDir::NoSymLinks, selectItem(), and QDir::setFilter().

Referenced by BackupAndRestore().

void BackupAndRestore::selectItem QListViewItem *  currentItem  )  [private, slot]
 

Selects and unselects the item by setting the HEADER_BACKUP to B or !. and changing the icon to match

Parameters:
currentItem the item to swich the selection choice.

Definition at line 232 of file backuprestore.cpp.

References HEADER_BACKUP, HEADER_NAME, and Opie::Core::OResource::loadPixmap().

Referenced by BackupAndRestore(), and scanForApplicationSettings().

void BackupAndRestore::selectLocation  )  [private, slot]
 

Definition at line 766 of file backuprestore.cpp.

References Opie::Ui::OFileSelector::DIRECTORYSELECTOR, Opie::Ui::OFileDialog::getDirectory(), and QString::isEmpty().

Referenced by BackupAndRestore().

void BackupAndRestore::sourceDirChanged int   )  [private, slot]
 

Definition at line 531 of file backuprestore.cpp.

References backupLocations, and rescanFolder().

Referenced by BackupAndRestore().


Member Data Documentation

QListViewItem* BackupAndRestore::applicationSettings [private]
 

Definition at line 78 of file backuprestore.h.

Referenced by BackupAndRestore(), and scanForApplicationSettings().

QMap<QString, QString> BackupAndRestore::backupLocations [private]
 

Definition at line 69 of file backuprestore.h.

Referenced by backupRootFs(), backupUserData(), fileListUpdate(), refreshBackupLocations(), restore(), and sourceDirChanged().

QListViewItem* BackupAndRestore::documents [private]
 

Definition at line 79 of file backuprestore.h.

Referenced by BackupAndRestore().

QListViewItem* BackupAndRestore::systemSettings [private]
 

Definition at line 77 of file backuprestore.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:27:02 2005 for OPIE by  doxygen 1.4.2