1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-10 18:24:11 +01:00

Make Notification plugin sound path portable too.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1579 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-09-11 21:17:44 +00:00 committed by edouard
parent ce53757baa
commit 929f7dd5d8

View File

@ -28,6 +28,7 @@
#include "notifypluginconfiguration.h" #include "notifypluginconfiguration.h"
#include <QtCore/QDataStream> #include <QtCore/QDataStream>
#include <QFile> #include <QFile>
#include "utils/pathutils.h"
NotifyPluginConfiguration::NotifyPluginConfiguration(QObject *parent) : NotifyPluginConfiguration::NotifyPluginConfiguration(QObject *parent) :
@ -55,7 +56,7 @@ NotifyPluginConfiguration::NotifyPluginConfiguration(QObject *parent) :
void NotifyPluginConfiguration::saveState(QSettings* settings) const void NotifyPluginConfiguration::saveState(QSettings* settings) const
{ {
settings->setValue("SoundCollectionPath", getSoundCollectionPath()); settings->setValue("SoundCollectionPath", Utils::PathUtils().RemoveDataPath(getSoundCollectionPath()));
settings->setValue(QLatin1String("CurrentLanguage"), getCurrentLanguage()); settings->setValue(QLatin1String("CurrentLanguage"), getCurrentLanguage());
settings->setValue(QLatin1String("ObjectField"), getObjectField()); settings->setValue(QLatin1String("ObjectField"), getObjectField());
settings->setValue(QLatin1String("DataObject"), getDataObject()); settings->setValue(QLatin1String("DataObject"), getDataObject());
@ -72,7 +73,7 @@ void NotifyPluginConfiguration::saveState(QSettings* settings) const
void NotifyPluginConfiguration::restoreState(QSettings* settings) void NotifyPluginConfiguration::restoreState(QSettings* settings)
{ {
//settings = Core::ICore::instance()->settings(); //settings = Core::ICore::instance()->settings();
setSoundCollectionPath(settings->value(QLatin1String("SoundCollectionPath"), tr("")).toString()); setSoundCollectionPath(Utils::PathUtils().InsertDataPath(settings->value(QLatin1String("SoundCollectionPath"), tr("")).toString()));
setCurrentLanguage(settings->value(QLatin1String("CurrentLanguage"), tr("")).toString()); setCurrentLanguage(settings->value(QLatin1String("CurrentLanguage"), tr("")).toString());
setDataObject(settings->value(QLatin1String("DataObject"), tr("")).toString()); setDataObject(settings->value(QLatin1String("DataObject"), tr("")).toString());
setObjectField(settings->value(QLatin1String("ObjectField"), tr("")).toString()); setObjectField(settings->value(QLatin1String("ObjectField"), tr("")).toString());