diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index b86056bf3..5f351935f 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -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 { diff --git a/YACReaderLibrary/db/comic_model.cpp b/YACReaderLibrary/db/comic_model.cpp index 247e2e788..da6c8a46a 100644 --- a/YACReaderLibrary/db/comic_model.cpp +++ b/YACReaderLibrary/db/comic_model.cpp @@ -317,7 +317,7 @@ QVariant ComicModel::data(const QModelIndex &index, int role) const Qt::ItemFlags ComicModel::flags(const QModelIndex &index) const { if (!index.isValid()) - return 0; + return {}; if (index.column() == ComicModel::Rating) return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable; return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled; diff --git a/YACReaderLibrary/db/folder_model.cpp b/YACReaderLibrary/db/folder_model.cpp index 576ebbedb..35271125a 100644 --- a/YACReaderLibrary/db/folder_model.cpp +++ b/YACReaderLibrary/db/folder_model.cpp @@ -11,6 +11,8 @@ #include +#include + #ifdef Q_OS_MAC #include QIcon finishedFolderIcon; @@ -142,7 +144,7 @@ QVariant FolderModel::data(const QModelIndex &index, int role) const Qt::ItemFlags FolderModel::flags(const QModelIndex &index) const { if (!index.isValid()) - return 0; + return {}; return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled; } @@ -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; } @@ -624,5 +625,5 @@ void FolderModelProxy::clear() filteredItems.clear(); - QSortFilterProxyModel::clear(); + QSortFilterProxyModel::invalidate(); } diff --git a/YACReaderLibrary/db/reading_list_model.cpp b/YACReaderLibrary/db/reading_list_model.cpp index b1991d4de..5f3012572 100644 --- a/YACReaderLibrary/db/reading_list_model.cpp +++ b/YACReaderLibrary/db/reading_list_model.cpp @@ -101,11 +101,11 @@ QVariant ReadingListModel::data(const QModelIndex &index, int role) const Qt::ItemFlags ReadingListModel::flags(const QModelIndex &index) const { if (!index.isValid()) - return 0; + return {}; auto item = static_cast(index.internalPointer()); if (typeid(*item) == typeid(ReadingListSeparatorItem)) - return 0; + return {}; if (typeid(*item) == typeid(ReadingListItem) && static_cast(item)->parent->getId() != 0) return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled | Qt::ItemIsDragEnabled; //only sublists are dragable diff --git a/YACReaderLibrary/db_helper.cpp b/YACReaderLibrary/db_helper.cpp index dae8a979f..3a0107560 100644 --- a/YACReaderLibrary/db_helper.cpp +++ b/YACReaderLibrary/db_helper.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include "reading_list.h" @@ -165,8 +166,8 @@ QString DBHelper::getFolderName(qulonglong libraryId, qulonglong id) } QList DBHelper::getLibrariesNames() { - QStringList names = getLibraries().getNames(); - qSort(names.begin(), names.end(), naturalSortLessThanCI); + auto names = getLibraries().getNames(); + std::sort(names.begin(), names.end(), naturalSortLessThanCI); return names; } QString DBHelper::getLibraryName(int id) diff --git a/YACReaderLibrary/images.qrc b/YACReaderLibrary/images.qrc index 3b117b640..56759398f 100644 --- a/YACReaderLibrary/images.qrc +++ b/YACReaderLibrary/images.qrc @@ -7,7 +7,6 @@ ../images/comic_vine/previousPage.png ../images/comic_vine/radioChecked.png ../images/comic_vine/radioUnchecked.png - ../images/comic_vine/radioUnchecked.png ../images/comic_vine/rowDown.png ../images/comic_vine/rowUp.png ../images/comic_vine/upArrow.png diff --git a/YACReaderLibrary/library_creator.cpp b/YACReaderLibrary/library_creator.cpp index 7318bce81..fc4265134 100644 --- a/YACReaderLibrary/library_creator.cpp +++ b/YACReaderLibrary/library_creator.cpp @@ -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 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 == "") { diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index a605bc5bd..65f5a76b9 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -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); diff --git a/YACReaderLibrary/server/controllers/v1/foldercontroller.cpp b/YACReaderLibrary/server/controllers/v1/foldercontroller.cpp index 8da40c951..e31485430 100644 --- a/YACReaderLibrary/server/controllers/v1/foldercontroller.cpp +++ b/YACReaderLibrary/server/controllers/v1/foldercontroller.cpp @@ -16,6 +16,8 @@ #include "QsLog.h" +#include + 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; diff --git a/common/gl/yacreader_flow_gl.cpp b/common/gl/yacreader_flow_gl.cpp index ad59daf73..867a13636 100644 --- a/common/gl/yacreader_flow_gl.cpp +++ b/common/gl/yacreader_flow_gl.cpp @@ -191,7 +191,7 @@ struct Preset pressetYACReaderFlowDownConfig = { }; /*Constructor*/ YACReaderFlowGL::YACReaderFlowGL(QWidget *parent, struct Preset p) - : QOpenGLWidget(/*QOpenGLWidget migration QGLFormat(QGL::SampleBuffers),*/ parent), numObjects(0), lazyPopulateObjects(-1), defaultTexture(nullptr), hasBeenInitialized(false), bUseVSync(false), flowRightToLeft(false) + : QOpenGLWidget(/*QOpenGLWidget migration QGLFormat(QGL::SampleBuffers),*/ parent), numObjects(0), lazyPopulateObjects(-1), hasBeenInitialized(false), bUseVSync(false), flowRightToLeft(false) { updateCount = 0; config = p; diff --git a/common/gl/yacreader_flow_gl.h b/common/gl/yacreader_flow_gl.h index 6fc965a78..c47345d86 100644 --- a/common/gl/yacreader_flow_gl.h +++ b/common/gl/yacreader_flow_gl.h @@ -119,9 +119,9 @@ class YACReaderFlowGL : public QOpenGLWidget, public ScrollManagement int updateCount; int fontSize; - QOpenGLTexture *defaultTexture; - QOpenGLTexture *markTexture; - QOpenGLTexture *readingTexture; + QOpenGLTexture *defaultTexture = nullptr; + QOpenGLTexture *markTexture = nullptr; + QOpenGLTexture *readingTexture = nullptr; void initializeGL(); void paintGL(); void timerEvent(QTimerEvent *); diff --git a/shortcuts_management/actions_shortcuts_model.cpp b/shortcuts_management/actions_shortcuts_model.cpp index eee5961e6..914472319 100644 --- a/shortcuts_management/actions_shortcuts_model.cpp +++ b/shortcuts_management/actions_shortcuts_model.cpp @@ -33,7 +33,7 @@ QModelIndex ActionsShortcutsModel::index(int row, int column, const QModelIndex Qt::ItemFlags ActionsShortcutsModel::flags(const QModelIndex &index) const { if (!index.isValid()) - return 0; + return {}; if (index.column() == KEYS) return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable; return Qt::ItemIsEnabled | Qt::ItemIsSelectable;