Remove Q_WS_X11 from main.cpp and change it to Q_OS_LINUX in reports.cpp

This commit is contained in:
Phil Olynyk 2019-06-21 11:02:35 -04:00
parent 41efbcab38
commit e210813156
2 changed files with 2 additions and 11 deletions

View File

@ -42,11 +42,6 @@
#include "SleepLib/loader_plugins/icon_loader.h" #include "SleepLib/loader_plugins/icon_loader.h"
#include "SleepLib/loader_plugins/weinmann_loader.h" #include "SleepLib/loader_plugins/weinmann_loader.h"
#ifdef Q_WS_X11
#include <X11/Xlib.h>
#endif
MainWindow *mainwin = nullptr; MainWindow *mainwin = nullptr;
int compareVersion(QString version); int compareVersion(QString version);
@ -257,9 +252,6 @@ int main(int argc, char* argv[])
#else #else
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
#ifdef Q_WS_X11
XInitThreads();
#endif
QString homeDocs = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)+"/"; QString homeDocs = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)+"/";
QCoreApplication::setApplicationName(getAppName()); QCoreApplication::setApplicationName(getAppName());

View File

@ -39,8 +39,6 @@ void Report::PrintReport(gGraphView *gv, QString name, QDate date)
return; return;
} }
//QString username = p_profile->Get(QString("_{") + QString(STR_UI_UserName) + "}_");
bool print_bookmarks = false; bool print_bookmarks = false;
if (name == STR_TR_Daily) { if (name == STR_TR_Daily) {
@ -69,7 +67,8 @@ void Report::PrintReport(gGraphView *gv, QString name, QDate date)
printer = new QPrinter(QPrinter::HighResolution); printer = new QPrinter(QPrinter::HighResolution);
#ifdef Q_WS_X11 #ifdef Q_OS_LINUX
QString username = p_profile->Get(QString("_{") + QString(STR_UI_UserName) + "}_");
printer->setPrinterName("Print to File (PDF)"); printer->setPrinterName("Print to File (PDF)");
printer->setOutputFormat(QPrinter::PdfFormat); printer->setOutputFormat(QPrinter::PdfFormat);
QString filename = p_pref->Get("{home}/") + name + username + date.toString(Qt::ISODate) + ".pdf"; QString filename = p_pref->Get("{home}/") + name + username + date.toString(Qt::ISODate) + ".pdf";