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