diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro
index 3b12b4cf..f1908440 100644
--- a/Sankore_3.1.pro
+++ b/Sankore_3.1.pro
@@ -49,7 +49,6 @@ include(src/podcast/podcast.pri)
include(src/tools/tools.pri)
include(src/desktop/desktop.pri)
include(src/web/web.pri)
-include(src/transition/transition.pri)
include(src/interfaces/interfaces.pri)
include(src/customWidgets/customWidgets.pri)
diff --git a/src/adaptors/UBExportDocument.cpp b/src/adaptors/UBExportDocument.cpp
index 81d49543..d06a2a55 100644
--- a/src/adaptors/UBExportDocument.cpp
+++ b/src/adaptors/UBExportDocument.cpp
@@ -37,8 +37,6 @@ THIRD_PARTY_WARNINGS_DISABLE
#include "quazipfile.h"
THIRD_PARTY_WARNINGS_ENABLE
-#include "transition/UniboardSankoreTransition.h"
-
#include "core/memcheck.h"
UBExportDocument::UBExportDocument(QObject *parent)
@@ -78,9 +76,7 @@ void UBExportDocument::persist(UBDocumentProxy* pDocumentProxy)
void UBExportDocument::persistsDocument(UBDocumentProxy* pDocumentProxy, QString filename)
{
- UniboardSankoreTransition document;
QString documentPath(pDocumentProxy->persistencePath());
- document.checkDocumentDirectory(documentPath);
QuaZip zip(filename);
zip.setFileNameCodec("UTF-8");
diff --git a/src/adaptors/UBWebPublisher.cpp b/src/adaptors/UBWebPublisher.cpp
index 7c9f8b18..d6cbf653 100644
--- a/src/adaptors/UBWebPublisher.cpp
+++ b/src/adaptors/UBWebPublisher.cpp
@@ -27,8 +27,6 @@
#include "adaptors/publishing/UBDocumentPublisher.h"
-#include "transition/UniboardSankoreTransition.h"
-
#include "core/memcheck.h"
UBWebPublisher::UBWebPublisher(QObject *parent)
@@ -55,9 +53,7 @@ void UBWebPublisher::persist(UBDocumentProxy* pDocumentProxy)
if (!pDocumentProxy)
return;
- UniboardSankoreTransition document;
QString documentPath(pDocumentProxy->persistencePath());
- document.checkDocumentDirectory(documentPath);
UBDocumentPublisher* publisher = new UBDocumentPublisher(pDocumentProxy, this); // the publisher will self delete when publication finishes
publisher->publish();
diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp
index 80c51605..a0e12edb 100644
--- a/src/core/UBApplication.cpp
+++ b/src/core/UBApplication.cpp
@@ -72,7 +72,6 @@ UBApplicationController* UBApplication::applicationController = 0;
UBBoardController* UBApplication::boardController = 0;
UBWebController* UBApplication::webController = 0;
UBDocumentController* UBApplication::documentController = 0;
-UniboardSankoreTransition* UBApplication::mUniboardSankoreTransition = 0;
UBMainWindow* UBApplication::mainWindow = 0;
@@ -180,9 +179,6 @@ UBApplication::~UBApplication()
delete mainWindow;
mainWindow = 0;
- delete mUniboardSankoreTransition;
- mUniboardSankoreTransition = 0;
-
UBPersistenceManager::destroy();
UBDownloadManager::destroy();
@@ -365,7 +361,6 @@ int UBApplication::exec(const QString& pFileToImport)
connect(mainWindow->actionMultiScreen, SIGNAL(triggered(bool)), applicationController, SLOT(useMultiScreen(bool)));
connect(mainWindow->actionWidePageSize, SIGNAL(triggered(bool)), boardController, SLOT(setWidePageSize(bool)));
connect(mainWindow->actionRegularPageSize, SIGNAL(triggered(bool)), boardController, SLOT(setRegularPageSize(bool)));
- connect(mainWindow->actionImportUniboardDocuments, SIGNAL(triggered()), this, SLOT(importUniboardFiles()));
connect(mainWindow->actionCut, SIGNAL(triggered()), applicationController, SLOT(actionCut()));
connect(mainWindow->actionCopy, SIGNAL(triggered()), applicationController, SLOT(actionCopy()));
@@ -399,12 +394,6 @@ void UBApplication::onScreenCountChanged(int newCount)
mainWindow->actionMultiScreen->setEnabled(displayManager.numScreens() > 1);
}
-void UBApplication::importUniboardFiles()
-{
- mUniboardSankoreTransition = new UniboardSankoreTransition();
- mUniboardSankoreTransition->documentTransition();
-}
-
#ifdef Q_WS_MAC
void UBApplication::showMinimized()
{
@@ -545,7 +534,6 @@ void UBApplication::decorateActionMenu(QAction* action)
menu->addSeparator();
menu->addAction(mainWindow->actionPreferences);
menu->addAction(mainWindow->actionMultiScreen);
- menu->addAction(mainWindow->actionImportUniboardDocuments);
// SANKORE-48: Hide the check update action if the setting
// EnableAutomaticSoftwareUpdates is false in Uniboard.config
if(UBSettings::settings()->appEnableAutomaticSoftwareUpdates->get().toBool())
@@ -662,14 +650,11 @@ void UBApplication::cleanup()
if (boardController) delete boardController;
if (webController) delete webController;
if (documentController) delete documentController;
- if (mUniboardSankoreTransition) delete mUniboardSankoreTransition;
-
applicationController = NULL;
boardController = NULL;
webController = NULL;
documentController = NULL;
- mUniboardSankoreTransition = NULL;
}
void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h
index b3d6aa27..618538b0 100644
--- a/src/core/UBApplication.h
+++ b/src/core/UBApplication.h
@@ -28,8 +28,6 @@
#include "qtsingleapplication.h"
-#include "transition/UniboardSankoreTransition.h"
-
namespace Ui
{
class MainWindow;
@@ -66,7 +64,6 @@ class UBApplication : public QtSingleApplication
static UBBoardController* boardController;
static UBWebController* webController;
static UBDocumentController* documentController;
- static UniboardSankoreTransition* mUniboardSankoreTransition;
static UBMainWindow* mainWindow;
@@ -123,8 +120,6 @@ class UBApplication : public QtSingleApplication
#ifdef Q_WS_MAC
void showMinimized();
#endif
- void importUniboardFiles();
-
void onScreenCountChanged(int newCount);
private:
diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp
index a436e383..7f648b6d 100644
--- a/src/core/UBDisplayManager.cpp
+++ b/src/core/UBDisplayManager.cpp
@@ -25,8 +25,10 @@
#include "frameworks/UBPlatformUtils.h"
-#include "core/UBApplication.h"
-#include "core/UBApplicationController.h"
+#include "UBApplication.h"
+#include "UBApplicationController.h"
+
+#include "UBSettings.h"
#include "board/UBBoardView.h"
diff --git a/src/transition/UniboardSankoreTransition.cpp b/src/transition/UniboardSankoreTransition.cpp
deleted file mode 100644
index cce8ce7d..00000000
--- a/src/transition/UniboardSankoreTransition.cpp
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright (C) 2012 Webdoc SA
- *
- * This file is part of Open-Sankoré.
- *
- * Open-Sankoré is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License,
- * with a specific linking exception for the OpenSSL project's
- * "OpenSSL" library (or with modified versions of it that use the
- * same license as the "OpenSSL" library).
- *
- * Open-Sankoré is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Open-Sankoré. If not, see .
- */
-
-
-
-#include "UniboardSankoreTransition.h"
-#include "core/UBSettings.h"
-#include "frameworks/UBFileSystemUtils.h"
-#include "core/UBApplication.h"
-#include "core/UBPersistenceManager.h"
-#include "gui/UBMainWindow.h"
-
-#include "core/memcheck.h"
-
-UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) :
- QObject(parent)
- , mTransitionDlg(NULL)
- , mThread(NULL)
-{
- mOldSankoreDirectory = UBFileSystemUtils::normalizeFilePath(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
-
- mUniboardSourceDirectory = UBFileSystemUtils::normalizeFilePath(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
-#if defined(Q_WS_MACX)
- mOldSankoreDirectory.replace("Sankore/Sankore 3.1", "Sankore");
- mUniboardSourceDirectory.replace("Sankore/Sankore 3.1", "Uniboard");
-#else
- mUniboardSourceDirectory.replace("Sankore/Sankore 3.1", "Mnemis/Uniboard");
-#endif
- connect(this, SIGNAL(docAdded(UBDocumentProxy*)), UBPersistenceManager::persistenceManager(), SIGNAL(documentCreated(UBDocumentProxy*)));
-}
-
-UniboardSankoreTransition::~UniboardSankoreTransition()
-{
- if(NULL != mTransitionDlg)
- {
- delete mTransitionDlg;
- mTransitionDlg = NULL;
- }
-
- if(mThread){
- delete mThread;
- mThread = NULL;
- }
-}
-
-void UniboardSankoreTransition::rollbackDocumentsTransition(QFileInfoList& fileInfoList)
-{
- QFileInfoList::iterator fileInfo;
- for (fileInfo = fileInfoList.begin(); fileInfo != fileInfoList.end(); fileInfo += 1) {
- if (fileInfo->isDir() && fileInfo->fileName().startsWith("Uniboard Document ")){
- QString sankoreDocumentName = fileInfo->fileName();
- sankoreDocumentName.replace("Uniboard","Sankore");
- QString sankoreDocumentDirectoryPath = UBSettings::userDocumentDirectory() + "/" + sankoreDocumentName;
- if (QFileInfo(sankoreDocumentDirectoryPath).exists()){
- UBFileSystemUtils::deleteDir(sankoreDocumentDirectoryPath);
- }
- }
- }
-}
-
-bool UniboardSankoreTransition::checkDocumentDirectory(QString& documentDirectoryPath)
-{
- bool result = true;
- result = updateSankoreHRef(documentDirectoryPath);
- QString sankoreWidgetPath = documentDirectoryPath + "/widgets";
- result &= updateIndexWidget(sankoreWidgetPath);
- return result;
-}
-
-void UniboardSankoreTransition::documentTransition()
-{
- 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(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation));
-
- if (fileInfoList.count() != 0){
- mTransitionDlg = new UBUpdateDlg(NULL, fileInfoList.count(), backupDirectoryPath);
- connect(mTransitionDlg, SIGNAL(updateFiles()), this, SLOT(startDocumentTransition()));
- connect(this, SIGNAL(transitionFinished(bool)), mTransitionDlg, SLOT(onFilesUpdated(bool)));
- mTransitionDlg->show();
- }
- }
- else{
- UBApplication::mainWindow->information(tr("Import old Uniboard/Sankore documents"), tr("There are no documents that should be imported"));
- }
-}
-
-void UniboardSankoreTransition::startDocumentTransition()
-{
- mThread = new UniboardSankoreThread(this);
- mThread->start();
- connect(this,SIGNAL(transitioningFile(QString)),mTransitionDlg,SLOT(transitioningFile(QString)));
-}
-
-
-bool UniboardSankoreTransition::checkPage(QString& sankorePagePath)
-{
- QFile file(sankorePagePath);
- if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
- return false;
-
- QByteArray documentByteArray = file.readAll();
- file.close();
-
- QString sankoreDirectory = sankorePagePath.left(sankorePagePath.indexOf("/page"));
-
- sankoreDirectory = QUrl::fromLocalFile(sankoreDirectory).toString();
- QString documentString(documentByteArray);
-
- QRegExp videoRegExp("");
- videoRegExp.setMinimal(true);
-
- documentString.replace(videoRegExp,"");
-
-
- QRegExp audioRegExp("");
- audioRegExp.setMinimal(true);
-
- documentString.replace(audioRegExp,"");
-
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
- return false;
-
- file.write(documentString.toAscii());
- file.close();
-
- return true;
-}
-
-
-bool UniboardSankoreTransition::checkWidget(QString& sankoreWidgetIndexPath)
-{
- QFile file(sankoreWidgetIndexPath);
- if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
- return false;
-
- QByteArray documentByteArray = file.readAll();
- file.close();
-
- QString documentString(documentByteArray);
-
- QRegExp swfOriginFilePathRegExp("");
- swfOriginFilePathRegExp.setMinimal(true);
- swfOriginFilePathRegExp.indexIn(documentString);
- QString origin = swfOriginFilePathRegExp.cap(1);
- if(origin.contains("http://")){
- // an url is the source of the swf. The source is kept as is.
- return true;
- }
-
- //changing the path
- QRegExp swfDataPathRegExp("