From fa20895ad83c3224ecfecf773ecd3d4713eb626f Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Tue, 19 Jul 2022 12:03:58 -0400 Subject: [PATCH] Local library: Fix special characters issue --- main.cpp | 10 ++++------ qtooltiplabel.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/main.cpp b/main.cpp index 9402c7c..2e75f53 100644 --- a/main.cpp +++ b/main.cpp @@ -27,9 +27,13 @@ #include #include #include +#include int main(int argc, char *argv[]) { + QApplication a(argc, argv); + QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8")); + if(char * debug = std::getenv("DEBUG")) { if(std::atoi(debug) == 1) { global::logger::status = true; @@ -77,7 +81,6 @@ int main(int argc, char *argv[]) if(checkconfig(".config/18-encrypted_storage/status") == true and checkconfig("/external_root/run/encfs_mounted") == false) { // Open Encryption Manager to unlock encrypted storage - QApplication a(argc, argv); encryptionManager w; const QScreen * screen = qApp->primaryScreen(); w.setGeometry(QRect(QPoint(0,0), screen->geometry().size())); @@ -86,7 +89,6 @@ int main(int argc, char *argv[]) } else if(checkconfig("/external_root/run/encfs_mounted") == true and checkconfig("/external_root/run/encfs_repack") == true) { log("Launching encryptionManager", "main"); - QApplication a(argc, argv); encryptionManager w; const QScreen * screen = qApp->primaryScreen(); w.setGeometry(QRect(QPoint(0,0), screen->geometry().size())); @@ -103,7 +105,6 @@ int main(int argc, char *argv[]) if(isBatteryCritical() == true) { if(!isUsbPluggedIn()) { global::battery::showCriticalBatteryAlert = true; - QApplication a(argc, argv); alert w; const QScreen* screen = qApp->primaryScreen(); @@ -116,7 +117,6 @@ int main(int argc, char *argv[]) // Checking if there has been an ALERT flag set up, and if there is, show a big warning if(checkconfig("/external_root/boot/flags/ALERT") == true) { - QApplication a(argc, argv); alert w; const QScreen * screen = qApp->primaryScreen(); @@ -161,7 +161,6 @@ int main(int argc, char *argv[]) ; } - QApplication a(argc, argv); reader w; const QScreen* screen = qApp->primaryScreen(); @@ -173,7 +172,6 @@ int main(int argc, char *argv[]) else { QProcess::execute("remount_tmpfs_launch.sh", QStringList()); - QApplication a(argc, argv); MainWindow w; QApplication::setStyle("windows"); diff --git a/qtooltiplabel.h b/qtooltiplabel.h index 1c016a9..7e72ade 100644 --- a/qtooltiplabel.h +++ b/qtooltiplabel.h @@ -17,4 +17,4 @@ protected: }; -#endif // CLICKABLELABEL_H +#endif // QTOOLTIPLABEL_H