Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for https://github.com/Denvi/Candle/issues/121 #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/frmabout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ frmAbout::frmAbout(QWidget *parent) :
ui->setupUi(this);

ui->lblAbout->setText(ui->lblAbout->text().arg(qApp->applicationVersion()));

#ifdef UNIX
QFile file("/usr/share/doc/" + qApp->applicationDisplayName() + "/LICENSE");
#else
QFile file(qApp->applicationDirPath() + "/LICENSE");
#endif

if (file.open(QIODevice::ReadOnly)) {
ui->txtLicense->setPlainText(file.readAll());
Expand Down
6 changes: 6 additions & 0 deletions src/frmmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <QAction>
#include <QLayout>
#include <QMimeData>
#include <QStandardPaths>

#include "frmmain.h"
#include "ui_frmmain.h"

Expand All @@ -43,7 +45,11 @@ frmMain::frmMain(QWidget *parent) :
m_statusForeColors << "white" << "palette(text)" << "white" << "black" << "black" << "black" << "black" << "palette(text)" << "white";

// Loading settings
#ifdef UNIX
m_settingsFileName = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)+ "/candle/" + "/settings.ini";
#else
m_settingsFileName = qApp->applicationDirPath() + "/settings.ini";
#endif
preloadSettings();

m_settings = new frmSettings(this);
Expand Down
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ int main(int argc, char *argv[])
// QLocale::setDefault(QLocale("es"));

QString loc = QLocale().name().left(2);
#ifdef UNIX
QString translationsFolder = "/usr/share/" + qApp->applicationDisplayName() + "/translations/";
#else
QString translationsFolder = qApp->applicationDirPath() + "/translations/";
#endif
QString translationFileName = translationsFolder + qApp->applicationDisplayName() + "_" + loc + ".qm";

qDebug() << "locale:" << loc;
Expand Down