changed gips directory because it doesn't work on windows. Installation path isn't available on write mode

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 203402341d
commit 7d13b1f0d2
  1. 2
      src/board/UBLibraryController.cpp
  2. 2
      src/core/UBPersistenceManager.cpp
  3. 21
      src/core/UBSettings.cpp
  4. 3
      src/core/UBSettings.h
  5. 2
      src/web/browser/WBWebView.cpp

@ -262,7 +262,7 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
element->setMoveable(false); element->setMoveable(false);
categories << element; categories << element;
mInteractiveCategoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationGipLibraryDirectory()); mInteractiveCategoryPath = QUrl::fromLocalFile(UBSettings::settings()->userGipLibraryDirectory());
element = new UBLibElement(eUBLibElementType_Folder, mInteractiveCategoryPath, tr("Interactivities", "Interactives category element")); element = new UBLibElement(eUBLibElementType_Folder, mInteractiveCategoryPath, tr("Interactivities", "Interactives category element"));
element->setThumbnail(QImage(":images/libpalette/InteractivesCategory.svg")); element->setThumbnail(QImage(":images/libpalette/InteractivesCategory.svg"));
element->setMoveable(false); element->setMoveable(false);

@ -150,7 +150,7 @@ QStringList UBPersistenceManager::allShapes()
QStringList UBPersistenceManager::allGips() QStringList UBPersistenceManager::allGips()
{ {
QString gipLibraryPath = UBSettings::settings()->applicationGipLibraryDirectory(); QString gipLibraryPath = UBSettings::settings()->userGipLibraryDirectory();
QDir dir(gipLibraryPath); QDir dir(gipLibraryPath);

@ -882,6 +882,17 @@ QString UBSettings::userTrashDirPath()
} }
QString UBSettings::userGipLibraryDirectory()
{
static QString dirPath = "";
if(dirPath.isEmpty()){
dirPath = userDataDirectory() + "/library/gips";
checkDirectory(dirPath);
}
return dirPath;
}
QString UBSettings::applicationShapeLibraryDirectory() QString UBSettings::applicationShapeLibraryDirectory()
{ {
QString defaultRelativePath = QString("./library/shape"); QString defaultRelativePath = QString("./library/shape");
@ -896,16 +907,6 @@ QString UBSettings::applicationShapeLibraryDirectory()
} }
} }
QString UBSettings::applicationGipLibraryDirectory()
{
static QString dirPath = "";
if(dirPath.isEmpty()){
dirPath = UBPlatformUtils::applicationResourcesDirectory() + "/library/gips";
checkDirectory(dirPath);
}
return dirPath;
}
QString UBSettings::userSearchDirectory() QString UBSettings::userSearchDirectory()
{ {
static QString dirPath = ""; static QString dirPath = "";

@ -113,9 +113,10 @@ class UBSettings : public QObject
static QString userInteractiveFavoritesDirectory(); static QString userInteractiveFavoritesDirectory();
static QString userPodcastRecordingDirectory(); static QString userPodcastRecordingDirectory();
QString userGipLibraryDirectory();
//application directory //application directory
QString applicationShapeLibraryDirectory(); QString applicationShapeLibraryDirectory();
QString applicationGipLibraryDirectory();
QString applicationImageLibraryDirectory(); QString applicationImageLibraryDirectory();
QString applicationApplicationsLibraryDirectory(); QString applicationApplicationsLibraryDirectory();
QString applicationInteractivesDirectory(); QString applicationInteractivesDirectory();

@ -187,7 +187,7 @@ void WBWebPage::handleUnsupportedContent(QNetworkReply *reply)
if (!isPDF && reply->error() == QNetworkReply::NoError) if (!isPDF && reply->error() == QNetworkReply::NoError)
{ {
if(contentType == "application/widget") if(contentType == "application/widget")
WBBrowserWindow::downloadManager()->handleUnsupportedContent(reply,false, UBSettings::settings()->applicationGipLibraryDirectory()); WBBrowserWindow::downloadManager()->handleUnsupportedContent(reply,false, UBSettings::settings()->userGipLibraryDirectory());
else else
WBBrowserWindow::downloadManager()->handleUnsupportedContent(reply); WBBrowserWindow::downloadManager()->handleUnsupportedContent(reply);
return; return;

Loading…
Cancel
Save