Relative paths now relative to app.exe instead of current dir.
This commit is contained in:
parent
b0c745b61e
commit
692ccc133b
@ -2,6 +2,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
#include "RecognizerHelper.h"
|
#include "RecognizerHelper.h"
|
||||||
|
|
||||||
@ -10,6 +11,8 @@ RecognizerHelper::RecognizerHelper ()
|
|||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
QDir settingDir = QFileInfo (QSettings ().fileName ()).dir ();
|
QDir settingDir = QFileInfo (QSettings ().fileName ()).dir ();
|
||||||
fileName_ = settingDir.absoluteFilePath (fileName_);
|
fileName_ = settingDir.absoluteFilePath (fileName_);
|
||||||
|
#else
|
||||||
|
fileName_ = QApplication::applicationDirPath () + QDir::separator () + fileName_;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
#include "TranslatorHelper.h"
|
#include "TranslatorHelper.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
TranslatorHelper::TranslatorHelper ()
|
TranslatorHelper::TranslatorHelper ()
|
||||||
: translatorsDir_ ("translators"), currentIndex_ (0) {
|
: translatorsDir_ ("translators"), currentIndex_ (0) {
|
||||||
|
translatorsDir_ = QApplication::applicationDirPath () + QDir::separator () + translatorsDir_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TranslatorHelper::setEnabledTranslators (const QStringList &enabled) const {
|
void TranslatorHelper::setEnabledTranslators (const QStringList &enabled) const {
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
#include "Updater.h"
|
#include "Updater.h"
|
||||||
#include "StAssert.h"
|
#include "StAssert.h"
|
||||||
@ -44,7 +45,7 @@ Updater::Updater (QObject *parent)
|
|||||||
: QObject (parent),
|
: QObject (parent),
|
||||||
network_ (new QNetworkAccessManager (this)),
|
network_ (new QNetworkAccessManager (this)),
|
||||||
componentsUpdating_ (0) {
|
componentsUpdating_ (0) {
|
||||||
updatesFileName_ = "updates.json";
|
updatesFileName_ = QApplication::applicationDirPath () + QDir::separator () + "updates.json";
|
||||||
backupSuffix_ = "_backup";
|
backupSuffix_ = "_backup";
|
||||||
connect (network_, SIGNAL (finished (QNetworkReply *)),
|
connect (network_, SIGNAL (finished (QNetworkReply *)),
|
||||||
SLOT (replyFinished (QNetworkReply *)));
|
SLOT (replyFinished (QNetworkReply *)));
|
||||||
|
Loading…
Reference in New Issue
Block a user