|
|
@ -3,6 +3,7 @@ |
|
|
|
#include "frameworks/UBDesktopServices.h" |
|
|
|
#include "frameworks/UBDesktopServices.h" |
|
|
|
#include "frameworks/UBFileSystemUtils.h" |
|
|
|
#include "frameworks/UBFileSystemUtils.h" |
|
|
|
#include "core/UBApplication.h" |
|
|
|
#include "core/UBApplication.h" |
|
|
|
|
|
|
|
#include "core/UBPersistenceManager.h" |
|
|
|
|
|
|
|
|
|
|
|
UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) : |
|
|
|
UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) : |
|
|
|
QObject(parent) |
|
|
|
QObject(parent) |
|
|
@ -13,6 +14,7 @@ UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) : |
|
|
|
#else |
|
|
|
#else |
|
|
|
mUniboardSourceDirectory.replace("Sankore/Sankore 3.1", "Mnemis/Uniboard"); |
|
|
|
mUniboardSourceDirectory.replace("Sankore/Sankore 3.1", "Mnemis/Uniboard"); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
connect(this, SIGNAL(docAdded(UBDocumentProxy*)), UBPersistenceManager::persistenceManager(), SIGNAL(documentCreated(UBDocumentProxy*))); |
|
|
|
} |
|
|
|
} |
|
|
|
UniboardSankoreTransition::~UniboardSankoreTransition() |
|
|
|
UniboardSankoreTransition::~UniboardSankoreTransition() |
|
|
|
{ |
|
|
|
{ |
|
|
@ -62,11 +64,14 @@ void UniboardSankoreTransition::startDocumentTransition() |
|
|
|
QFileInfoList::iterator fileInfo; |
|
|
|
QFileInfoList::iterator fileInfo; |
|
|
|
QString sankoreDocumentDirectory = UBSettings::uniboardDocumentDirectory(); |
|
|
|
QString sankoreDocumentDirectory = UBSettings::uniboardDocumentDirectory(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QStringList qslNewDocs; |
|
|
|
|
|
|
|
|
|
|
|
for (fileInfo = fileInfoList.begin(); fileInfo != fileInfoList.end() && result; fileInfo += 1) { |
|
|
|
for (fileInfo = fileInfoList.begin(); fileInfo != fileInfoList.end() && result; fileInfo += 1) { |
|
|
|
if (fileInfo->isDir() && fileInfo->fileName().startsWith("Uniboard Document ")){ |
|
|
|
if (fileInfo->isDir() && fileInfo->fileName().startsWith("Uniboard Document ")){ |
|
|
|
QString sankoreDocumentName = fileInfo->fileName(); |
|
|
|
QString sankoreDocumentName = fileInfo->fileName(); |
|
|
|
sankoreDocumentName.replace("Uniboard","Sankore"); |
|
|
|
sankoreDocumentName.replace("Uniboard","Sankore"); |
|
|
|
result = UBFileSystemUtils::copyDir(fileInfo->filePath(),sankoreDocumentDirectory + "/" + sankoreDocumentName); |
|
|
|
result = UBFileSystemUtils::copyDir(fileInfo->filePath(),sankoreDocumentDirectory + "/" + sankoreDocumentName); |
|
|
|
|
|
|
|
qslNewDocs << sankoreDocumentName; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -75,8 +80,16 @@ void UniboardSankoreTransition::startDocumentTransition() |
|
|
|
rollbackDocumentsTransition(fileInfoList); |
|
|
|
rollbackDocumentsTransition(fileInfoList); |
|
|
|
UBFileSystemUtils::deleteDir(backupDestinationPath); |
|
|
|
UBFileSystemUtils::deleteDir(backupDestinationPath); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
UBFileSystemUtils::deleteDir(mUniboardSourceDirectory); |
|
|
|
UBFileSystemUtils::deleteDir(mUniboardSourceDirectory); |
|
|
|
|
|
|
|
// Notify the application that new documents have been added
|
|
|
|
|
|
|
|
// foreach(QString qstr, qslNewDocs)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// UBDocumentProxy* pDoc = new UBDocumentProxy();
|
|
|
|
|
|
|
|
// pDoc->setMetaData(UBSettings::documentName, qstr);
|
|
|
|
|
|
|
|
// emit docAdded(pDoc);
|
|
|
|
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
emit transitionFinished(result); |
|
|
|
emit transitionFinished(result); |
|
|
|