Merge branch 'develop' of https://github.com/YACReader/yacreader into develop

This commit is contained in:
Luis Ángel San Martín 2024-02-13 18:41:33 +01:00
commit 9436520399
2 changed files with 15 additions and 2 deletions

View File

@ -35,6 +35,10 @@
#include <QDate>
#include <QMenuBar>
#ifdef use_unarr
#include "unarr.h"
#endif
MainWindowViewer::MainWindowViewer()
: QMainWindow(), fullscreen(false), toolbars(true), currentDirectory("."), currentDirectoryImgDest("."), isClient(false)
{
@ -781,8 +785,10 @@ void MainWindowViewer::open()
QFileDialog openDialog;
#ifndef use_unarr
QString pathFile = openDialog.getOpenFileName(this, tr("Open Comic"), currentDirectory, tr("Comic files") + "(*.cbr *.cbz *.rar *.zip *.tar *.pdf *.7z *.cb7 *.arj *.cbt)");
#else
#elif (UNARR_API_VERSION < 110)
QString pathFile = openDialog.getOpenFileName(this, tr("Open Comic"), currentDirectory, tr("Comic files") + "(*.cbr *.cbz *.rar *.zip *.tar *.pdf *.cbt)");
#else
QString pathFile = openDialog.getOpenFileName(this, tr("Open Comic"), currentDirectory, tr("Comic files") + "(*.cbr *.cbz *.rar *.zip *.tar *.pdf *.cbt *.7z *.cb7)");
#endif
if (!pathFile.isEmpty()) {
openComicFromPath(pathFile);
@ -1435,6 +1441,10 @@ void MainWindowViewer::getSiblingComics(QString path, QString currentComic)
<< "*.zip"
<< "*.tar"
<< "*.pdf"
#if (UNARR_API_VERSION >= 110)
<< "*.7z"
<< "*.cb7"
#endif
<< "*.cbt");
#endif
d.setSorting(QDir::Name | QDir::IgnoreCase | QDir::LocaleAware);

View File

@ -11,6 +11,9 @@
#include "comic_db.h"
#include "db_helper.h"
#include "reading_list_model.h"
#ifdef use_unarr
#include <unarr.h>
#endif
// ci.number,ci.title,c.fileName,ci.numPages,c.id,c.parentId,c.path,ci.hash,ci.read
#include "QsLog.h"
@ -444,7 +447,7 @@ QVariant ComicModel::headerData(int section, Qt::Orientation orientation,
return QVariant(QIcon(":/images/zip.png"));
else if (ext.compare("rar", Qt::CaseInsensitive) == 0)
return QVariant(QIcon(":/images/rar.png"));
#ifndef use_unarr
#if !defined(use_unarr) || (UNARR_API_VERSION >= 110)
else if (ext.compare("7z", Qt::CaseInsensitive) == 0)
return QVariant(QIcon(":/images/7z.png"));
else if (ext.compare("cb7", Qt::CaseInsensitive) == 0)