Commit d070999f authored by Jan Möbius's avatar Jan Möbius

Added persistent backups to Core

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9517 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 129298f6
......@@ -91,6 +91,14 @@ class BackupInterface {
*/
virtual void createBackup( int /*_objectid*/, QString /*_name*/) {};
/** \brief Make a backup persistent.
*
* A persistent backup will not be removed automatically by the backup plugin.
* You have to remove it by yourself by calling removeBackup!
*/
virtual void makeBackupPersistent(int /*_objectid*/, int /*_internalId*/){};
/** \brief Tell Backup Plugin to restore a backup
*
* Plugins which supports backups can this function if they want to restore backups.\n
......@@ -190,7 +198,9 @@ class BackupInterface {
* @param _objectId Object to restore
*
*/
virtual void slotRestoreObject(int /*_objectid*/ , QString /*_name*/ , int /*_internalId*/) {}
virtual void slotRestoreObject(int /*_objectid*/ , QString /*_name*/ , int /*_internalId*/) {};
virtual void slotMakeBackupPersistent(int /*_objectid*/, int /*_internalId*/) {};
};
......
......@@ -260,6 +260,9 @@ signals:
/// Tell plugins to create a backup
void createBackup( int _objectId , QString _name , int _internalId);
/// Tell Plugins to make a backup persistent
void makeBackupPersistent(int _objectid, int _internalId);
/// Tell Backup Plugin to restore an object with the given backup id
void restoreObject( int _objectId, int _internalId);
......
......@@ -1072,6 +1072,18 @@ void Core::loadPlugin(QString filename, bool silent, QObject* _plugin){
plugin , SLOT( slotBackup(int,QString,int) ),Qt::DirectConnection);
}
// Signal send from plugin to core that a backup should be made persistent
if ( checkSignal( plugin , "makeBackupPersistent(int,int)" ) ) {
connect(plugin , SIGNAL(makeBackupPersistent(int,int)) ,
this , SIGNAL( makeBackupPersistent(int,int)) ,Qt::DirectConnection);
}
// Signal send from core to Backup plugin that the given backup should be persistent
if ( checkSlot( plugin , "slotMakeBackupPersistent(int,int)" ) ) {
connect(this , SIGNAL(makeBackupPersistent(int,int)) ,
plugin , SLOT( slotMakeBackupPersistent(int,int) ),Qt::DirectConnection);
}
// Signal from plugin to restore an object with the given id
if ( checkSignal( plugin , "restoreObject(int,int)" ) ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment