Emergency commit

I sprinkled 'else if' statements everywhere before it was too late
This commit is contained in:
Nicolas Mailloux 2021-04-30 23:19:54 -04:00
parent deb210e823
commit 29349614f0
5 changed files with 16 additions and 16 deletions

View file

@ -53,7 +53,7 @@ generalDialog::generalDialog(QWidget *parent) :
string_writeconfig("/inkbox/resetDialog", "false");
}
}
if(checkconfig("/inkbox/updateDialog") == true) {
else if(checkconfig("/inkbox/updateDialog") == true) {
updateDialog = true;
ui->okBtn->setText("Update");
ui->cancelBtn->setText("Not now");
@ -62,7 +62,7 @@ generalDialog::generalDialog(QWidget *parent) :
this->adjustSize();
string_writeconfig("/inkbox/updateDialog", "false");
}
if(checkconfig("/inkbox/settingsRebootDialog") == true) {
else if(checkconfig("/inkbox/settingsRebootDialog") == true) {
settingsRebootDialog = true;
ui->stackedWidget->setCurrentIndex(1);
ui->bodyLabel->setText("The settings you chose might require a complete reboot of the device for them to work properly.");
@ -70,7 +70,7 @@ generalDialog::generalDialog(QWidget *parent) :
this->adjustSize();
string_writeconfig("/inkbox/settingsRebootDialog", "false");
}
if(global::mainwindow::lowBatteryDialog == true) {
else if(global::mainwindow::lowBatteryDialog == true) {
lowBatteryDialog = true;
ui->stackedWidget->setCurrentIndex(1);
get_battery_level();

View file

@ -5,9 +5,10 @@
#include <QStringListModel>
#include <QScreen>
#include <QDebug>
#include <QFontDatabase>
#include <QMessageBox>
#include <QDir>
#include <QDebug>
koboxAppsDialog::koboxAppsDialog(QWidget *parent) :
QDialog(parent),
@ -49,7 +50,7 @@ koboxAppsDialog::koboxAppsDialog(QWidget *parent) :
QStringList list = apps.split("\n", QString::SkipEmptyParts);
if(checkconfig("/external_root/opt/root/rooted") == true) {
list.append("KTerm");
list.prepend("KTerm");
}
model->setStringList(list);
@ -100,7 +101,7 @@ void koboxAppsDialog::on_launchBtn_clicked()
// Bypass standard shell script launch shenanigans
string_writeconfig("/external_root/tmp/X_program", "!netsurf");
}
if(itemText == "KTerm") {
else if(itemText == "KTerm") {
string_writeconfig("/external_root/tmp/X_program", "kterm -l /usr/local/share/kterm/layouts/keyboard-kt.xml -k 1");
dpModeSetting = "fullscreen";
dpiSetting = "175";

View file

@ -59,7 +59,7 @@ int main(int argc, char *argv[])
return a.exec();
}
// If we're waking from sleep and we have the lockscreen enabled, we'll "resume" the book from scratch
if(checkconfig("/tmp/suspendBook") == true) {
else if(checkconfig("/tmp/suspendBook") == true) {
// Start the low/critical battery alert timer from the Reader framework since MainWindow is not going to be shown
global::reader::startBatteryWatchdog = true;
global::reader::skipOpenDialog = true;

View file

@ -127,10 +127,10 @@ MainWindow::MainWindow(QWidget *parent)
if(batt_level_int >= 75 && batt_level_int <= 100) {
ui->batteryIcon->setPixmap(scaledFullPixmap);
}
if(batt_level_int >= 25 && batt_level_int <= 74) {
else if(batt_level_int >= 25 && batt_level_int <= 74) {
ui->batteryIcon->setPixmap(scaledHalfPixmap);
}
if(batt_level_int >= 0 && batt_level_int <= 24) {
else if(batt_level_int >= 0 && batt_level_int <= 24) {
ui->batteryIcon->setPixmap(scaledEmptyPixmap);
}
}
@ -158,10 +158,10 @@ MainWindow::MainWindow(QWidget *parent)
if(batt_level_int >= 75 && batt_level_int <= 100) {
ui->batteryIcon->setPixmap(scaledFullPixmap);
}
if(batt_level_int >= 25 && batt_level_int <= 74) {
else if(batt_level_int >= 25 && batt_level_int <= 74) {
ui->batteryIcon->setPixmap(scaledHalfPixmap);
}
if(batt_level_int >= 0 && batt_level_int <= 24) {
else if(batt_level_int >= 0 && batt_level_int <= 24) {
ui->batteryIcon->setPixmap(scaledEmptyPixmap);
}
}
@ -462,14 +462,13 @@ MainWindow::MainWindow(QWidget *parent)
if(ui->book2Btn->text() == ui->book1Btn->text()) {
ui->book2Btn->hide();
}
if(ui->book3Btn->text() == ui->book1Btn->text()) {
else if(ui->book3Btn->text() == ui->book1Btn->text()) {
ui->book3Btn->hide();
}
if(ui->book4Btn->text() == ui->book1Btn->text()) {
else if(ui->book4Btn->text() == ui->book1Btn->text()) {
ui->book4Btn->hide();
}
if(existing_recent_books == false) {
else if(existing_recent_books == false) {
ui->recentBooksLabel->show();
}
else {

View file

@ -618,7 +618,7 @@ void settings::on_enableUiScalingCheckBox_toggled(bool checked)
if(checkconfig_str_val == "n705\n") {
string_writeconfig(".config/09-dpi/config", "187");
}
if(checkconfig_str_val == "n905\n") {
else if(checkconfig_str_val == "n905\n") {
string_writeconfig(".config/09-dpi/config", "160");
}
else {