The beta Sankore documents are also recovered

preferencesAboutTextFull
Claudio Valerio 14 years ago
parent e665ad6bbf
commit 1e774c6e72
  1. 18
      src/transition/UniboardSankoreTransition.cpp
  2. 1
      src/transition/UniboardSankoreTransition.h

@ -8,6 +8,8 @@
UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) :
QObject(parent)
{
mOldSankoreDirectory = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::storageLocation(QDesktopServices::DataLocation));
mUniboardSourceDirectory = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::storageLocation(QDesktopServices::DataLocation));
#if defined(Q_WS_MACX)
mUniboardSourceDirectory.replace("Sankore/Sankore 3.1", "Uniboard");
@ -38,18 +40,21 @@ void UniboardSankoreTransition::rollbackDocumentsTransition(QFileInfoList& fileI
void UniboardSankoreTransition::documentTransition()
{
if (QFileInfo(mUniboardSourceDirectory).exists()){
if (QFileInfo(mUniboardSourceDirectory).exists() || QFileInfo(mOldSankoreDirectory).exists()){
QString uniboardDocumentDirectory = mUniboardSourceDirectory + "/document";
QFileInfoList fileInfoList = UBFileSystemUtils::allElementsInDirectory(uniboardDocumentDirectory);
fileInfoList << UBFileSystemUtils::allElementsInDirectory(mOldSankoreDirectory + "/document");
QString backupDirectoryPath = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::storageLocation(QDesktopServices::DesktopLocation));
if (fileInfoList.count() != 0){
mTransitionDlg = new UBUpdateDlg(0, fileInfoList.count(), backupDirectoryPath);
connect(mTransitionDlg, SIGNAL(updateFiles()), this, SLOT(startDocumentTransition()));
connect(this, SIGNAL(transitionFinished(bool)), mTransitionDlg, SLOT(onFilesUpdated(bool)));
mTransitionDlg->show();
}
}
}
void UniboardSankoreTransition::startDocumentTransition()
@ -80,16 +85,9 @@ void UniboardSankoreTransition::startDocumentTransition()
rollbackDocumentsTransition(fileInfoList);
UBFileSystemUtils::deleteDir(backupDestinationPath);
}
else
{
else{
UBFileSystemUtils::deleteDir(mOldSankoreDirectory);
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);

@ -21,6 +21,7 @@ private:
protected:
QString mUniboardSourceDirectory;
QString mOldSankoreDirectory;
signals:
void transitionFinished(bool result);

Loading…
Cancel
Save