Remove using std::placeholders

This commit is contained in:
Jonas Kvinge 2021-03-26 23:33:56 +01:00
parent 91ab8e22b7
commit c6604734c9
10 changed files with 15 additions and 45 deletions

View File

@ -70,9 +70,6 @@
#include "covermanager/albumcoverloaderresult.h"
#include "settings/collectionsettingspage.h"
using std::placeholders::_1;
using std::placeholders::_2;
const char *CollectionModel::kSavedGroupingsSettingsGroup = "SavedGroupings";
const int CollectionModel::kPrettyCoverSize = 32;
const char *CollectionModel::kPixmapDiskCacheDir = "pixmapcache";
@ -1773,7 +1770,7 @@ void CollectionModel::GetChildSongs(CollectionItem *item, QList<QUrl> *urls, Son
const_cast<CollectionModel*>(this)->LazyPopulate(item);
QList<CollectionItem*> children = item->children;
std::sort(children.begin(), children.end(), std::bind(&CollectionModel::CompareItems, this, _1, _2));
std::sort(children.begin(), children.end(), std::bind(&CollectionModel::CompareItems, this, std::placeholders::_1, std::placeholders::_2));
for (CollectionItem *child : children)
GetChildSongs(child, urls, songs, song_ids);

View File

@ -33,10 +33,6 @@
#include "groupbydialog.h"
#include "ui_groupbydialog.h"
// boost::multi_index still relies on these being in the global namespace.
using std::placeholders::_1;
using std::placeholders::_2;
#include <boost/multi_index/indexed_by.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>

View File

@ -54,9 +54,6 @@
#include "contextalbumsmodel.h"
using std::placeholders::_1;
using std::placeholders::_2;
const int ContextAlbumsModel::kPrettyCoverSize = 32;
ContextAlbumsModel::ContextAlbumsModel(CollectionBackend *backend, Application *app, QObject *parent) :
@ -464,7 +461,7 @@ void ContextAlbumsModel::GetChildSongs(CollectionItem *item, QList<QUrl> *urls,
const_cast<ContextAlbumsModel*>(this)->LazyPopulate(item);
QList<CollectionItem*> children = item->children;
std::sort(children.begin(), children.end(), std::bind(&ContextAlbumsModel::CompareItems, this, _1, _2));
std::sort(children.begin(), children.end(), std::bind(&ContextAlbumsModel::CompareItems, this, std::placeholders::_1, std::placeholders::_2));
for (CollectionItem *child : children)
GetChildSongs(child, urls, songs, song_ids);

View File

@ -34,10 +34,6 @@
#include "mergedproxymodel.h"
// boost::multi_index still relies on these being in the global namespace.
using std::placeholders::_1;
using std::placeholders::_2;
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
#include <boost/multi_index/detail/hash_index_iterator.hpp>
#include <boost/multi_index/hashed_index.hpp>

View File

@ -65,8 +65,6 @@
# include "device/cddasongloader.h"
#endif
using std::placeholders::_1;
QSet<QString> SongLoader::sRawUriSchemes;
const int SongLoader::kDefaultTimeout = 5000;
@ -431,7 +429,7 @@ SongLoader::Result SongLoader::LoadRemote() {
timeout_timer_->start(timeout_);
// Create the pipeline - it gets unreffed if it goes out of scope
std::shared_ptr<GstElement> pipeline(gst_pipeline_new(nullptr), std::bind(&gst_object_unref, _1));
std::shared_ptr<GstElement> pipeline(gst_pipeline_new(nullptr), std::bind(&gst_object_unref, std::placeholders::_1));
// Create the source element automatically based on the URL
GstElement *source = gst_element_make_from_uri(GST_URI_SRC, url_.toEncoded().constData(), nullptr, nullptr);

View File

@ -43,10 +43,6 @@
#include "devicelister.h"
#include "giolister.h"
using std::placeholders::_1;
using std::placeholders::_2;
using std::placeholders::_3;
QString GioLister::DeviceInfo::unique_id() const {
if (!volume_root_uri.isEmpty()) return volume_root_uri;
@ -86,7 +82,7 @@ void OperationFinished(F f, GObject *object, GAsyncResult *result) {
}
void GioLister::VolumeMountFinished(GObject *object, GAsyncResult *result, gpointer) {
OperationFinished<GVolume>(std::bind(g_volume_mount_finish, _1, _2, _3), object, result);
OperationFinished<GVolume>(std::bind(g_volume_mount_finish, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), object, result);
}
bool GioLister::Init() {
@ -537,15 +533,15 @@ QString GioLister::FindUniqueIdByVolume(GVolume *volume) const {
}
void GioLister::VolumeEjectFinished(GObject *object, GAsyncResult *result, gpointer) {
OperationFinished<GVolume>(std::bind(g_volume_eject_with_operation_finish, _1, _2, _3), object, result);
OperationFinished<GVolume>(std::bind(g_volume_eject_with_operation_finish, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), object, result);
}
void GioLister::MountEjectFinished(GObject *object, GAsyncResult *result, gpointer) {
OperationFinished<GMount>(std::bind(g_mount_eject_with_operation_finish, _1, _2, _3), object, result);
OperationFinished<GMount>(std::bind(g_mount_eject_with_operation_finish, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), object, result);
}
void GioLister::MountUnmountFinished(GObject *object, GAsyncResult *result, gpointer) {
OperationFinished<GMount>(std::bind(g_mount_unmount_with_operation_finish, _1, _2, _3), object, result);
OperationFinished<GMount>(std::bind(g_mount_unmount_with_operation_finish, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), object, result);
}
void GioLister::UpdateDeviceFreeSpace(const QString &id) {

View File

@ -87,9 +87,6 @@
#include "ui_internetsearchview.h"
#include "settings/appearancesettingspage.h"
using std::placeholders::_1;
using std::placeholders::_2;
const int InternetSearchView::kSwapModelsTimeoutMsec = 250;
const int InternetSearchView::kDelayedSearchTimeoutMs = 200;
const int InternetSearchView::kArtHeight = 32;

View File

@ -47,8 +47,6 @@
class OrganizeFormat;
using std::placeholders::_1;
const int Organize::kBatchSize = 10;
#ifdef HAVE_GSTREAMER
const int Organize::kTranscodeProgressInterval = 500;
@ -245,7 +243,7 @@ void Organize::ProcessSomeFiles() {
job.cover_dest_ = QFileInfo(job.destination_).path() + "/" + QFileInfo(job.cover_source_).fileName();
}
job.progress_ = std::bind(&Organize::SetSongProgress, this, _1, !task.transcoded_filename_.isEmpty());
job.progress_ = std::bind(&Organize::SetSongProgress, this, std::placeholders::_1, !task.transcoded_filename_.isEmpty());
if (!destination_->CopyToStorage(job)) {
files_with_errors_ << task.song_info_.song_.basefilename();

View File

@ -90,9 +90,6 @@
#include "internet/internetplaylistitem.h"
#include "internet/internetsongmimedata.h"
using std::placeholders::_1;
using std::placeholders::_2;
const char *Playlist::kCddaMimeType = "x-content/audio-cdda";
const char *Playlist::kRowsMimetype = "application/x-strawberry-playlist-rows";
const char *Playlist::kPlayNowMimetype = "application/x-strawberry-play-now";
@ -1336,17 +1333,17 @@ void Playlist::sort(int column, Qt::SortOrder order) {
if (column == Column_Album) {
// When sorting by album, also take into account discs and tracks.
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, Column_Track, order, _1, _2));
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, Column_Disc, order, _1, _2));
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, Column_Album, order, _1, _2));
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, Column_Track, order, std::placeholders::_1, std::placeholders::_2));
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, Column_Disc, order, std::placeholders::_1, std::placeholders::_2));
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, Column_Album, order, std::placeholders::_1, std::placeholders::_2));
}
else if (column == Column_Filename) {
// When sorting by full paths we also expect a hierarchical order. This returns a breath-first ordering of paths.
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, Column_Filename, order, _1, _2));
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::ComparePathDepths, order, _1, _2));
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, Column_Filename, order, std::placeholders::_1, std::placeholders::_2));
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::ComparePathDepths, order, std::placeholders::_1, std::placeholders::_2));
}
else {
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, column, order, _1, _2));
std::stable_sort(begin, new_items.end(), std::bind(&Playlist::CompareItems, column, order, std::placeholders::_1, std::placeholders::_2));
}
undo_stack_->push(new PlaylistUndoCommands::SortItems(this, column, order, new_items));
@ -1885,7 +1882,7 @@ void Playlist::ReshuffleIndices() {
}
// Sort the virtual items
std::stable_sort(begin, end, std::bind(AlbumShuffleComparator, album_key_positions, album_keys, _1, _2));
std::stable_sort(begin, end, std::bind(AlbumShuffleComparator, album_key_positions, album_keys, std::placeholders::_1, std::placeholders::_2));
break;
}

View File

@ -57,8 +57,6 @@
#include "playlistparsers/cueparser.h"
#include "smartplaylists/playlistgenerator.h"
using std::placeholders::_1;
const int PlaylistBackend::kSongTableJoins = 2;
PlaylistBackend::PlaylistBackend(Application *app, QObject *parent)