From f0bf15a3b1094749e32192760d958f8e6bf77ee2 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 22 Dec 2011 12:00:10 +0100 Subject: [PATCH 1/7] removed some warning --- src/adaptors/UBCFFSubsetAdaptor.cpp | 5 +---- src/adaptors/UBMetadataDcSubsetAdaptor.cpp | 2 -- src/adaptors/publishing/UBDocumentPublisher.cpp | 3 --- src/board/UBBoardPaletteManager.cpp | 2 +- src/core/UBSettings.cpp | 16 ---------------- src/domain/UBGraphicsScene.cpp | 13 ------------- src/gui/UBDocumentNavigator.cpp | 7 ------- src/gui/UBLibraryWidget.cpp | 2 +- src/gui/UBMagnifer.cpp | 1 - src/gui/UBToolWidget.cpp | 1 - 10 files changed, 3 insertions(+), 49 deletions(-) diff --git a/src/adaptors/UBCFFSubsetAdaptor.cpp b/src/adaptors/UBCFFSubsetAdaptor.cpp index 223d9b2f..9f7b608f 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.cpp +++ b/src/adaptors/UBCFFSubsetAdaptor.cpp @@ -729,10 +729,8 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgFlash(const QDomElement &ele QTransform transform; QString textTransform = element.attribute(aTransform); - bool hastransform = false; if (!textTransform.isNull()) { transform = transformFromString(textTransform); - hastransform = true; } repositionSvgItem(flashItem, width, height, x, y, true, transform); hashSceneItem(element, flashItem); @@ -923,13 +921,12 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseIwbElement(QDomElement &element } bool locked = false; - bool isBackground = false; bool isEditableItem = false; bool isEditable = false; //Text items to convert to UBGraphicsTextItem only QString IDRef = element.attribute(aRef); if (!IDRef.isNull()) { - isBackground = element.hasAttribute(aBackground) ? strToBool(element.attribute(aBackground)) : false; + element.hasAttribute(aBackground) ? strToBool(element.attribute(aBackground)) : false; locked = element.hasAttribute(aBackground) ? strToBool(element.attribute(aBackground)) : false; isEditableItem = element.hasAttribute(aEditable); if (isEditableItem) diff --git a/src/adaptors/UBMetadataDcSubsetAdaptor.cpp b/src/adaptors/UBMetadataDcSubsetAdaptor.cpp index fb38f59a..a5dded62 100644 --- a/src/adaptors/UBMetadataDcSubsetAdaptor.cpp +++ b/src/adaptors/UBMetadataDcSubsetAdaptor.cpp @@ -90,8 +90,6 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy) xmlWriter.writeStartElement("Description"); xmlWriter.writeAttribute("about", proxy->metaData(UBSettings::documentIdentifer).toString()); - QDate today = QDate::currentDate(); - xmlWriter.writeTextElement(nsDc, "title", proxy->metaData(UBSettings::documentName).toString()); xmlWriter.writeTextElement(nsDc, "type", proxy->metaData(UBSettings::documentGroupName).toString()); xmlWriter.writeTextElement(nsDc, "date", QDate::currentDate().toString("yyyy-MM-dd")); diff --git a/src/adaptors/publishing/UBDocumentPublisher.cpp b/src/adaptors/publishing/UBDocumentPublisher.cpp index 02f8d900..d3ec39dd 100644 --- a/src/adaptors/publishing/UBDocumentPublisher.cpp +++ b/src/adaptors/publishing/UBDocumentPublisher.cpp @@ -240,8 +240,6 @@ void UBDocumentPublisher::upgradeDocumentForPublishing() { UBGraphicsScene *scene = UBSvgSubsetAdaptor::loadScene(mPublishingDocument, pageIndex); - bool sceneHasWidget = false; - QList widgets; foreach(QGraphicsItem* item, scene->items()){ @@ -249,7 +247,6 @@ void UBDocumentPublisher::upgradeDocumentForPublishing() if(widgetItem){ generateWidgetPropertyScript(widgetItem, pageIndex + 1); - sceneHasWidget = true; widgets << widgetItem; } } diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 986a8356..bbd23925 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -81,8 +81,8 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll , mpLibWidget(NULL) , mpCachePropWidget(NULL) , mpTeacherBarWidget(NULL) - , mpDesktopLibWidget(NULL) , mpDownloadWidget(NULL) + , mpDesktopLibWidget(NULL) , mDownloadInProgress(false) { setupPalettes(); diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 0d39c960..c709c4e9 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -854,8 +854,6 @@ QString UBSettings::uniboardUserVideoDirectory() QString valideUserVideoDirectory = UBDesktopServices::storageLocation(QDesktopServices::MoviesLocation); - bool hasCreatedDir = false; - // first look into the application settings if (sAppSettings && getAppSettings()->contains("App/UserVideoDirectory")) { @@ -889,7 +887,6 @@ QString UBSettings::uniboardUserVideoDirectory() if (!dir.exists()) { dir.mkpath(userVideoDirectory); - hasCreatedDir = true; } if (dir.exists()) @@ -898,7 +895,6 @@ QString UBSettings::uniboardUserVideoDirectory() } else { - hasCreatedDir = false; qWarning() << "Failed to interpret App/UserVideoDirectory config : " + getAppSettings()->value("App/UserVideoDirectory").toString() + ", defaulting to " + valideUserVideoDirectory; @@ -929,8 +925,6 @@ QString UBSettings::podcastRecordingDirectory() QString validePodcastRecordingDirectory = UBDesktopServices::storageLocation(QDesktopServices::DesktopLocation); - bool hasCreatedDir = false; - // first look into the application settings if (sAppSettings && getAppSettings()->contains("Podcast/RecordingDirectory")) { @@ -964,7 +958,6 @@ QString UBSettings::podcastRecordingDirectory() if (!dir.exists()) { dir.mkpath(userPodcastRecordingDirectory); - hasCreatedDir = true; } if (dir.exists()) @@ -973,7 +966,6 @@ QString UBSettings::podcastRecordingDirectory() } else { - hasCreatedDir = false; qWarning() << "Failed to interpret Podcast/RecordingDirectory config : " + getAppSettings()->value("Podcast/RecordingDirectory").toString() + ", defaulting to user Desktop"; @@ -1099,8 +1091,6 @@ QString UBSettings::uniboardInteractiveUserDirectory() { QString valideUserInteractiveDirectory = uniboardDataDirectory() + "/interactive content"; - bool hasCreatedDir = false; - // first look into the application settings if (sAppSettings && getAppSettings()->contains("App/UserInteractiveContentDirectory")) { @@ -1129,7 +1119,6 @@ QString UBSettings::uniboardInteractiveUserDirectory() if (!dir.exists()) { dir.mkpath(userWidgetDirectory); - hasCreatedDir = true; } if (dir.exists()) @@ -1138,7 +1127,6 @@ QString UBSettings::uniboardInteractiveUserDirectory() } else { - hasCreatedDir = false; qWarning() << "Failed to interpret App/UserInteractiveContentDirectory config : " + getAppSettings()->value("App/UserInteractiveContentDirectory").toString() + ", defaulting to " + valideUserInteractiveDirectory; @@ -1194,8 +1182,6 @@ QString UBSettings::uniboardInteractiveFavoritesDirectory() { QString valideUserInteractiveDirectory = uniboardDataDirectory() + "/interactive favorites"; - bool hasCreatedDir = false; - // first look into the application settings if (sAppSettings && getAppSettings()->contains("App/UserInteractiveFavoritesDirectory")) { @@ -1224,7 +1210,6 @@ QString UBSettings::uniboardInteractiveFavoritesDirectory() if (!dir.exists()) { dir.mkpath(userWidgetDirectory); - hasCreatedDir = true; } if (dir.exists()) @@ -1233,7 +1218,6 @@ QString UBSettings::uniboardInteractiveFavoritesDirectory() } else { - hasCreatedDir = false; qWarning() << "Failed to interpret App/UserInteractiveFavoritesDirectory config : " + getAppSettings()->value("App/UserInteractiveFavoritesDirectory").toString() + ", defaulting to " + valideUserInteractiveDirectory; diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 476dd289..4698cc48 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1586,8 +1586,6 @@ void UBGraphicsScene::addMagnifier(UBMagnifierParams params) QGraphicsView *cView = (QGraphicsView*)UBApplication::boardController->controlView(); QGraphicsView *dView = (QGraphicsView*)UBApplication::boardController->displayView(); - QPoint ccZeroPoint = cContainer->mapToGlobal(QPoint(0,0)); - QPoint cvZeroPoint = cView->mapToGlobal(QPoint(0,0)); QPoint dvZeroPoint = dView->mapToGlobal(QPoint(0,0)); int cvW = cView->width(); @@ -1635,8 +1633,6 @@ void UBGraphicsScene::moveMagnifier(QPoint newPos) QGraphicsView *cView = (QGraphicsView*)UBApplication::boardController->controlView(); QGraphicsView *dView = (QGraphicsView*)UBApplication::boardController->displayView(); - QPoint ccZeroPoint = cContainer->mapToGlobal(QPoint(0,0)); - QPoint cvZeroPoint = cView->mapToGlobal(QPoint(0,0)); QPoint dvZeroPoint = dView->mapToGlobal(QPoint(0,0)); int cvW = cView->width(); @@ -1711,16 +1707,7 @@ void UBGraphicsScene::addCache() { UBGraphicsCache* cache = new UBGraphicsCache(); mTools << cache; - QGraphicsView* view; - if(UBApplication::applicationController->displayManager()->hasDisplay()) - { - view = (QGraphicsView*)(UBApplication::boardController->displayView()); - } - else - { - view = (QGraphicsView*)(UBApplication::boardController->controlView()); - } addItem(cache); cache->setVisible(true); cache->setSelected(true); diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp index fea695f4..1526a087 100644 --- a/src/gui/UBDocumentNavigator.cpp +++ b/src/gui/UBDocumentNavigator.cpp @@ -105,7 +105,6 @@ void UBDocumentNavigator::generateThumbnails() // Get the thumbnails QList thumbs = UBThumbnailAdaptor::load(mCrntDoc); - QGraphicsPixmapItem* selection = NULL; for(int i = 0; i < thumbs.count(); i++) { @@ -115,7 +114,6 @@ void UBDocumentNavigator::generateThumbnails() // Get the selected item if(UBApplication::boardController->activeSceneIndex() == i) { - selection = pixmapItem; mCrntItem = dynamic_cast(pixmapItem); mCrntItem->setSelected(true); } @@ -289,11 +287,6 @@ void UBDocumentNavigator::refreshScene() mLabels.at(i)->setPos(pos); } } - - QScrollBar *vertScrollBar = verticalScrollBar(); - int scrollBarThickness = 0; - if (vertScrollBar && vertScrollBar->isVisible()) - scrollBarThickness = vertScrollBar->width(); } /** diff --git a/src/gui/UBLibraryWidget.cpp b/src/gui/UBLibraryWidget.cpp index 53a0b2a1..31371a83 100644 --- a/src/gui/UBLibraryWidget.cpp +++ b/src/gui/UBLibraryWidget.cpp @@ -39,9 +39,9 @@ */ UBLibraryWidget::UBLibraryWidget(QWidget *parent, const char *name):UBThumbnailWidget(parent) , chainedElements(NULL) + , mLibraryController(NULL) , mpCrntDir(NULL) , mpCrntElem(NULL) - , mLibraryController(NULL) , mpTmpElem(NULL) { setObjectName(name); diff --git a/src/gui/UBMagnifer.cpp b/src/gui/UBMagnifer.cpp index c1a779a7..b98edf18 100644 --- a/src/gui/UBMagnifer.cpp +++ b/src/gui/UBMagnifer.cpp @@ -204,7 +204,6 @@ void UBMagnifier::mouseMoveEvent ( QMouseEvent * event ) { if(mShouldMoveWidget && (event->buttons() & Qt::LeftButton)) { - QPoint offset = event->pos() - mMousePressPos; move(pos() - mMousePressPos + event->pos()); event->accept(); diff --git a/src/gui/UBToolWidget.cpp b/src/gui/UBToolWidget.cpp index ea1bdee1..5bea3f1a 100644 --- a/src/gui/UBToolWidget.cpp +++ b/src/gui/UBToolWidget.cpp @@ -183,7 +183,6 @@ void UBToolWidget::mouseMoveEvent ( QMouseEvent * event ) { if(mShouldMoveWidget && (event->buttons() & Qt::LeftButton)) { - QPoint offset = event->pos() - mMousePressPos; move(pos() - mMousePressPos + event->pos()); event->accept(); } From ee2bd803157d23e611477c778d726e36665c2e3b Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 22 Dec 2011 12:06:28 +0100 Subject: [PATCH 2/7] removed some other warning --- src/board/UBBoardController.cpp | 4 +--- src/gui/UBActionPalette.cpp | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 2ca0fe6d..7eac5b9e 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -1184,7 +1184,6 @@ void UBBoardController::ClearUndoStack() { QSet uniqueItems; // go through all stack command - int count = UBApplication::undoStack->count(); for(int i = 0; i < UBApplication::undoStack->count(); i++) { @@ -1214,7 +1213,6 @@ void UBBoardController::ClearUndoStack() // clear stack, and command list UBApplication::undoStack->clear(); - count = UBApplication::undoStack->count(); // go through all unique items, and check, ot on scene, or not. // if not on scene, than item can be deleted @@ -1226,7 +1224,7 @@ void UBBoardController::ClearUndoStack() UBGraphicsScene *scene = (UBGraphicsScene*)item->scene(); if(!scene) { - bool retCode = mActiveScene->deleteItem(item); + mActiveScene->deleteItem(item); } } diff --git a/src/gui/UBActionPalette.cpp b/src/gui/UBActionPalette.cpp index c5cd1ea6..564cf7b4 100644 --- a/src/gui/UBActionPalette.cpp +++ b/src/gui/UBActionPalette.cpp @@ -48,6 +48,7 @@ UBActionPalette::UBActionPalette(Qt::Corner corner, QWidget * parent, Qt::Orient void UBActionPalette::init(Qt::Orientation orientation) { + Q_UNUSED(orientation); m_customCloseProcessing = false; mButtonSize = QSize(32, 32); @@ -57,13 +58,6 @@ void UBActionPalette::init(Qt::Orientation orientation) mToolButtonStyle = Qt::ToolButtonIconOnly; mButtons.clear(); - QBoxLayout *layout = 0; - - if (orientation == Qt::Horizontal) - layout = new QHBoxLayout(this); - else - layout = new QVBoxLayout(this); - updateLayout(); } From 93042e7e8a98ab760d1e44c1c88031276c21e53e Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 22 Dec 2011 13:20:53 +0100 Subject: [PATCH 3/7] restored old version because it's necessary --- src/gui/UBActionPalette.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/UBActionPalette.cpp b/src/gui/UBActionPalette.cpp index 564cf7b4..c5cd1ea6 100644 --- a/src/gui/UBActionPalette.cpp +++ b/src/gui/UBActionPalette.cpp @@ -48,7 +48,6 @@ UBActionPalette::UBActionPalette(Qt::Corner corner, QWidget * parent, Qt::Orient void UBActionPalette::init(Qt::Orientation orientation) { - Q_UNUSED(orientation); m_customCloseProcessing = false; mButtonSize = QSize(32, 32); @@ -58,6 +57,13 @@ void UBActionPalette::init(Qt::Orientation orientation) mToolButtonStyle = Qt::ToolButtonIconOnly; mButtons.clear(); + QBoxLayout *layout = 0; + + if (orientation == Qt::Horizontal) + layout = new QHBoxLayout(this); + else + layout = new QVBoxLayout(this); + updateLayout(); } From 08027012ebb804f9fc9e8d79f3d403e1b20a8271 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 22 Dec 2011 13:43:19 +0100 Subject: [PATCH 4/7] fixed Sankore data path issue. We should provide an way to recover old data --- src/core/UBSettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index c709c4e9..e368aedb 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -762,7 +762,7 @@ QString UBSettings::uniboardDataDirectory() } } QString qtDataPath = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::storageLocation(QDesktopServices::DataLocation)); - qtDataPath.replace("/Sankore", ""); + qtDataPath.replace("/Sankore/Sankore 3.1", "/Sankore"); return qtDataPath; } From 540de5173442f2b22844a03d819d7ab37fcd832e Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Fri, 23 Dec 2011 08:47:57 +0100 Subject: [PATCH 5/7] Fixed some issue name --- src/core/UBApplication.cpp | 3 +-- src/core/UBSettings.cpp | 2 +- src/gui/UBActionPalette.cpp | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index 992204ee..b0f063f4 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -109,7 +109,7 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing setOrganizationName("Sankore"); setOrganizationDomain("sankore.org"); - setApplicationName("Sankore 3.1"); + setApplicationName("Open-Sankore"); setApplicationVersion(UBVERSION); @@ -222,7 +222,6 @@ int UBApplication::exec(const QString& pFileToImport) QWebSettings *gs = QWebSettings::globalSettings(); gs->setAttribute(QWebSettings::JavaEnabled, true); gs->setAttribute(QWebSettings::PluginsEnabled, true); - gs->setAttribute(QWebSettings::JavaEnabled, true); gs->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true); gs->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true); gs->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true); diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index e368aedb..63f06d6b 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -762,7 +762,7 @@ QString UBSettings::uniboardDataDirectory() } } QString qtDataPath = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::storageLocation(QDesktopServices::DataLocation)); - qtDataPath.replace("/Sankore/Sankore 3.1", "/Sankore"); + qtDataPath.replace("/Open-Sankore", ""); return qtDataPath; } diff --git a/src/gui/UBActionPalette.cpp b/src/gui/UBActionPalette.cpp index c5cd1ea6..9647590e 100644 --- a/src/gui/UBActionPalette.cpp +++ b/src/gui/UBActionPalette.cpp @@ -306,9 +306,5 @@ UBActionPaletteButton* UBActionPalette::getButtonFromAction(QAction *action) bool UBActionPaletteButton::hitButton(const QPoint &pos) const { Q_UNUSED(pos); -// if(isChecked()) -// { -// return false; -// } return true; } From 7c9e34d5ce6c14cb6a8cad0474465b2b455b68b5 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Fri, 23 Dec 2011 08:55:27 +0100 Subject: [PATCH 6/7] fixed path on mac --- src/core/UBSettings.cpp | 1 + src/frameworks/UBDesktopServices_mac.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 63f06d6b..8d01f3c2 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -763,6 +763,7 @@ QString UBSettings::uniboardDataDirectory() } QString qtDataPath = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::storageLocation(QDesktopServices::DataLocation)); qtDataPath.replace("/Open-Sankore", ""); + qDebug() << qtDataPath; return qtDataPath; } diff --git a/src/frameworks/UBDesktopServices_mac.cpp b/src/frameworks/UBDesktopServices_mac.cpp index a2b9a019..839502dc 100644 --- a/src/frameworks/UBDesktopServices_mac.cpp +++ b/src/frameworks/UBDesktopServices_mac.cpp @@ -96,7 +96,7 @@ QString UBDesktopServices::storageLocation(StandardLocation type) QString path = getFullPath(ref); if (QDesktopServices::DataLocation == type || QDesktopServices::CacheLocation == type) - path += "/Sankore/Sankore"; + path += "/Sankore/Open-Sankore"; return path; } From f3146a028b3b82b2e186d04cb4ad130ae61e7269 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Fri, 23 Dec 2011 10:56:37 +0100 Subject: [PATCH 7/7] Removed UBDesktopServices because QDesktopService has been fixed on Qt --- src/adaptors/UBExportAdaptor.cpp | 1 - src/board/UBLibraryController.cpp | 7 +- src/core/UBPersistenceManager.cpp | 3 +- src/core/UBSettings.cpp | 26 ++--- src/desktop/UBDesktopAnnotationController.cpp | 1 + src/document/UBDocumentController.cpp | 1 - src/frameworks/UBDesktopServices.h | 34 ------ src/frameworks/UBDesktopServices_linux.cpp | 21 ---- src/frameworks/UBDesktopServices_mac.cpp | 103 ------------------ src/frameworks/UBDesktopServices_win.cpp | 23 ---- src/frameworks/UBFileSystemUtils.cpp | 7 +- src/frameworks/frameworks.pri | 87 +++++++-------- src/network/UBNetworkAccessManager.cpp | 2 - src/podcast/UBPodcastController.cpp | 1 - .../quicktime/UBQuickTimeVideoEncoder.cpp | 1 - .../UBWindowsMediaVideoEncoder.cpp | 1 - .../UBSoftwareUpdateController.cpp | 1 - src/tools/UBGraphicsCache.cpp | 3 +- src/transition/UniboardSankoreTransition.cpp | 7 +- src/web/UBTrapFlashController.cpp | 2 +- src/web/browser/WBDownloadManager.cpp | 4 +- 21 files changed, 67 insertions(+), 269 deletions(-) delete mode 100644 src/frameworks/UBDesktopServices.h delete mode 100644 src/frameworks/UBDesktopServices_linux.cpp delete mode 100644 src/frameworks/UBDesktopServices_mac.cpp delete mode 100644 src/frameworks/UBDesktopServices_win.cpp diff --git a/src/adaptors/UBExportAdaptor.cpp b/src/adaptors/UBExportAdaptor.cpp index 737a27b5..e2b8b3f6 100644 --- a/src/adaptors/UBExportAdaptor.cpp +++ b/src/adaptors/UBExportAdaptor.cpp @@ -17,7 +17,6 @@ #include "document/UBDocumentProxy.h" -#include "frameworks/UBDesktopServices.h" #include "frameworks/UBFileSystemUtils.h" #include "core/UBSettings.h" diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index 1326b458..12c0eb67 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -16,7 +16,6 @@ #include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBPlatformUtils.h" -#include "frameworks/UBDesktopServices.h" #include "core/UBApplication.h" #include "core/UBPersistenceManager.h" @@ -54,13 +53,13 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget) : { readFavoriteList(); - mAudioStandardDirectoryPath = QUrl::fromLocalFile(UBDesktopServices::storageLocation(QDesktopServices::MusicLocation)); + mAudioStandardDirectoryPath = QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MusicLocation)); userPath(mAudioStandardDirectoryPath); - mVideoStandardDirectoryPath = QUrl::fromLocalFile(UBDesktopServices::storageLocation(QDesktopServices::MoviesLocation)); + mVideoStandardDirectoryPath = QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation)); userPath(mVideoStandardDirectoryPath); - mPicturesStandardDirectoryPath = QUrl::fromLocalFile(UBDesktopServices::storageLocation(QDesktopServices::PicturesLocation)); + mPicturesStandardDirectoryPath = QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation)); userPath(mPicturesStandardDirectoryPath); mInteractiveUserDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->uniboardInteractiveUserDirectory()); diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 8e92e360..9ac5d13a 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -20,7 +20,6 @@ #include "frameworks/UBPlatformUtils.h" #include "frameworks/UBFileSystemUtils.h" -#include "frameworks/UBDesktopServices.h" #include "core/UBApplication.h" #include "core/UBSettings.h" @@ -171,7 +170,7 @@ QStringList UBPersistenceManager::allGips() QStringList UBPersistenceManager::allSounds() { - QString soundLibraryPath = UBDesktopServices::storageLocation(QDesktopServices::MusicLocation); + QString soundLibraryPath = QDesktopServices::storageLocation(QDesktopServices::MusicLocation); QDir dir(soundLibraryPath); diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 8d01f3c2..9847842f 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -13,7 +13,6 @@ #include "frameworks/UBPlatformUtils.h" #include "frameworks/UBFileSystemUtils.h" -#include "frameworks/UBDesktopServices.h" #include "frameworks/UBCryptoUtils.h" #include "UB.h" @@ -294,15 +293,15 @@ void UBSettings::init() mirroringRefreshRateInFps = new UBSetting(this, "Mirroring", "RefreshRateInFramePerSecond", QVariant(defaultRefreshRateInFramePerSecond)); - lastImportFilePath = new UBSetting(this, "Import", "LastImportFilePath", QVariant(UBDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); - lastImportFolderPath = new UBSetting(this, "Import", "LastImportFolderPath", QVariant(UBDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); - lastExportFilePath = new UBSetting(this, "Export", "LastExportFilePath", QVariant(UBDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); - lastExportDirPath = new UBSetting(this, "Export", "LastExportDirPath", QVariant(UBDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); - lastImportToLibraryPath = new UBSetting(this, "Library", "LastImportToLibraryPath", QVariant(UBDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); + lastImportFilePath = new UBSetting(this, "Import", "LastImportFilePath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); + lastImportFolderPath = new UBSetting(this, "Import", "LastImportFolderPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); + lastExportFilePath = new UBSetting(this, "Export", "LastExportFilePath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); + lastExportDirPath = new UBSetting(this, "Export", "LastExportDirPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); + lastImportToLibraryPath = new UBSetting(this, "Library", "LastImportToLibraryPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); - lastPicturePath = new UBSetting(this, "Library", "LastPicturePath", QVariant(UBDesktopServices::storageLocation(QDesktopServices::PicturesLocation))); - lastWidgetPath = new UBSetting(this, "Library", "LastWidgetPath", QVariant(UBDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); - lastVideoPath = new UBSetting(this, "Library", "LastVideoPath", QVariant(UBDesktopServices::storageLocation(QDesktopServices::MoviesLocation))); + lastPicturePath = new UBSetting(this, "Library", "LastPicturePath", QVariant(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation))); + lastWidgetPath = new UBSetting(this, "Library", "LastWidgetPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation))); + lastVideoPath = new UBSetting(this, "Library", "LastVideoPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation))); defaultDocumentGroupName = tr("Untitled Documents"); documentTrashGroupName = tr("Trash"); @@ -761,9 +760,8 @@ QString UBSettings::uniboardDataDirectory() // ", defaulting to " + UBDesktopServices::storageLocation(QDesktopServices::DataLocation); } } - QString qtDataPath = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::storageLocation(QDesktopServices::DataLocation)); + QString qtDataPath = UBFileSystemUtils::normalizeFilePath(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); qtDataPath.replace("/Open-Sankore", ""); - qDebug() << qtDataPath; return qtDataPath; } @@ -771,7 +769,7 @@ QString UBSettings::uniboardDataDirectory() QString UBSettings::uniboardUserImageDirectory() { QString valideUserImageDirectory = - UBDesktopServices::storageLocation(QDesktopServices::PicturesLocation) + QDesktopServices::storageLocation(QDesktopServices::PicturesLocation) + "/" + QCoreApplication::applicationName(); bool hasCreatedDir = false; @@ -853,7 +851,7 @@ QString UBSettings::defaultUserImagesDirectory() QString UBSettings::uniboardUserVideoDirectory() { QString valideUserVideoDirectory = - UBDesktopServices::storageLocation(QDesktopServices::MoviesLocation); + QDesktopServices::storageLocation(QDesktopServices::MoviesLocation); // first look into the application settings if (sAppSettings && getAppSettings()->contains("App/UserVideoDirectory")) @@ -924,7 +922,7 @@ QString UBSettings::uniboardUserVideoDirectory() QString UBSettings::podcastRecordingDirectory() { QString validePodcastRecordingDirectory = - UBDesktopServices::storageLocation(QDesktopServices::DesktopLocation); + QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); // first look into the application settings if (sAppSettings && getAppSettings()->contains("Podcast/RecordingDirectory")) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index aa4b0504..48663bf2 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -372,6 +372,7 @@ void UBDesktopAnnotationController::close() void UBDesktopAnnotationController::stylusToolChanged(int tool) { + Q_UNUSED(tool); // UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool; // if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text) // { diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 27539123..04595b12 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -19,7 +19,6 @@ #include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBStringUtils.h" -#include "frameworks/UBDesktopServices.h" #include "frameworks/UBPlatformUtils.h" #include "core/UBApplication.h" diff --git a/src/frameworks/UBDesktopServices.h b/src/frameworks/UBDesktopServices.h deleted file mode 100644 index 0e7c3dc9..00000000 --- a/src/frameworks/UBDesktopServices.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This program 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, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 this program. If not, see . - */ - -#ifndef UBDESKTOPSERVICES_H_ -#define UBDESKTOPSERVICES_H_ - -#include -#include - -#include "core/memcheck.h" - -// TODO Qt 4.6 #error Delete this UBDesktopServices class, -// it was used to work around a bug in Qt 4.4 that was fixed in Qt 4.5 and another that should be fixed -// in 4.5.1 - -class UBDesktopServices : public QDesktopServices -{ - public: - static QString storageLocation(StandardLocation type); -}; - -#endif /* UBDESKTOPSERVICES_H_ */ diff --git a/src/frameworks/UBDesktopServices_linux.cpp b/src/frameworks/UBDesktopServices_linux.cpp deleted file mode 100644 index 2c03b51b..00000000 --- a/src/frameworks/UBDesktopServices_linux.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This program 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, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 this program. If not, see . - */ - -#include "UBDesktopServices.h" - -QString UBDesktopServices::storageLocation(StandardLocation type) -{ - return QDesktopServices::storageLocation(type); -} diff --git a/src/frameworks/UBDesktopServices_mac.cpp b/src/frameworks/UBDesktopServices_mac.cpp deleted file mode 100644 index 839502dc..00000000 --- a/src/frameworks/UBDesktopServices_mac.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This program 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, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 this program. If not, see . - */ - -#include "UBDesktopServices.h" - -#include - -#import - -/* - Translates a QDesktopServices::StandardLocation into the mac equivalent. -*/ -OSType translateLocation(QDesktopServices::StandardLocation type) -{ - switch (type) { - case QDesktopServices::DesktopLocation: - return kDesktopFolderType; break; - - case QDesktopServices::DocumentsLocation: - return kDocumentsFolderType; break; - - case QDesktopServices::FontsLocation: - // There are at least two different font directories on the mac: /Library/Fonts and ~/Library/Fonts. - // To select a specific one we have to specify a different first parameter when calling FSFindFolder. - return kFontsFolderType; break; - - case QDesktopServices::ApplicationsLocation: - return kApplicationsFolderType; break; - - case QDesktopServices::MusicLocation: - return kMusicDocumentsFolderType; break; - - case QDesktopServices::MoviesLocation: - return kMovieDocumentsFolderType; break; - - case QDesktopServices::PicturesLocation: - return kPictureDocumentsFolderType; break; - - case QDesktopServices::TempLocation: - return kTemporaryFolderType; break; - - case QDesktopServices::DataLocation: - return kApplicationSupportFolderType; break; - - case QDesktopServices::CacheLocation: - return kCachedDataFolderType; break; - - default: - return kDesktopFolderType; break; - } -} - -/* - Constructs a full unicode path from a FSRef. -*/ -static QString getFullPath(const FSRef &ref) -{ - QByteArray ba(2048, 0); - if (FSRefMakePath(&ref, reinterpret_cast(ba.data()), ba.size()) == noErr) - return QString::fromUtf8(ba).normalized(QString::NormalizationForm_C); - return QString(); -} - -// Mac OS X implementation of QDesktopServices is bugged in Qt 4.4, -// we use the implementation inspired from Qt 4.5 snapshot -QString UBDesktopServices::storageLocation(StandardLocation type) -{ - if (QDesktopServices::HomeLocation == type) - return QDir::homePath(); - else if (QDesktopServices::TempLocation == type) - return QDir::tempPath(); - - short domain = kOnAppropriateDisk; - - if (QDesktopServices::DataLocation == type || QDesktopServices::CacheLocation == type) - domain = kUserDomain; - - // http://developer.apple.com/documentation/Carbon/Reference/Folder_Manager/Reference/reference.html - FSRef ref; - OSErr err = FSFindFolder(domain, translateLocation(type), false, &ref); - if (err) - return QString(); - - QString path = getFullPath(ref); - - if (QDesktopServices::DataLocation == type || QDesktopServices::CacheLocation == type) - path += "/Sankore/Open-Sankore"; - - return path; -} - diff --git a/src/frameworks/UBDesktopServices_win.cpp b/src/frameworks/UBDesktopServices_win.cpp deleted file mode 100644 index d92fa1e7..00000000 --- a/src/frameworks/UBDesktopServices_win.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This program 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, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 this program. If not, see . - */ - -#include "UBDesktopServices.h" -#include "core/memcheck.h" - -QString UBDesktopServices::storageLocation(StandardLocation type) -{ - // Windows implementation of QDesktopServices is fine - return QDesktopServices::storageLocation(type); -} diff --git a/src/frameworks/UBFileSystemUtils.cpp b/src/frameworks/UBFileSystemUtils.cpp index 1c315dfe..1cd8e27e 100644 --- a/src/frameworks/UBFileSystemUtils.cpp +++ b/src/frameworks/UBFileSystemUtils.cpp @@ -14,7 +14,6 @@ */ #include "UBFileSystemUtils.h" -#include "UBDesktopServices.h" #include @@ -57,12 +56,12 @@ bool UBFileSystemUtils::isAZipFile(QString &filePath) QString UBFileSystemUtils::defaultTempDirPath() { - return UBDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/" + defaultTempDirName(); + return QDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/" + defaultTempDirName(); } QString UBFileSystemUtils::createTempDir(const QString& templateString, bool autoDeleteOnExit) { - QString appTempDir = UBDesktopServices::storageLocation(QDesktopServices::TempLocation) + QString appTempDir = QDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/" + templateString; int index = 0; @@ -127,7 +126,7 @@ void UBFileSystemUtils::deleteAllTempDirCreatedDuringSession() void UBFileSystemUtils::cleanupGhostTempFolders(const QString& templateString) { - QDir dir(UBDesktopServices::storageLocation(QDesktopServices::TempLocation)); + QDir dir(QDesktopServices::storageLocation(QDesktopServices::TempLocation)); foreach (QFileInfo dirContent, dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden , QDir::Name)) { diff --git a/src/frameworks/frameworks.pri b/src/frameworks/frameworks.pri index e38a9aa1..2f317b93 100644 --- a/src/frameworks/frameworks.pri +++ b/src/frameworks/frameworks.pri @@ -1,46 +1,41 @@ - -HEADERS += src/frameworks/UBGeometryUtils.h \ - src/frameworks/UBDesktopServices.h \ - src/frameworks/UBPlatformUtils.h \ - src/frameworks/UBFileSystemUtils.h \ - src/frameworks/UBStringUtils.h \ - src/frameworks/UBVersion.h \ - src/frameworks/UBCoreGraphicsScene.h \ - src/frameworks/UBCryptoUtils.h \ - src/frameworks/UBBase32.h - -SOURCES += src/frameworks/UBGeometryUtils.cpp \ - src/frameworks/UBPlatformUtils.cpp \ - src/frameworks/UBFileSystemUtils.cpp \ - src/frameworks/UBStringUtils.cpp \ - src/frameworks/UBVersion.cpp \ - src/frameworks/UBCoreGraphicsScene.cpp \ - src/frameworks/UBCryptoUtils.cpp \ - src/frameworks/UBBase32.cpp - - -win32 { - - SOURCES += src/frameworks/UBPlatformUtils_win.cpp \ - src/frameworks/UBDesktopServices_win.cpp -} - - -macx { - - SOURCES += src/frameworks/UBPlatformUtils_mac.mm \ - src/frameworks/UBDesktopServices_mac.cpp - -} - - -linux-g++ { - - SOURCES += src/frameworks/UBPlatformUtils_linux.cpp \ - src/frameworks/UBDesktopServices_linux.cpp -} -linux-g++-32 { - - SOURCES += src/frameworks/UBPlatformUtils_linux.cpp \ - src/frameworks/UBDesktopServices_linux.cpp -} + +HEADERS += src/frameworks/UBGeometryUtils.h \ + src/frameworks/UBPlatformUtils.h \ + src/frameworks/UBFileSystemUtils.h \ + src/frameworks/UBStringUtils.h \ + src/frameworks/UBVersion.h \ + src/frameworks/UBCoreGraphicsScene.h \ + src/frameworks/UBCryptoUtils.h \ + src/frameworks/UBBase32.h + +SOURCES += src/frameworks/UBGeometryUtils.cpp \ + src/frameworks/UBPlatformUtils.cpp \ + src/frameworks/UBFileSystemUtils.cpp \ + src/frameworks/UBStringUtils.cpp \ + src/frameworks/UBVersion.cpp \ + src/frameworks/UBCoreGraphicsScene.cpp \ + src/frameworks/UBCryptoUtils.cpp \ + src/frameworks/UBBase32.cpp + + +win32 { + + SOURCES += src/frameworks/UBPlatformUtils_win.cpp +} + + +macx { + + SOURCES += src/frameworks/UBPlatformUtils_mac.mm + +} + + +linux-g++ { + + SOURCES += src/frameworks/UBPlatformUtils_linux.cpp +} +linux-g++-32 { + + SOURCES += src/frameworks/UBPlatformUtils_linux.cpp +} diff --git a/src/network/UBNetworkAccessManager.cpp b/src/network/UBNetworkAccessManager.cpp index 4f32444a..4a7f1ed1 100644 --- a/src/network/UBNetworkAccessManager.cpp +++ b/src/network/UBNetworkAccessManager.cpp @@ -17,8 +17,6 @@ #include #include -#include "frameworks/UBDesktopServices.h" - #include "core/UBApplication.h" #include "core/UBApplicationController.h" #include "core/UBSettings.h" diff --git a/src/podcast/UBPodcastController.cpp b/src/podcast/UBPodcastController.cpp index 9b6e03d5..e377249a 100644 --- a/src/podcast/UBPodcastController.cpp +++ b/src/podcast/UBPodcastController.cpp @@ -15,7 +15,6 @@ #include "UBPodcastController.h" -#include "frameworks/UBDesktopServices.h" #include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBStringUtils.h" #include "frameworks/UBPlatformUtils.h" diff --git a/src/podcast/quicktime/UBQuickTimeVideoEncoder.cpp b/src/podcast/quicktime/UBQuickTimeVideoEncoder.cpp index f188ab80..2ae6b90e 100644 --- a/src/podcast/quicktime/UBQuickTimeVideoEncoder.cpp +++ b/src/podcast/quicktime/UBQuickTimeVideoEncoder.cpp @@ -19,7 +19,6 @@ #include -#include "frameworks/UBDesktopServices.h" #include "frameworks/UBFileSystemUtils.h" #include "core/UBApplication.h" diff --git a/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp b/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp index bc2ee2fe..1d2d773e 100644 --- a/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp +++ b/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp @@ -17,7 +17,6 @@ #include -#include "frameworks/UBDesktopServices.h" #include "frameworks/UBFileSystemUtils.h" #include "core/UBApplication.h" diff --git a/src/softwareupdate/UBSoftwareUpdateController.cpp b/src/softwareupdate/UBSoftwareUpdateController.cpp index 50fad512..6f651db1 100644 --- a/src/softwareupdate/UBSoftwareUpdateController.cpp +++ b/src/softwareupdate/UBSoftwareUpdateController.cpp @@ -14,7 +14,6 @@ */ //#include "frameworks/UBVersion.h" -//#include "frameworks/UBDesktopServices.h" //#include "frameworks/UBFileSystemUtils.h" //#include "frameworks/UBPlatformUtils.h" diff --git a/src/tools/UBGraphicsCache.cpp b/src/tools/UBGraphicsCache.cpp index a7e97895..cff7c43c 100644 --- a/src/tools/UBGraphicsCache.cpp +++ b/src/tools/UBGraphicsCache.cpp @@ -89,10 +89,9 @@ void UBGraphicsCache::init() void UBGraphicsCache::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - //Q_UNUSED(option); + Q_UNUSED(option); Q_UNUSED(widget); -// setZValue(CACHE_ZVALUE); UBGraphicsItem::assignZValue(this, CACHE_ZVALUE); painter->setBrush(mMaskColor); diff --git a/src/transition/UniboardSankoreTransition.cpp b/src/transition/UniboardSankoreTransition.cpp index 6ed3acae..32c320af 100644 --- a/src/transition/UniboardSankoreTransition.cpp +++ b/src/transition/UniboardSankoreTransition.cpp @@ -15,7 +15,6 @@ #include "UniboardSankoreTransition.h" #include "core/UBSettings.h" -#include "frameworks/UBDesktopServices.h" #include "frameworks/UBFileSystemUtils.h" #include "core/UBApplication.h" #include "core/UBPersistenceManager.h" @@ -28,9 +27,9 @@ UniboardSankoreTransition::UniboardSankoreTransition(QObject *parent) : , mTransitionDlg(NULL) , mThread(NULL) { - mOldSankoreDirectory = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::storageLocation(QDesktopServices::DataLocation)); + mOldSankoreDirectory = UBFileSystemUtils::normalizeFilePath(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); - mUniboardSourceDirectory = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::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"); @@ -86,7 +85,7 @@ void UniboardSankoreTransition::documentTransition() QFileInfoList fileInfoList = UBFileSystemUtils::allElementsInDirectory(uniboardDocumentDirectory); fileInfoList << UBFileSystemUtils::allElementsInDirectory(mOldSankoreDirectory + "/document"); - QString backupDirectoryPath = UBFileSystemUtils::normalizeFilePath(UBDesktopServices::storageLocation(QDesktopServices::DesktopLocation)); + QString backupDirectoryPath = UBFileSystemUtils::normalizeFilePath(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)); if (fileInfoList.count() != 0){ mTransitionDlg = new UBUpdateDlg(NULL, fileInfoList.count(), backupDirectoryPath); diff --git a/src/web/UBTrapFlashController.cpp b/src/web/UBTrapFlashController.cpp index d93c0a17..a701353d 100644 --- a/src/web/UBTrapFlashController.cpp +++ b/src/web/UBTrapFlashController.cpp @@ -116,7 +116,7 @@ void UBTrapFlashController::text_Changed(const QString &newText) void UBTrapFlashController::text_Edited(const QString &newText) { - + Q_UNUSED(newText); } void UBTrapFlashController::hideTrapFlash() diff --git a/src/web/browser/WBDownloadManager.cpp b/src/web/browser/WBDownloadManager.cpp index f45976d8..1b3206f6 100644 --- a/src/web/browser/WBDownloadManager.cpp +++ b/src/web/browser/WBDownloadManager.cpp @@ -58,8 +58,6 @@ #include #include -#include "frameworks/UBDesktopServices.h" - #include "network/UBAutoSaver.h" #include "network/UBNetworkAccessManager.h" #include "frameworks/UBFileSystemUtils.h" @@ -134,7 +132,7 @@ void WBDownloadItem::getFileName() { QSettings settings; settings.beginGroup(QLatin1String("downloadmanager")); - QString defaultLocation = !mCustomDownloadPath.isEmpty() ? mCustomDownloadPath : UBDesktopServices::storageLocation(QDesktopServices::DesktopLocation); + QString defaultLocation = !mCustomDownloadPath.isEmpty() ? mCustomDownloadPath : QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); QString downloadDirectory = settings.value(QLatin1String("downloadDirectory"), defaultLocation).toString(); if (!downloadDirectory.isEmpty()) downloadDirectory += QLatin1Char('/');