From 262cc805b0e45117fba9be7bfa0980242cfd81fa Mon Sep 17 00:00:00 2001 From: elafargue Date: Mon, 9 May 2011 16:09:35 +0200 Subject: [PATCH] Updated opmap lib and opmap plugin to use the Utils::StoragePath correctly. --- ground/openpilotgcs/src/libs/opmapcontrol/opmapcontrol.pro | 1 + ground/openpilotgcs/src/libs/opmapcontrol/src/common.pri | 2 ++ .../openpilotgcs/src/libs/opmapcontrol/src/core/cache.cpp | 7 ++----- .../openpilotgcs/src/libs/opmapcontrol/src/core/core.pro | 3 +++ .../src/plugins/opmap/opmapgadgetconfiguration.cpp | 5 ----- .../src/plugins/opmap/opmapgadgetoptionspage.cpp | 6 +----- 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/opmapcontrol.pro b/ground/openpilotgcs/src/libs/opmapcontrol/opmapcontrol.pro index 6a3ccf724..dee478c28 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/opmapcontrol.pro +++ b/ground/openpilotgcs/src/libs/opmapcontrol/opmapcontrol.pro @@ -1,3 +1,4 @@ TEMPLATE = subdirs + SUBDIRS = src \ diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/common.pri b/ground/openpilotgcs/src/libs/opmapcontrol/src/common.pri index fa9b16603..6907c6f63 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/common.pri +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/common.pri @@ -1,4 +1,5 @@ DESTDIR = ../build + QT += network QT += sql CONFIG += staticlib @@ -6,3 +7,4 @@ TEMPLATE = lib UI_DIR = uics MOC_DIR = mocs OBJECTS_DIR = objs +INCLUDEPATH +=../../../../libs/ diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/cache.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/cache.cpp index 8f054dcbb..eb910b56a 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/cache.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/cache.cpp @@ -25,6 +25,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "cache.h" +#include "utils/pathutils.h" #include namespace core { @@ -53,11 +54,7 @@ namespace core { { if(cache.isNull()|cache.isEmpty()) { - QSettings set(QSettings::IniFormat, QSettings::UserScope,QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS")); - QDir dir(set.fileName()); - QFileInfo f(dir.absolutePath()); - f.dir().absolutePath(); - cache=f.dir().absolutePath()+QDir::separator()+"mapscache"+QDir::separator(); + cache= Utils::PathUtils().GetStoragePath()+"mapscache"+QDir::separator(); setCacheLocation(cache); } } diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/core.pro b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/core.pro index 9c355e3ca..51387f9f8 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/core.pro +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/core.pro @@ -1,5 +1,8 @@ include (../common.pri) +include(../../../utils/utils.pri) + + SOURCES += opmaps.cpp \ pureimagecache.cpp \ pureimage.cpp \ diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetconfiguration.cpp b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetconfiguration.cpp index 48f824a3d..25069571f 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetconfiguration.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetconfiguration.cpp @@ -42,11 +42,6 @@ OPMapGadgetConfiguration::OPMapGadgetConfiguration(QString classId, QSettings* m_cacheLocation(Utils::PathUtils().GetStoragePath() + "mapscache" + QDir::separator()), m_uavSymbol(QString::fromUtf8(":/uavs/images/mapquad.png")) { - QSettings set(QSettings::IniFormat, QSettings::UserScope,QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS")); - QDir dir(set.fileName()); - QFileInfo f(dir.absolutePath()); - f.dir().absolutePath(); - m_cacheLocation=f.dir().absolutePath()+QDir::separator() + "mapscache" + QDir::separator(); //if a saved configuration exists load it if(qSettings != 0) { diff --git a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetoptionspage.cpp b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetoptionspage.cpp index 816b9fd26..b6f07b9bd 100644 --- a/ground/openpilotgcs/src/plugins/opmap/opmapgadgetoptionspage.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/opmapgadgetoptionspage.cpp @@ -109,11 +109,7 @@ void OPMapGadgetOptionsPage::on_pushButtonCacheDefaults_clicked() m_page->accessModeComboBox->setCurrentIndex(index); m_page->checkBoxUseMemoryCache->setChecked(true); - QSettings set(QSettings::IniFormat, QSettings::UserScope,QLatin1String("OpenPilot"), QLatin1String("OpenPilotGCS")); - QDir dir(set.fileName()); - QFileInfo f(dir.absolutePath()); - f.dir().absolutePath(); - m_page->lineEditCacheLocation->setPath(f.dir().absolutePath()+QDir::separator() + "mapscache" + QDir::separator()); + m_page->lineEditCacheLocation->setPath(Utils::PathUtils().GetStoragePath() + "mapscache" + QDir::separator()); }