mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
fixed stylesheet path hardocding
This commit is contained in:
parent
2ff29e352e
commit
7a1f330096
@ -63,6 +63,7 @@
|
|||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include "dialogs/iwizard.h"
|
#include "dialogs/iwizard.h"
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
|
#include <utils/pathutils.h>
|
||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
#include <utils/xmlconfig.h>
|
#include <utils/xmlconfig.h>
|
||||||
#include "version_info/version_info.h"
|
#include "version_info/version_info.h"
|
||||||
@ -285,21 +286,9 @@ void MainWindow::extensionsInitialized()
|
|||||||
|
|
||||||
QString MainWindow::loadStyleSheet(QString fileName)
|
QString MainWindow::loadStyleSheet(QString fileName)
|
||||||
{
|
{
|
||||||
// Let's use QFile and point to a resource...
|
|
||||||
QDir dir(QCoreApplication::applicationDirPath());
|
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
dir.cdUp();
|
|
||||||
dir.cd("Resources");
|
|
||||||
#else
|
|
||||||
dir.cdUp();
|
|
||||||
dir.cd("share");
|
|
||||||
dir.cd("openpilotgcs");
|
|
||||||
#endif
|
|
||||||
dir.cd("stylesheets");
|
|
||||||
QString style;
|
QString style;
|
||||||
// ...to open the file
|
// ...to open the file
|
||||||
QFile file(dir.absolutePath() + QDir::separator() + fileName);
|
QFile file(Utils::GetDataPath() + QString("stylesheets/") + fileName);
|
||||||
qDebug() << "Loading style sheet file" << file.fileName();
|
qDebug() << "Loading style sheet file" << file.fileName();
|
||||||
if (file.open(QFile::ReadOnly)) {
|
if (file.open(QFile::ReadOnly)) {
|
||||||
// QTextStream...
|
// QTextStream...
|
||||||
|
Loading…
Reference in New Issue
Block a user