Replace qSort/qStableSort/qSwap
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtConcurrentRun>
|
||||
@@ -63,6 +64,9 @@
|
||||
#include "organiseerrordialog.h"
|
||||
#include "ui_organisedialog.h"
|
||||
|
||||
using std::shared_ptr;
|
||||
using std::stable_sort;
|
||||
|
||||
const char *OrganiseDialog::kDefaultFormat = "%artist/%album{ (Disc %disc)}/{%track - }%title.%extension";
|
||||
const char *OrganiseDialog::kSettingsGroup = "OrganiseDialog";
|
||||
|
||||
@@ -111,7 +115,7 @@ OrganiseDialog::OrganiseDialog(TaskManager *task_manager, QWidget *parent)
|
||||
|
||||
// Get the titles of the tags to put in the insert menu
|
||||
QStringList tag_titles = tags.keys();
|
||||
qStableSort(tag_titles);
|
||||
std::stable_sort(tag_titles.begin(), tag_titles.end());
|
||||
|
||||
// Build the insert menu
|
||||
QMenu *tag_menu = new QMenu(this);
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDialog>
|
||||
#include <QtAlgorithms>
|
||||
@@ -33,6 +35,8 @@
|
||||
#include "organiseerrordialog.h"
|
||||
#include "ui_organiseerrordialog.h"
|
||||
|
||||
using std::stable_sort;
|
||||
|
||||
OrganiseErrorDialog::OrganiseErrorDialog(QWidget *parent) : QDialog(parent), ui_(new Ui_OrganiseErrorDialog) {
|
||||
|
||||
ui_->setupUi(this);
|
||||
@@ -61,7 +65,7 @@ void OrganiseErrorDialog::Show(OperationType type, const SongList &songs_with_er
|
||||
void OrganiseErrorDialog::Show(OperationType type, const QStringList &files_with_errors) {
|
||||
|
||||
QStringList sorted_files = files_with_errors;
|
||||
qStableSort(sorted_files);
|
||||
std::stable_sort(sorted_files.begin(), sorted_files.end());
|
||||
|
||||
switch (type) {
|
||||
case Type_Copy:
|
||||
|
||||
Reference in New Issue
Block a user