Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Claudio Valerio 14 years ago
commit c97648a644
  1. 2
      src/gui/UBUpdateDlg.cpp
  2. 15
      src/transition/UniboardSankoreTransition.cpp
  3. 2
      src/transition/UniboardSankoreTransition.h

@ -61,7 +61,7 @@ void UBUpdateDlg::onFilesUpdated(bool bResult)
if(bResult)
{
qsMsg = tr("Files update successful");
qsMsg = tr("Files update successful!\nPlease reboot the application to access the updated documents.");
}
else
{

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

@ -4,6 +4,7 @@
#include <QObject>
#include <QFileInfo>
#include "gui/UBUpdateDlg.h"
#include "document/UBDocumentProxy.h"
class UniboardSankoreTransition : public QObject
{
@ -23,6 +24,7 @@ protected:
signals:
void transitionFinished(bool result);
void docAdded(UBDocumentProxy* doc);
private slots:
void startDocumentTransition();

Loading…
Cancel
Save