Support more file types

This commit is contained in:
Nicolas Mailloux 2022-01-12 14:48:22 -05:00
parent 69cc8c1b5f
commit 7af178f9e5
2 changed files with 3 additions and 3 deletions

View file

@ -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());
}

View file

@ -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;
}