bad workaround for issue 1125

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent ed6f6c48e2
commit 947149eacd
  1. 2
      src/adaptors/UBSvgSubsetAdaptor.cpp
  2. 1
      src/adaptors/UBThumbnailAdaptor.cpp
  3. 4
      src/core/UBApplication.cpp
  4. 9
      src/core/UBPersistenceManager.cpp
  5. 4
      src/core/main.cpp

@ -238,7 +238,7 @@ QString UBSvgSubsetAdaptor::uniboardDocumentNamespaceUriFromVersion(int mFileVer
UBGraphicsScene* UBSvgSubsetAdaptor::loadScene(UBDocumentProxy* proxy, const int pageIndex)
{
QString fileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.svg", pageIndex);
qDebug() << fileName;
QFile file(fileName);
if (file.exists())

@ -96,7 +96,6 @@ void UBThumbnailAdaptor::updateDocumentToHandleZeroPage(UBDocumentProxy* proxy)
if(UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool()){
QString fileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.svg", 0);
QFile file(fileName);
qDebug() << fileName;
if(!file.exists()){
UBPersistenceManager::persistenceManager()->persistDocumentScene(proxy,new UBGraphicsScene(proxy),0);
}

@ -225,7 +225,6 @@ void UBApplication::setupTranslators(QStringList args)
forcedLanguage = setLanguage;
}
QStringList availablesTranslations = UBPlatformUtils::availableTranslations();
QString language("");
if(!forcedLanguage.isEmpty())
@ -362,14 +361,13 @@ int UBApplication::exec(const QString& pFileToImport)
boardController->setupLayout();
if (pFileToImport.length() > 0)
{
UBApplication::applicationController->importFile(pFileToImport);
}
#if defined(Q_WS_MAC)
static AEEventHandlerUPP ub_proc_ae_handlerUPP = AEEventHandlerUPP(ub_appleEventProcessor);
AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, ub_proc_ae_handlerUPP, SRefCon(UBApplication::applicationController), true);
#endif
if (UBSettings::settings()->appStartMode->get() == "Desktop")
applicationController->showDesktop();
else

@ -587,6 +587,15 @@ UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy,
return mSceneCache.value(proxy, sceneIndex);
else {
UBGraphicsScene* scene = UBSvgSubsetAdaptor::loadScene(proxy, sceneIndex);
// claudio: this is not a good fix but this code has to be reworked
if(!scene && UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool()){
QString fileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.svg", 0);
QFile file(fileName);
if(!file.exists()){
UBPersistenceManager::persistenceManager()->persistDocumentScene(proxy,new UBGraphicsScene(proxy),0);
}
scene = UBSvgSubsetAdaptor::loadScene(proxy, 0);
}
if (scene)
mSceneCache.insert(proxy, sceneIndex, scene);

@ -127,9 +127,9 @@ int main(int argc, char *argv[])
app.initialize(false);
QObject::connect(&app, SIGNAL(messageReceived(const QString&)), &app,
SLOT(handleOpenMessage(const QString&)));
QObject::connect(&app, SIGNAL(messageReceived(const QString&)), &app, SLOT(handleOpenMessage(const QString&)));
qDebug() << fileToOpen;
int result = app.exec(fileToOpen);
app.cleanup();

Loading…
Cancel
Save