diff --git a/generaldialog.cpp b/generaldialog.cpp index bde6d6c..c49fdab 100644 --- a/generaldialog.cpp +++ b/generaldialog.cpp @@ -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(); diff --git a/koboxappsdialog.cpp b/koboxappsdialog.cpp index 32db66c..ffc6646 100644 --- a/koboxappsdialog.cpp +++ b/koboxappsdialog.cpp @@ -5,9 +5,10 @@ #include #include -#include #include #include +#include +#include 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"; diff --git a/main.cpp b/main.cpp index e777457..25c7a13 100644 --- a/main.cpp +++ b/main.cpp @@ -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; diff --git a/mainwindow.cpp b/mainwindow.cpp index a409a86..884251d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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 { diff --git a/settings.cpp b/settings.cpp index c02b152..0e06be3 100644 --- a/settings.cpp +++ b/settings.cpp @@ -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 {