List index out of range fix when reading empty documents

This commit is contained in:
Nicolas Mailloux 2021-04-05 10:07:21 -04:00
parent f46e9f3f28
commit 511594eeba
4 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11 CONFIG += c++11
QMAKE_CXXFLAGS += -Wno-unused-function QMAKE_CXXFLAGS += -Wno-unused-function -Wno-unused-parameter
# You can make your code fail to compile if it uses deprecated APIs. # You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line. # In order to do so, uncomment the following line.

View file

@ -26,7 +26,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
checkconfig("test");
// Checking if there has been an ALERT flag set up, and if there is, show a big warning // 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) { if(checkconfig("/external_root/boot/flags/ALERT") == true) {
QApplication a(argc, argv); QApplication a(argc, argv);

View file

@ -399,7 +399,7 @@ reader::~reader()
void reader::on_nextBtn_clicked() void reader::on_nextBtn_clicked()
{ {
if(split_total - 1 == 1) { if(split_total - 1 == 1 or split_total - 1 == 0) {
QMessageBox::critical(this, tr("Invalid argument"), tr("You've reached the end of the document.")); QMessageBox::critical(this, tr("Invalid argument"), tr("You've reached the end of the document."));
} }
else { else {

View file

@ -140,6 +140,7 @@ public:
ittext = content[i]; ittext = content[i];
QDir::setCurrent("/mnt/onboard/.adds/inkbox"); QDir::setCurrent("/mnt/onboard/.adds/inkbox");
} }
return 0;
} }
void checkwords() { void checkwords() {
QFile words_list(".config/06-words/config"); QFile words_list(".config/06-words/config");