From 7af178f9e509d9c909b95d30be9aaca5254a7e1d Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Wed, 12 Jan 2022 14:48:22 -0500 Subject: [PATCH] Support more file types --- generaldialog.cpp | 2 +- reader.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generaldialog.cpp b/generaldialog.cpp index e96dc53..6e68c06 100644 --- a/generaldialog.cpp +++ b/generaldialog.cpp @@ -330,7 +330,7 @@ void generalDialog::on_okBtn_clicked() dirIt.next(); if(QFileInfo(dirIt.filePath()).isFile()) { QString suffix = QFileInfo(dirIt.filePath()).suffix(); - if(suffix == "txt" or suffix == "TXT" or suffix == "epub" or suffix == "pdf" or suffix == "PDF") { + if(suffix == "txt" or suffix == "TXT" or suffix == "epub" or suffix == "EPUB" or suffix == "pdf" or suffix == "PDF" or suffix == "png" or suffix == "PNG" or suffix == "tif" or suffix == "TIF" or suffix == "bmp" or suffix == "BMP" or suffix == "tiff" or suffix == "TIFF" or suffix == "jpg" or suffix == "JPG" or suffix == "jpeg" or suffix == "JPEG") { if(dirIt.fileName().contains(global::keyboard::keyboardText) == true) { storageSearchResults.append(dirIt.fileName()); } diff --git a/reader.cpp b/reader.cpp index f9c0466..d089900 100644 --- a/reader.cpp +++ b/reader.cpp @@ -2071,11 +2071,11 @@ bool reader::pdf_file_match(QString file) { } bool reader::image_file_match(QString file) { - if(file.right(3) == "png" or file.right(3) == "jpg" or file.right(3) == "bmp" or file.right(3) == "tif") { + if(file.right(3) == "png" or file.right(3) == "PNG" or file.right(3) == "jpg" or file.right(3) == "JPG" or file.right(3) == "bmp" or file.right(3) == "BMP" or file.right(3) == "tif" or file.right(3) == "TIF") { string_writeconfig("/inkbox/bookIsImage", "true"); return true; } - else if(file.right(4) == "jpeg" or file.right(4) == "tiff") { + else if(file.right(4) == "jpeg" or file.right(4) == "JPEG" or file.right(4) == "tiff" or file.right(4) == "TIFF") { string_writeconfig("/inkbox/bookIsImage", "true"); return true; }