From e467abe6814e49939f53f194f8e29d14735b28b2 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 9 Jun 2011 09:44:07 +0200 Subject: [PATCH] Added directory for distributed interactivities --- src/board/UBLibraryController.cpp | 5 ++++- src/core/UBSettings.cpp | 16 ++++++++++++++++ src/core/UBSettings.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index 162c25ae..feea7f55 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -47,7 +47,7 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardControll userPath(mPicturesStandardDirectoryPath); mInteractiveUserDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->uniboardInteractiveUserDirectory()); - + createInternalWidgetItems(); } @@ -292,6 +292,9 @@ QList UBLibraryController::addVirtualElementsForItemPath(const QS content << listElementsInPath(path.toLocalFile()); content << listElementsInPath(UBSettings::settings()->uniboardDefaultUserImageLibraryDirectory()); } + else if (pPath == mInteractiveCategoryPath.toLocalFile()){ + content << listElementsInPath(UBSettings::settings()->sankoreDistributedInteractiveDirectory()); + } return content; } diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 277b87bc..776e5e19 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -1109,6 +1109,22 @@ QString UBSettings::uniboardInteractiveUserDirectory() } +QString UBSettings::sankoreDistributedInteractiveDirectory() +{ + QString defaultRelativePath = QString("./library/sankoreInteractivities"); + + QString configPath = value("Library/DefaultUserImageDirectory", QVariant(defaultRelativePath)).toString(); + + if (configPath.startsWith(".")) + { + return UBPlatformUtils::applicationResourcesDirectory() + configPath.right(configPath.size() - 1); + } + else + { + return configPath; + } +} + QString UBSettings::uniboardInteractiveLibraryDirectory() { QString defaultRelativePath = QString("./library/interactive"); diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 3f240b53..d4720e66 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -109,6 +109,7 @@ class UBSettings : public QObject QString uniboardInteractiveUserDirectory(); QString uniboardInteractiveLibraryDirectory(); QString uniboardInteractiveFavoritesDirectory(); + QString sankoreDistributedInteractiveDirectory(); QString podcastRecordingDirectory();