mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Deprecated qSort => std::sort
This change gets rid of some GCC's -Wdeprecated-declarations warnings.
This commit is contained in:
parent
70287994dd
commit
3c9ed6ef8f
@ -948,7 +948,7 @@ void MainWindowViewer::openFolderFromPath(QString pathDir, QString atFileName)
|
|||||||
d.setSorting(QDir::Name | QDir::IgnoreCase | QDir::LocaleAware);
|
d.setSorting(QDir::Name | QDir::IgnoreCase | QDir::LocaleAware);
|
||||||
QStringList list = d.entryList();
|
QStringList list = d.entryList();
|
||||||
|
|
||||||
qSort(list.begin(), list.end(), naturalSortLessThanCI);
|
std::sort(list.begin(), list.end(), naturalSortLessThanCI);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (QString path, list) {
|
foreach (QString path, list) {
|
||||||
if (path.endsWith(atFileName))
|
if (path.endsWith(atFileName))
|
||||||
@ -1560,8 +1560,7 @@ void MainWindowViewer::getSiblingComics(QString path, QString currentComic)
|
|||||||
#endif
|
#endif
|
||||||
d.setSorting(QDir::Name | QDir::IgnoreCase | QDir::LocaleAware);
|
d.setSorting(QDir::Name | QDir::IgnoreCase | QDir::LocaleAware);
|
||||||
QStringList list = d.entryList();
|
QStringList list = d.entryList();
|
||||||
qSort(list.begin(), list.end(), naturalSortLessThanCI);
|
std::sort(list.begin(), list.end(), naturalSortLessThanCI);
|
||||||
//std::sort(list.begin(),list.end(),naturalSortLessThanCI);
|
|
||||||
int index = list.indexOf(currentComic);
|
int index = list.indexOf(currentComic);
|
||||||
if (index == -1) //comic not found
|
if (index == -1) //comic not found
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
#include <QFileIconProvider>
|
#include <QFileIconProvider>
|
||||||
QIcon finishedFolderIcon;
|
QIcon finishedFolderIcon;
|
||||||
@ -413,8 +415,7 @@ QStringList FolderModel::getSubfoldersNames(const QModelIndex &mi)
|
|||||||
}
|
}
|
||||||
QSqlDatabase::removeDatabase(connectionName);
|
QSqlDatabase::removeDatabase(connectionName);
|
||||||
|
|
||||||
//TODO sort result))
|
std::sort(result.begin(), result.end(), naturalSortLessThanCI);
|
||||||
qSort(result.begin(), result.end(), naturalSortLessThanCI);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include <QSqlRecord>
|
#include <QSqlRecord>
|
||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
#include "reading_list.h"
|
#include "reading_list.h"
|
||||||
@ -166,7 +167,7 @@ QString DBHelper::getFolderName(qulonglong libraryId, qulonglong id)
|
|||||||
QList<QString> DBHelper::getLibrariesNames()
|
QList<QString> DBHelper::getLibrariesNames()
|
||||||
{
|
{
|
||||||
QStringList names = getLibraries().getNames();
|
QStringList names = getLibraries().getNames();
|
||||||
qSort(names.begin(), names.end(), naturalSortLessThanCI);
|
std::sort(names.begin(), names.end(), naturalSortLessThanCI);
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
QString DBHelper::getLibraryName(int id)
|
QString DBHelper::getLibraryName(int id)
|
||||||
|
@ -333,8 +333,8 @@ void LibraryCreator::update(QDir dirS)
|
|||||||
dirS.setSorting(QDir::Name | QDir::IgnoreCase | QDir::LocaleAware);
|
dirS.setSorting(QDir::Name | QDir::IgnoreCase | QDir::LocaleAware);
|
||||||
QFileInfoList listSFiles = dirS.entryInfoList();
|
QFileInfoList listSFiles = dirS.entryInfoList();
|
||||||
|
|
||||||
qSort(listSFolders.begin(), listSFolders.end(), naturalSortLessThanCIFileInfo);
|
std::sort(listSFolders.begin(), listSFolders.end(), naturalSortLessThanCIFileInfo);
|
||||||
qSort(listSFiles.begin(), listSFiles.end(), naturalSortLessThanCIFileInfo);
|
std::sort(listSFiles.begin(), listSFiles.end(), naturalSortLessThanCIFileInfo);
|
||||||
|
|
||||||
QFileInfoList listS;
|
QFileInfoList listS;
|
||||||
listS.append(listSFolders);
|
listS.append(listSFolders);
|
||||||
@ -351,8 +351,8 @@ void LibraryCreator::update(QDir dirS)
|
|||||||
//QLOG_TRACE() << "END Getting info from DB" << dirS.absolutePath();
|
//QLOG_TRACE() << "END Getting info from DB" << dirS.absolutePath();
|
||||||
|
|
||||||
QList<LibraryItem *> listD;
|
QList<LibraryItem *> listD;
|
||||||
qSort(folders.begin(), folders.end(), naturalSortLessThanCILibraryItem);
|
std::sort(folders.begin(), folders.end(), naturalSortLessThanCILibraryItem);
|
||||||
qSort(comics.begin(), comics.end(), naturalSortLessThanCILibraryItem);
|
std::sort(comics.begin(), comics.end(), naturalSortLessThanCILibraryItem);
|
||||||
listD.append(folders);
|
listD.append(folders);
|
||||||
listD.append(comics);
|
listD.append(comics);
|
||||||
//QLOG_DEBUG() << "---------------------------------------------------------";
|
//QLOG_DEBUG() << "---------------------------------------------------------";
|
||||||
@ -651,7 +651,7 @@ void ThumbnailCreator::create()
|
|||||||
if (_coverPage > _numPages) {
|
if (_coverPage > _numPages) {
|
||||||
_coverPage = 1;
|
_coverPage = 1;
|
||||||
}
|
}
|
||||||
qSort(fileNames.begin(), fileNames.end(), naturalSortLessThanCI);
|
std::sort(fileNames.begin(), fileNames.end(), naturalSortLessThanCI);
|
||||||
int index = order.indexOf(fileNames.at(_coverPage - 1));
|
int index = order.indexOf(fileNames.at(_coverPage - 1));
|
||||||
|
|
||||||
if (_target == "") {
|
if (_target == "") {
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
@ -2494,7 +2495,7 @@ QModelIndexList LibraryWindow::getSelectedComics()
|
|||||||
//avoid selection.count()==0 forcing selection in comicsView
|
//avoid selection.count()==0 forcing selection in comicsView
|
||||||
QModelIndexList selection = comicsViewsManager->comicsView->selectionModel()->selectedRows();
|
QModelIndexList selection = comicsViewsManager->comicsView->selectionModel()->selectedRows();
|
||||||
QLOG_TRACE() << "selection count " << selection.length();
|
QLOG_TRACE() << "selection count " << selection.length();
|
||||||
qSort(selection.begin(), selection.end(), lessThanModelIndexRow);
|
std::sort(selection.begin(), selection.end(), lessThanModelIndexRow);
|
||||||
|
|
||||||
if (selection.count() == 0) {
|
if (selection.count() == 0) {
|
||||||
comicsViewsManager->comicsView->selectIndex(0);
|
comicsViewsManager->comicsView->selectIndex(0);
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
#include "QsLog.h"
|
#include "QsLog.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
using stefanfrings::HttpRequest;
|
using stefanfrings::HttpRequest;
|
||||||
using stefanfrings::HttpResponse;
|
using stefanfrings::HttpResponse;
|
||||||
using stefanfrings::HttpSession;
|
using stefanfrings::HttpSession;
|
||||||
@ -79,7 +81,7 @@ void FolderController::service(HttpRequest &request, HttpResponse &response)
|
|||||||
|
|
||||||
folderContent.append(folderComics);
|
folderContent.append(folderComics);
|
||||||
|
|
||||||
qSort(folderContent.begin(), folderContent.end(), LibraryItemSorter());
|
std::sort(folderContent.begin(), folderContent.end(), LibraryItemSorter());
|
||||||
folderComics.clear();
|
folderComics.clear();
|
||||||
|
|
||||||
//qulonglong backId = DBHelper::getParentFromComicFolderId(libraryName,folderId);
|
//qulonglong backId = DBHelper::getParentFromComicFolderId(libraryName,folderId);
|
||||||
@ -265,7 +267,7 @@ void FolderController::service(HttpRequest &request, HttpResponse &response)
|
|||||||
if (index.length() > 1) {
|
if (index.length() > 1) {
|
||||||
t.setCondition("alphaIndex", true);
|
t.setCondition("alphaIndex", true);
|
||||||
|
|
||||||
qSort(index.begin(), index.end(), naturalSortLessThanCI);
|
std::sort(index.begin(), index.end(), naturalSortLessThanCI);
|
||||||
t.loop("index", index.length());
|
t.loop("index", index.length());
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user