mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Fix all compilation issues after enabling QT_DISABLE_DEPRECATED_UP_TO
This commit is contained in:
@ -8,6 +8,8 @@
|
||||
#include <QFileInfo>
|
||||
#include <QList>
|
||||
|
||||
#include <utility>
|
||||
|
||||
Bookmarks::Bookmarks()
|
||||
: lastPageIndex(0)
|
||||
{
|
||||
@ -93,7 +95,7 @@ void Bookmarks::clear()
|
||||
bool Bookmarks::load(const QList<int> &bookmarkIndexes, int lastPage)
|
||||
{
|
||||
lastPageIndex = lastPage;
|
||||
foreach (int b, bookmarkIndexes)
|
||||
for (const int b : std::as_const(bookmarkIndexes))
|
||||
if (b != -1) {
|
||||
latestBookmarks.push_back(b);
|
||||
bookmarks.insert(b, QImage());
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include <QString>
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
enum YACReaderPageSortingMode {
|
||||
YACReaderNumericalSorting,
|
||||
@ -304,7 +305,7 @@ QList<QString> Comic::findValidComicFiles(const QList<QUrl> &list)
|
||||
QLOG_DEBUG() << "-findValidComicFiles-";
|
||||
QList<QString> validComicFiles;
|
||||
QString currentPath;
|
||||
foreach (QUrl url, list) {
|
||||
for (const QUrl &url : std::as_const(list)) {
|
||||
currentPath = url.toLocalFile();
|
||||
if (Comic::fileIsComic(currentPath)) {
|
||||
validComicFiles << currentPath;
|
||||
@ -330,7 +331,7 @@ QList<QString> Comic::findValidComicFilesInFolder(const QString &path)
|
||||
QFileInfoList folderContent = folder.entryInfoList();
|
||||
|
||||
QString currentPath;
|
||||
foreach (QFileInfo info, folderContent) {
|
||||
for (const QFileInfo &info : std::as_const(folderContent)) {
|
||||
currentPath = info.absoluteFilePath();
|
||||
if (info.isDir()) {
|
||||
validComicFiles << findValidComicFilesInFolder(currentPath); // find comics recursively
|
||||
@ -415,10 +416,10 @@ QList<QString> FileComic::filter(const QList<QString> &src)
|
||||
QList<QString> filtered;
|
||||
bool fileAccepted = false;
|
||||
|
||||
foreach (QString fileName, src) {
|
||||
for (const QString &fileName : std::as_const(src)) {
|
||||
fileAccepted = false;
|
||||
if (!fileName.contains("__MACOSX")) {
|
||||
foreach (QString extension, extensions) {
|
||||
for (const QString &extension : std::as_const(extensions)) {
|
||||
if (fileName.endsWith(extension, Qt::CaseInsensitive)) {
|
||||
fileAccepted = true;
|
||||
break;
|
||||
@ -473,7 +474,7 @@ bool FileComic::isCancelled()
|
||||
QList<QVector<quint32>> FileComic::getSections(int §ionIndex)
|
||||
{
|
||||
QVector<quint32> sortedIndexes;
|
||||
foreach (QString name, _fileNames) {
|
||||
for (const QString &name : std::as_const(_fileNames)) {
|
||||
sortedIndexes.append(_order.indexOf(name));
|
||||
}
|
||||
QList<QVector<quint32>> sections;
|
||||
@ -483,7 +484,7 @@ QList<QVector<quint32>> FileComic::getSections(int §ionIndex)
|
||||
QVector<quint32> section;
|
||||
int idx = 0;
|
||||
unsigned int realIdx;
|
||||
foreach (quint32 i, sortedIndexes) {
|
||||
for (const quint32 i : std::as_const(sortedIndexes)) {
|
||||
|
||||
if (_firstPage == idx) {
|
||||
sectionIndex = sectionCount;
|
||||
@ -499,7 +500,7 @@ QList<QVector<quint32>> FileComic::getSections(int §ionIndex)
|
||||
if (section.indexOf(realIdx) != 0) {
|
||||
QVector<quint32> section1;
|
||||
QVector<quint32> section2;
|
||||
foreach (quint32 si, section) {
|
||||
for (const quint32 si : std::as_const(section)) {
|
||||
if (si < realIdx) {
|
||||
section1.append(si);
|
||||
} else {
|
||||
@ -532,7 +533,7 @@ QList<QVector<quint32>> FileComic::getSections(int §ionIndex)
|
||||
if (section.indexOf(realIdx) != 0) {
|
||||
QVector<quint32> section1;
|
||||
QVector<quint32> section2;
|
||||
foreach (quint32 si, section) {
|
||||
for (const quint32 si : std::as_const(section)) {
|
||||
if (si < realIdx) {
|
||||
section1.append(si);
|
||||
} else {
|
||||
@ -626,7 +627,7 @@ void FileComic::process()
|
||||
}
|
||||
// archive.getAllData(QVector<quint32>(),this);
|
||||
/*
|
||||
foreach(QString name,_fileNames)
|
||||
for (const auto &name : _fileNames)
|
||||
{
|
||||
index = _order.indexOf(name);
|
||||
sortedIndex = _fileNames.indexOf(name);
|
||||
@ -1017,7 +1018,7 @@ void get_double_pages(const QList<QString> &pageNames, QList<QString> &singlePag
|
||||
|
||||
QString mostCommonPrefix = get_most_common_prefix(pageNames);
|
||||
|
||||
foreach (const QString &pageName, pageNames) {
|
||||
for (const QString &pageName : std::as_const(pageNames)) {
|
||||
if (is_double_page(pageName.split('/').last(), mostCommonPrefix, maxExpectedDoublePagesNumberLenght)) {
|
||||
doublePageNames.append(pageName);
|
||||
} else {
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
#include <QImage>
|
||||
|
||||
#include <utility>
|
||||
|
||||
// YACReaderComicFlow3D implementation
|
||||
YACReaderComicFlow3D::YACReaderComicFlow3D(QWidget *parent, struct Preset p)
|
||||
: YACReaderFlow3D(parent, p)
|
||||
@ -126,7 +128,7 @@ void YACReaderComicFlow3D::resortCovers(QList<int> newOrder)
|
||||
QVector<YACReader3DImageRHI> imagesNew;
|
||||
|
||||
int index = 0;
|
||||
foreach (int i, newOrder) {
|
||||
for (const int i : std::as_const(newOrder)) {
|
||||
if (i < 0 || i >= images.size()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user