diff --git a/ext/libstrawberry-common/core/logging.cpp b/ext/libstrawberry-common/core/logging.cpp index 35a95fb26..9dafb3cde 100644 --- a/ext/libstrawberry-common/core/logging.cpp +++ b/ext/libstrawberry-common/core/logging.cpp @@ -115,7 +115,10 @@ class DebugBase : public QDebug { class BufferedDebug : public DebugBase { public: BufferedDebug() = default; - explicit BufferedDebug(QtMsgType) : buf_(new QBuffer, later_deleter) { + explicit BufferedDebug(QtMsgType msg_type) : buf_(new QBuffer, later_deleter) { + + Q_UNUSED(msg_type) + buf_->open(QIODevice::WriteOnly); // QDebug doesn't have a method to set a new io device, but swap() allows the devices to be swapped between two instances. @@ -137,7 +140,9 @@ class LoggedDebug : public DebugBase { explicit LoggedDebug(QtMsgType t) : DebugBase(t) { nospace() << kMessageHandlerMagic; } }; -static void MessageHandler(QtMsgType type, const QMessageLogContext&, const QString &message) { +static void MessageHandler(QtMsgType type, const QMessageLogContext &message_log_context, const QString &message) { + + Q_UNUSED(message_log_context) if (message.startsWith(QLatin1String(kMessageHandlerMagic))) { QByteArray message_data = message.toUtf8(); diff --git a/src/context/contextalbum.cpp b/src/context/contextalbum.cpp index 95ad8f542..a5d99c18d 100644 --- a/src/context/contextalbum.cpp +++ b/src/context/contextalbum.cpp @@ -100,7 +100,9 @@ QSize ContextAlbum::sizeHint() const { } -void ContextAlbum::paintEvent(QPaintEvent*) { +void ContextAlbum::paintEvent(QPaintEvent *paint_event) { + + Q_UNUSED(paint_event) QPainter p(this); p.setRenderHint(QPainter::SmoothPixmapTransform); diff --git a/src/context/contextalbum.h b/src/context/contextalbum.h index 89d4a9b31..7316ce414 100644 --- a/src/context/contextalbum.h +++ b/src/context/contextalbum.h @@ -56,7 +56,7 @@ class ContextAlbum : public QWidget { protected: QSize sizeHint() const override; - void paintEvent(QPaintEvent*) override; + void paintEvent(QPaintEvent *paint_event) override; void mouseDoubleClickEvent(QMouseEvent *e) override; void contextMenuEvent(QContextMenuEvent *e) override; diff --git a/src/core/mergedproxymodel.cpp b/src/core/mergedproxymodel.cpp index 414447b1d..3dc7bcf13 100644 --- a/src/core/mergedproxymodel.cpp +++ b/src/core/mergedproxymodel.cpp @@ -245,20 +245,32 @@ QModelIndex MergedProxyModel::GetActualSourceParent(const QModelIndex &source_pa } -void MergedProxyModel::RowsAboutToBeInserted(const QModelIndex &source_parent, int start, int end) { +void MergedProxyModel::RowsAboutToBeInserted(const QModelIndex &source_parent, const int start, const int end) { beginInsertRows(mapFromSource(GetActualSourceParent(source_parent, qobject_cast(sender()))), start, end); } -void MergedProxyModel::RowsInserted(const QModelIndex&, int, int) { +void MergedProxyModel::RowsInserted(const QModelIndex &source_parent, const int start, const int end) { + + Q_UNUSED(source_parent) + Q_UNUSED(start) + Q_UNUSED(end) + endInsertRows(); + } -void MergedProxyModel::RowsAboutToBeRemoved(const QModelIndex &source_parent, int start, int end) { +void MergedProxyModel::RowsAboutToBeRemoved(const QModelIndex &source_parent, const int start, const int end) { beginRemoveRows(mapFromSource(GetActualSourceParent(source_parent, qobject_cast(sender()))), start, end); } -void MergedProxyModel::RowsRemoved(const QModelIndex&, int, int) { +void MergedProxyModel::RowsRemoved(const QModelIndex &source_parent, const int start, const int end) { + + Q_UNUSED(source_parent) + Q_UNUSED(start) + Q_UNUSED(end) + endRemoveRows(); + } QModelIndex MergedProxyModel::mapToSource(const QModelIndex &proxy_index) const { @@ -294,7 +306,7 @@ QModelIndex MergedProxyModel::mapFromSource(const QModelIndex &source_index) con } -QModelIndex MergedProxyModel::index(int row, int column, const QModelIndex &parent) const { +QModelIndex MergedProxyModel::index(const int row, const int column, const QModelIndex &parent) const { QModelIndex source_index; @@ -380,7 +392,7 @@ bool MergedProxyModel::hasChildren(const QModelIndex &parent) const { } -QVariant MergedProxyModel::data(const QModelIndex &proxy_index, int role) const { +QVariant MergedProxyModel::data(const QModelIndex &proxy_index, const int role) const { QModelIndex source_index = mapToSource(proxy_index); if (!IsKnownModel(source_index.model())) return QVariant(); @@ -407,7 +419,7 @@ Qt::ItemFlags MergedProxyModel::flags(const QModelIndex &idx) const { } -bool MergedProxyModel::setData(const QModelIndex &idx, const QVariant &value, int role) { +bool MergedProxyModel::setData(const QModelIndex &idx, const QVariant &value, const int role) { QModelIndex source_index = mapToSource(idx); @@ -456,7 +468,7 @@ QMimeData *MergedProxyModel::mimeData(const QModelIndexList &indexes) const { } -bool MergedProxyModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) { +bool MergedProxyModel::dropMimeData(const QMimeData *data, Qt::DropAction action, const int row, const int column, const QModelIndex &parent) { if (!parent.isValid()) { return false; diff --git a/src/core/mergedproxymodel.h b/src/core/mergedproxymodel.h index 8f89a5aed..fdb6053c7 100644 --- a/src/core/mergedproxymodel.h +++ b/src/core/mergedproxymodel.h @@ -59,18 +59,18 @@ class MergedProxyModel : public QAbstractProxyModel { QModelIndex FindSourceParent(const QModelIndex &proxy_index) const; // QAbstractItemModel - QModelIndex index(int row, int column, const QModelIndex &parent) const override; + QModelIndex index(const int row, const int column, const QModelIndex &parent) const override; QModelIndex parent(const QModelIndex &child) const override; int rowCount(const QModelIndex &parent) const override; int columnCount(const QModelIndex &parent) const override; - QVariant data(const QModelIndex &proxy_index, int role = Qt::DisplayRole) const override; + QVariant data(const QModelIndex &proxy_index, const int role = Qt::DisplayRole) const override; bool hasChildren(const QModelIndex &parent) const override; QMap itemData(const QModelIndex &proxy_index) const override; Qt::ItemFlags flags(const QModelIndex &idx) const override; - bool setData(const QModelIndex &idx, const QVariant &value, int role) override; + bool setData(const QModelIndex &idx, const QVariant &value, const int role) override; QStringList mimeTypes() const override; QMimeData *mimeData(const QModelIndexList &indexes) const override; - bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, const int row, const int column, const QModelIndex &parent) override; bool canFetchMore(const QModelIndex &parent) const override; void fetchMore(const QModelIndex &parent) override; @@ -93,10 +93,10 @@ class MergedProxyModel : public QAbstractProxyModel { void SubModelAboutToBeReset(); void SubModelResetSlot(); - void RowsAboutToBeInserted(const QModelIndex &source_parent, int start, int end); - void RowsInserted(const QModelIndex &source_parent, int start, int end); - void RowsAboutToBeRemoved(const QModelIndex &source_parent, int start, int end); - void RowsRemoved(const QModelIndex &source_parent, int start, int end); + void RowsAboutToBeInserted(const QModelIndex &source_parent, const int start, const int end); + void RowsInserted(const QModelIndex &source_parent, const int start, const int end); + void RowsAboutToBeRemoved(const QModelIndex &source_parent, const int start, const int end); + void RowsRemoved(const QModelIndex &source_parent, const int start, const int end); void DataChanged(const QModelIndex &top_left, const QModelIndex &bottom_right); void LayoutAboutToBeChanged(); diff --git a/src/core/qtsystemtrayicon.cpp b/src/core/qtsystemtrayicon.cpp index 3f3195a05..b2f8e917a 100644 --- a/src/core/qtsystemtrayicon.cpp +++ b/src/core/qtsystemtrayicon.cpp @@ -190,7 +190,8 @@ void SystemTrayIcon::MuteButtonStateChanged(const bool value) { if (action_mute_) action_mute_->setChecked(value); } -void SystemTrayIcon::SetNowPlaying(const Song &song, const QUrl&) { +void SystemTrayIcon::SetNowPlaying(const Song &song, const QUrl &url) { + Q_UNUSED(url) if (available_) setToolTip(song.PrettyTitleWithArtist()); } diff --git a/src/core/qtsystemtrayicon.h b/src/core/qtsystemtrayicon.h index 3479a436b..efdc9daab 100644 --- a/src/core/qtsystemtrayicon.h +++ b/src/core/qtsystemtrayicon.h @@ -56,7 +56,7 @@ class SystemTrayIcon : public QSystemTrayIcon { void SetStopped(); void SetProgress(const int percentage); void MuteButtonStateChanged(const bool value); - void SetNowPlaying(const Song &song, const QUrl&); + void SetNowPlaying(const Song &song, const QUrl &url); void ClearNowPlaying(); void LoveVisibilityChanged(const bool value); void LoveStateChanged(const bool value); diff --git a/src/core/songloader.cpp b/src/core/songloader.cpp index 257875b27..f97251c12 100644 --- a/src/core/songloader.cpp +++ b/src/core/songloader.cpp @@ -545,7 +545,10 @@ SongLoader::Result SongLoader::LoadRemote() { #endif #ifdef HAVE_GSTREAMER -void SongLoader::TypeFound(GstElement*, uint, GstCaps *caps, void *self) { +void SongLoader::TypeFound(GstElement *typefind, const uint probability, GstCaps *caps, void *self) { + + Q_UNUSED(typefind) + Q_UNUSED(probability) SongLoader *instance = static_cast(self); @@ -567,7 +570,9 @@ void SongLoader::TypeFound(GstElement*, uint, GstCaps *caps, void *self) { #endif #ifdef HAVE_GSTREAMER -GstPadProbeReturn SongLoader::DataReady(GstPad*, GstPadProbeInfo *info, gpointer self) { +GstPadProbeReturn SongLoader::DataReady(GstPad *pad, GstPadProbeInfo *info, gpointer self) { + + Q_UNUSED(pad) SongLoader *instance = reinterpret_cast(self); @@ -594,7 +599,9 @@ GstPadProbeReturn SongLoader::DataReady(GstPad*, GstPadProbeInfo *info, gpointer #endif #ifdef HAVE_GSTREAMER -gboolean SongLoader::BusWatchCallback(GstBus*, GstMessage *msg, gpointer self) { +gboolean SongLoader::BusWatchCallback(GstBus *bus, GstMessage *msg, gpointer self) { + + Q_UNUSED(bus) SongLoader *instance = reinterpret_cast(self); @@ -612,7 +619,9 @@ gboolean SongLoader::BusWatchCallback(GstBus*, GstMessage *msg, gpointer self) { #endif #ifdef HAVE_GSTREAMER -GstBusSyncReply SongLoader::BusCallbackSync(GstBus*, GstMessage *msg, gpointer self) { +GstBusSyncReply SongLoader::BusCallbackSync(GstBus *bus, GstMessage *msg, gpointer self) { + + Q_UNUSED(bus) SongLoader *instance = reinterpret_cast(self); diff --git a/src/core/songloader.h b/src/core/songloader.h index fc6cd1a95..74e840c2b 100644 --- a/src/core/songloader.h +++ b/src/core/songloader.h @@ -121,10 +121,10 @@ class SongLoader : public QObject { Result LoadRemote(); // GStreamer callbacks - static void TypeFound(GstElement *typefind, uint probability, GstCaps *caps, void *self); - static GstPadProbeReturn DataReady(GstPad*, GstPadProbeInfo *info, gpointer self); - static GstBusSyncReply BusCallbackSync(GstBus*, GstMessage*, gpointer); - static gboolean BusWatchCallback(GstBus*, GstMessage*, gpointer); + static void TypeFound(GstElement *typefind, const uint probability, GstCaps *caps, void *self); + static GstPadProbeReturn DataReady(GstPad *pad, GstPadProbeInfo *info, gpointer self); + static GstBusSyncReply BusCallbackSync(GstBus *bus, GstMessage *msg, gpointer self); + static gboolean BusWatchCallback(GstBus *bus, GstMessage *msg, gpointer self); void ErrorMessageReceived(GstMessage *msg); void EndOfStreamReached(); diff --git a/src/device/cddalister.cpp b/src/device/cddalister.cpp index f7daddeb1..8c7af2f5b 100644 --- a/src/device/cddalister.cpp +++ b/src/device/cddalister.cpp @@ -39,10 +39,14 @@ QStringList CddaLister::DeviceUniqueIDs() { return devices_list_; } -QVariantList CddaLister::DeviceIcons(const QString &) { +QVariantList CddaLister::DeviceIcons(const QString &id) { + + Q_UNUSED(id) + QVariantList icons; icons << QStringLiteral("media-optical"); return icons; + } QString CddaLister::DeviceManufacturer(const QString &id) { @@ -71,11 +75,24 @@ QString CddaLister::DeviceModel(const QString &id) { } -quint64 CddaLister::DeviceCapacity(const QString&) { return 0; } +quint64 CddaLister::DeviceCapacity(const QString &id) { -quint64 CddaLister::DeviceFreeSpace(const QString&) { return 0; } + Q_UNUSED(id) -QVariantMap CddaLister::DeviceHardwareInfo(const QString&) { + return 0; + +} + +quint64 CddaLister::DeviceFreeSpace(const QString &id) { + + Q_UNUSED(id) + + return 0; + +} + +QVariantMap CddaLister::DeviceHardwareInfo(const QString &id) { + Q_UNUSED(id) return QVariantMap(); } @@ -100,7 +117,9 @@ void CddaLister::UnmountDevice(const QString &id) { cdio_eject_media_drive(id.toLocal8Bit().constData()); } -void CddaLister::UpdateDeviceFreeSpace(const QString&) {} +void CddaLister::UpdateDeviceFreeSpace(const QString &id) { + Q_UNUSED(id) +} bool CddaLister::Init() { diff --git a/src/device/connecteddevice.cpp b/src/device/connecteddevice.cpp index f4ddfd010..7d0b26519 100644 --- a/src/device/connecteddevice.cpp +++ b/src/device/connecteddevice.cpp @@ -132,12 +132,18 @@ void ConnectedDevice::Eject() { } -bool ConnectedDevice::FinishCopy(bool success, QString&) { +bool ConnectedDevice::FinishCopy(bool success, QString &error_text) { + + Q_UNUSED(error_text) + lister_->UpdateDeviceFreeSpace(unique_id_); + return success; + } -bool ConnectedDevice::FinishDelete(bool success, QString&) { +bool ConnectedDevice::FinishDelete(bool success, QString &error_text) { + Q_UNUSED(error_text) lister_->UpdateDeviceFreeSpace(unique_id_); return success; } diff --git a/src/device/devicestatefiltermodel.cpp b/src/device/devicestatefiltermodel.cpp index df62db1dc..cc897d3cb 100644 --- a/src/device/devicestatefiltermodel.cpp +++ b/src/device/devicestatefiltermodel.cpp @@ -38,11 +38,14 @@ DeviceStateFilterModel::DeviceStateFilterModel(QObject *parent, DeviceManager::S } -bool DeviceStateFilterModel::filterAcceptsRow(int row, const QModelIndex&) const { +bool DeviceStateFilterModel::filterAcceptsRow(const int row, const QModelIndex &parent) const { + Q_UNUSED(parent) return sourceModel()->index(row, 0).data(DeviceManager::Role_State).toInt() != state_ && sourceModel()->index(row, 0).data(DeviceManager::Role_CopyMusic).toBool(); } -void DeviceStateFilterModel::ProxyRowCountChanged(const QModelIndex&, const int, const int) { +void DeviceStateFilterModel::ProxyRowCountChanged(const QModelIndex &idx, const int, const int) { + + Q_UNUSED(idx) Q_EMIT IsEmptyChanged(rowCount() == 0); diff --git a/src/device/devicestatefiltermodel.h b/src/device/devicestatefiltermodel.h index 10c7aec95..eb00f72be 100644 --- a/src/device/devicestatefiltermodel.h +++ b/src/device/devicestatefiltermodel.h @@ -45,7 +45,7 @@ class DeviceStateFilterModel : public QSortFilterProxyModel { void IsEmptyChanged(const bool is_empty); protected: - bool filterAcceptsRow(int row, const QModelIndex &parent) const override; + bool filterAcceptsRow(const int row, const QModelIndex &parent) const override; private Q_SLOTS: void ProxyReset(); diff --git a/src/device/giolister.cpp b/src/device/giolister.cpp index bb3280b5f..a6a067a65 100644 --- a/src/device/giolister.cpp +++ b/src/device/giolister.cpp @@ -90,7 +90,8 @@ void OperationFinished(F f, GObject *object, GAsyncResult *result) { } -void GioLister::VolumeMountFinished(GObject *object, GAsyncResult *result, gpointer) { +void GioLister::VolumeMountFinished(GObject *object, GAsyncResult *result, gpointer instance) { + Q_UNUSED(instance) OperationFinished(std::bind(g_volume_mount_finish, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), object, result); } @@ -271,24 +272,29 @@ QList GioLister::MakeDeviceUrls(const QString &id) { } -void GioLister::VolumeAddedCallback(GVolumeMonitor*, GVolume *v, gpointer d) { - static_cast(d)->VolumeAdded(v); +void GioLister::VolumeAddedCallback(GVolumeMonitor *volume_monitor, GVolume *volume, gpointer instance) { + Q_UNUSED(volume_monitor) + static_cast(instance)->VolumeAdded(volume); } -void GioLister::VolumeRemovedCallback(GVolumeMonitor*, GVolume *v, gpointer d) { - static_cast(d)->VolumeRemoved(v); +void GioLister::VolumeRemovedCallback(GVolumeMonitor *volume_monitor, GVolume *volume, gpointer instance) { + Q_UNUSED(volume_monitor) + static_cast(instance)->VolumeRemoved(volume); } -void GioLister::MountAddedCallback(GVolumeMonitor*, GMount *m, gpointer d) { - static_cast(d)->MountAdded(m); +void GioLister::MountAddedCallback(GVolumeMonitor *volume_monitor, GMount *mount, gpointer instance) { + Q_UNUSED(volume_monitor) + static_cast(instance)->MountAdded(mount); } -void GioLister::MountChangedCallback(GVolumeMonitor*, GMount *m, gpointer d) { - static_cast(d)->MountChanged(m); +void GioLister::MountChangedCallback(GVolumeMonitor *volume_monitor, GMount *mount, gpointer instance) { + Q_UNUSED(volume_monitor) + static_cast(instance)->MountChanged(mount); } -void GioLister::MountRemovedCallback(GVolumeMonitor*, GMount *m, gpointer d) { - static_cast(d)->MountRemoved(m); +void GioLister::MountRemovedCallback(GVolumeMonitor *volume_monitor, GMount *mount, gpointer instance) { + Q_UNUSED(volume_monitor) + static_cast(instance)->MountRemoved(mount); } void GioLister::VolumeAdded(GVolume *volume) { @@ -570,11 +576,13 @@ void GioLister::VolumeEjectFinished(GObject *object, GAsyncResult *result, gpoin OperationFinished(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) { +void GioLister::MountEjectFinished(GObject *object, GAsyncResult *result, gpointer instance) { + Q_UNUSED(instance) OperationFinished(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) { +void GioLister::MountUnmountFinished(GObject *object, GAsyncResult *result, gpointer instance) { + Q_UNUSED(instance) OperationFinished(std::bind(g_mount_unmount_with_operation_finish, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), object, result); } diff --git a/src/device/giolister.h b/src/device/giolister.h index f863ce53e..d19c66704 100644 --- a/src/device/giolister.h +++ b/src/device/giolister.h @@ -116,17 +116,17 @@ class GioLister : public DeviceLister { void MountChanged(GMount *mount); void MountRemoved(GMount *mount); - static void VolumeAddedCallback(GVolumeMonitor*, GVolume*, gpointer); - static void VolumeRemovedCallback(GVolumeMonitor*, GVolume*, gpointer); + static void VolumeAddedCallback(GVolumeMonitor *volume_monitor, GVolume *volume, gpointer instance); + static void VolumeRemovedCallback(GVolumeMonitor *volume_monitor, GVolume *volume, gpointer instance); - static void MountAddedCallback(GVolumeMonitor*, GMount*, gpointer); - static void MountChangedCallback(GVolumeMonitor*, GMount*, gpointer); - static void MountRemovedCallback(GVolumeMonitor*, GMount*, gpointer); + static void MountAddedCallback(GVolumeMonitor *volume_monitor, GMount*, gpointer instance); + static void MountChangedCallback(GVolumeMonitor *volume_monitor, GMount*, gpointer instance); + static void MountRemovedCallback(GVolumeMonitor *volume_monitor, GMount *mount, gpointer instance); - static void VolumeMountFinished(GObject *object, GAsyncResult *result, gpointer); - static void VolumeEjectFinished(GObject *object, GAsyncResult *result, gpointer); - static void MountEjectFinished(GObject *object, GAsyncResult *result, gpointer); - static void MountUnmountFinished(GObject *object, GAsyncResult *result, gpointer); + static void VolumeMountFinished(GObject *object, GAsyncResult *result, gpointer instance); + static void VolumeEjectFinished(GObject *object, GAsyncResult *result, gpointer instance); + static void MountEjectFinished(GObject *object, GAsyncResult *result, gpointer instance); + static void MountUnmountFinished(GObject *object, GAsyncResult *result, gpointer instance); // You MUST hold the mutex while calling this function QString FindUniqueIdByMount(GMount *mount) const; diff --git a/src/engine/chromaprinter.cpp b/src/engine/chromaprinter.cpp index 1a4f7f431..ddb232ef6 100644 --- a/src/engine/chromaprinter.cpp +++ b/src/engine/chromaprinter.cpp @@ -189,7 +189,9 @@ QString Chromaprinter::CreateFingerprint() { } -void Chromaprinter::NewPadCallback(GstElement*, GstPad *pad, gpointer data) { +void Chromaprinter::NewPadCallback(GstElement *element, GstPad *pad, gpointer data) { + + Q_UNUSED(element) Chromaprinter *instance = reinterpret_cast(data); GstPad *const audiopad = gst_element_get_static_pad(instance->convert_element_, "sink"); diff --git a/src/engine/chromaprinter.h b/src/engine/chromaprinter.h index a2e8215de..dda6ef67e 100644 --- a/src/engine/chromaprinter.h +++ b/src/engine/chromaprinter.h @@ -49,7 +49,7 @@ class Chromaprinter { private: static GstElement *CreateElement(const QString &factory_name, GstElement *bin = nullptr); - static void NewPadCallback(GstElement*, GstPad *pad, gpointer data); + static void NewPadCallback(GstElement *element, GstPad *pad, gpointer data); static GstFlowReturn NewBufferCallback(GstAppSink *app_sink, gpointer self); private: diff --git a/src/engine/enginebase.cpp b/src/engine/enginebase.cpp index ce15614e5..dfb5e7175 100644 --- a/src/engine/enginebase.cpp +++ b/src/engine/enginebase.cpp @@ -114,8 +114,9 @@ QString EngineBase::Description(const Type type) { } -bool EngineBase::Load(const QUrl &media_url, const QUrl &stream_url, const TrackChangeFlags, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec, const std::optional ebur128_integrated_loudness_lufs) { +bool EngineBase::Load(const QUrl &media_url, const QUrl &stream_url, const TrackChangeFlags track_change_flags, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec, const std::optional ebur128_integrated_loudness_lufs) { + Q_UNUSED(track_change_flags) Q_UNUSED(force_stop_at_end); media_url_ = media_url; diff --git a/src/engine/enginebase.h b/src/engine/enginebase.h index 0dc877398..2940c99f2 100644 --- a/src/engine/enginebase.h +++ b/src/engine/enginebase.h @@ -104,7 +104,7 @@ class EngineBase : public QObject { virtual bool Init() = 0; virtual State state() const = 0; virtual void StartPreloading(const QUrl&, const QUrl&, const bool, const qint64, const qint64) {} - virtual bool Load(const QUrl &media_url, const QUrl &stream_url, const TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec, const std::optional ebur128_integrated_loudness_lufs); + virtual bool Load(const QUrl &media_url, const QUrl &stream_url, const TrackChangeFlags track_change_flags, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec, const std::optional ebur128_integrated_loudness_lufs); virtual bool Play(const bool pause, const quint64 offset_nanosec) = 0; virtual void Stop(const bool stop_after = false) = 0; virtual void Pause() = 0; diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index ca77cff2a..d78e7c39c 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -1063,7 +1063,10 @@ void GstEngine::UpdateScope(const int chunk_length) { } -void GstEngine::StreamDiscovered(GstDiscoverer*, GstDiscovererInfo *info, GError*, gpointer self) { +void GstEngine::StreamDiscovered(GstDiscoverer *discoverer, GstDiscovererInfo *info, GError *error, gpointer self) { + + Q_UNUSED(discoverer) + Q_UNUSED(error) GstEngine *instance = reinterpret_cast(self); if (!instance->current_pipeline_) return; @@ -1146,7 +1149,10 @@ void GstEngine::StreamDiscovered(GstDiscoverer*, GstDiscovererInfo *info, GError } -void GstEngine::StreamDiscoveryFinished(GstDiscoverer*, gpointer) {} +void GstEngine::StreamDiscoveryFinished(GstDiscoverer *discoverer, gpointer self) { + Q_UNUSED(discoverer) + Q_UNUSED(self) +} QString GstEngine::GSTdiscovererErrorMessage(GstDiscovererResult result) { diff --git a/src/engine/gstengine.h b/src/engine/gstengine.h index 3672a768c..22291d32e 100644 --- a/src/engine/gstengine.h +++ b/src/engine/gstengine.h @@ -144,8 +144,8 @@ class GstEngine : public EngineBase, public GstBufferConsumer { void UpdateScope(int chunk_length); - static void StreamDiscovered(GstDiscoverer*, GstDiscovererInfo *info, GError*, gpointer self); - static void StreamDiscoveryFinished(GstDiscoverer*, gpointer); + static void StreamDiscovered(GstDiscoverer *discoverer, GstDiscovererInfo *info, GError *error, gpointer self); + static void StreamDiscoveryFinished(GstDiscoverer *discoverer, gpointer self); static QString GSTdiscovererErrorMessage(GstDiscovererResult result); bool OldExclusivePipelineActive() const; diff --git a/src/engine/gststartup.cpp b/src/engine/gststartup.cpp index 0e8b12904..45a8aa59a 100644 --- a/src/engine/gststartup.cpp +++ b/src/engine/gststartup.cpp @@ -48,7 +48,9 @@ using namespace Qt::Literals::StringLiterals; GThread *GstStartup::kGThread = nullptr; -gpointer GstStartup::GLibMainLoopThreadFunc(gpointer) { +gpointer GstStartup::GLibMainLoopThreadFunc(gpointer data) { + + Q_UNUSED(data) qLog(Info) << "Creating GLib main event loop."; diff --git a/src/engine/gststartup.h b/src/engine/gststartup.h index 2a85dd72f..e080c3ecb 100644 --- a/src/engine/gststartup.h +++ b/src/engine/gststartup.h @@ -40,7 +40,7 @@ class GstStartup : public QObject { private: static GThread *kGThread; - static gpointer GLibMainLoopThreadFunc(gpointer); + static gpointer GLibMainLoopThreadFunc(gpointer data); static void InitializeGStreamer(); static void SetEnvironment(); diff --git a/src/equalizer/equalizer.cpp b/src/equalizer/equalizer.cpp index c6d8f0ac1..4cc8c4b71 100644 --- a/src/equalizer/equalizer.cpp +++ b/src/equalizer/equalizer.cpp @@ -299,7 +299,9 @@ void Equalizer::StereoBalancerEnabledChangedSlot(const bool enabled) { } -void Equalizer::StereoBalanceSliderChanged(const int) { +void Equalizer::StereoBalanceSliderChanged(const int value) { + + Q_UNUSED(value) Q_EMIT StereoBalanceChanged(stereo_balance()); Save(); @@ -348,7 +350,9 @@ void Equalizer::Save() { } -void Equalizer::closeEvent(QCloseEvent*) { +void Equalizer::closeEvent(QCloseEvent *e) { + + Q_UNUSED(e) QString name = ui_->preset->currentText(); if (!presets_.contains(name)) return; diff --git a/src/equalizer/equalizer.h b/src/equalizer/equalizer.h index 984cc0edb..b11c39ce8 100644 --- a/src/equalizer/equalizer.h +++ b/src/equalizer/equalizer.h @@ -71,7 +71,7 @@ class Equalizer : public QDialog { void EqualizerParametersChanged(const int preamp, const QList &band_gains); protected: - void closeEvent(QCloseEvent*) override; + void closeEvent(QCloseEvent *e) override; private Q_SLOTS: void StereoBalancerEnabledChangedSlot(const bool enabled); diff --git a/src/globalshortcuts/globalshortcut-x11.cpp b/src/globalshortcuts/globalshortcut-x11.cpp index ee52429fd..abdc8d47f 100644 --- a/src/globalshortcuts/globalshortcut-x11.cpp +++ b/src/globalshortcuts/globalshortcut-x11.cpp @@ -91,7 +91,10 @@ int GlobalShortcut::nativeKeycode(const Qt::Key qt_keycode) { } -int GlobalShortcut::nativeKeycode2(const Qt::Key) { return 0; } +int GlobalShortcut::nativeKeycode2(const Qt::Key key) { + Q_UNUSED(key) + return 0; +} bool GlobalShortcut::registerShortcut(const int native_key, const int native_mods) { diff --git a/src/globalshortcuts/globalshortcutsbackend-gnome.cpp b/src/globalshortcuts/globalshortcutsbackend-gnome.cpp index fb41b1ce6..033fec7d9 100644 --- a/src/globalshortcuts/globalshortcutsbackend-gnome.cpp +++ b/src/globalshortcuts/globalshortcutsbackend-gnome.cpp @@ -117,7 +117,9 @@ void GlobalShortcutsBackendGnome::DoUnregister() { } -void GlobalShortcutsBackendGnome::GnomeMediaKeyPressed(const QString&, const QString &key) { +void GlobalShortcutsBackendGnome::GnomeMediaKeyPressed(const QString &application, const QString &key) { + + Q_UNUSED(application) auto shortcuts = manager_->shortcuts(); if (key == "Play"_L1) shortcuts[QStringLiteral("play_pause")].action->trigger(); diff --git a/src/globalshortcuts/globalshortcutsbackend-kde.cpp b/src/globalshortcuts/globalshortcutsbackend-kde.cpp index 742a6ca17..ff66c8bd6 100644 --- a/src/globalshortcuts/globalshortcutsbackend-kde.cpp +++ b/src/globalshortcuts/globalshortcutsbackend-kde.cpp @@ -207,7 +207,9 @@ QList GlobalShortcutsBackendKDE::ToKeySequenceList(const QList actions = actions_.values(shortcut_unique); diff --git a/src/globalshortcuts/globalshortcutsbackend-kde.h b/src/globalshortcuts/globalshortcutsbackend-kde.h index afb284220..290a74429 100644 --- a/src/globalshortcuts/globalshortcutsbackend-kde.h +++ b/src/globalshortcuts/globalshortcutsbackend-kde.h @@ -59,7 +59,7 @@ class GlobalShortcutsBackendKDE : public GlobalShortcutsBackend { private Q_SLOTS: void RegisterFinished(QDBusPendingCallWatcher *watcher); - void GlobalShortcutPressed(const QString &component_unique, const QString &shortcut_unique, qint64); + void GlobalShortcutPressed(const QString &component_unique, const QString &shortcut_unique, const qint64 timestamp); private: OrgKdeKGlobalAccelInterface *interface_; diff --git a/src/globalshortcuts/globalshortcutsbackend-mate.cpp b/src/globalshortcuts/globalshortcutsbackend-mate.cpp index 0f29f6555..f45d0d1fa 100644 --- a/src/globalshortcuts/globalshortcutsbackend-mate.cpp +++ b/src/globalshortcuts/globalshortcutsbackend-mate.cpp @@ -117,7 +117,9 @@ void GlobalShortcutsBackendMate::DoUnregister() { } -void GlobalShortcutsBackendMate::MateMediaKeyPressed(const QString&, const QString &key) { +void GlobalShortcutsBackendMate::MateMediaKeyPressed(const QString &application, const QString &key) { + + Q_UNUSED(application) auto shortcuts = manager_->shortcuts(); if (key == "Play"_L1) shortcuts[QStringLiteral("play_pause")].action->trigger(); diff --git a/src/lyrics/lyricfindlyricsprovider.h b/src/lyrics/lyricfindlyricsprovider.h index c36a69d43..13cebb201 100644 --- a/src/lyrics/lyricfindlyricsprovider.h +++ b/src/lyrics/lyricfindlyricsprovider.h @@ -46,7 +46,7 @@ class LyricFindLyricsProvider : public JsonLyricsProvider { static QUrl Url(const LyricsSearchRequest &request); static QString StringFixup(const QString &text); void StartSearch(const int id, const LyricsSearchRequest &request) override; - void EndSearch(const int id, const LyricsSearchRequest &request, const LyricsSearchResults &lyrics = LyricsSearchResults()); + void EndSearch(const int id, const LyricsSearchRequest &request, const LyricsSearchResults &results = LyricsSearchResults()); void Error(const QString &error, const QVariant &debug = QVariant()) override; private Q_SLOTS: diff --git a/src/moodbar/moodbarproxystyle.cpp b/src/moodbar/moodbarproxystyle.cpp index bce12cd53..4524ee705 100644 --- a/src/moodbar/moodbarproxystyle.cpp +++ b/src/moodbar/moodbarproxystyle.cpp @@ -54,7 +54,7 @@ constexpr int kArrowWidth = 17; constexpr int kArrowHeight = 13; } // namespace -MoodbarProxyStyle::MoodbarProxyStyle(Application *app, QSlider *slider, QObject*) +MoodbarProxyStyle::MoodbarProxyStyle(Application *app, QSlider *slider, QObject *parent) : QProxyStyle(nullptr), app_(app), slider_(slider), @@ -68,6 +68,8 @@ MoodbarProxyStyle::MoodbarProxyStyle(Application *app, QSlider *slider, QObject* show_moodbar_action_(nullptr), style_action_group_(nullptr) { + Q_UNUSED(parent) + slider->setStyle(this); slider->installEventFilter(this); diff --git a/src/organize/organizedialog.cpp b/src/organize/organizedialog.cpp index b16e2e1b1..0daaf76dd 100644 --- a/src/organize/organizedialog.cpp +++ b/src/organize/organizedialog.cpp @@ -168,14 +168,18 @@ void OrganizeDialog::SetDestinationModel(QAbstractItemModel *model, const bool d } -void OrganizeDialog::showEvent(QShowEvent*) { +void OrganizeDialog::showEvent(QShowEvent *e) { + + Q_UNUSED(e) LoadGeometry(); LoadSettings(); } -void OrganizeDialog::closeEvent(QCloseEvent*) { +void OrganizeDialog::closeEvent(QCloseEvent *e) { + + Q_UNUSED(e) if (!devices_) SaveGeometry(); diff --git a/src/organize/organizedialog.h b/src/organize/organizedialog.h index 2e13490dd..3f78a72b1 100644 --- a/src/organize/organizedialog.h +++ b/src/organize/organizedialog.h @@ -74,8 +74,8 @@ class OrganizeDialog : public QDialog { void SetPlaylist(const QString &playlist); protected: - void showEvent(QShowEvent*) override; - void closeEvent(QCloseEvent*) override; + void showEvent(QShowEvent *e) override; + void closeEvent(QCloseEvent *e) override; private: void LoadGeometry(); diff --git a/src/osd/osdbase.cpp b/src/osd/osdbase.cpp index 61b8d4790..cf5ec3656 100644 --- a/src/osd/osdbase.cpp +++ b/src/osd/osdbase.cpp @@ -451,6 +451,13 @@ bool OSDBase::SupportsTrayPopups() { return tray_icon_->IsSystemTrayAvailable(); } -void OSDBase::ShowMessageNative(const QString&, const QString&, const QString&, const QImage&) { +void OSDBase::ShowMessageNative(const QString &summary, const QString &message, const QString &icon, const QImage &image) { + + Q_UNUSED(summary) + Q_UNUSED(message) + Q_UNUSED(icon) + Q_UNUSED(image) + qLog(Warning) << "Native notifications are not supported on this OS."; + } diff --git a/src/osd/osdpretty.cpp b/src/osd/osdpretty.cpp index 9f64d0aab..2387d0faf 100644 --- a/src/osd/osdpretty.cpp +++ b/src/osd/osdpretty.cpp @@ -292,7 +292,9 @@ QRect OSDPretty::BoxBorder() const { return rect().adjusted(kDropShadowSize, kDropShadowSize, -kDropShadowSize, -kDropShadowSize); } -void OSDPretty::paintEvent(QPaintEvent*) { +void OSDPretty::paintEvent(QPaintEvent *e) { + + Q_UNUSED(e) QPainter p(this); p.setRenderHint(QPainter::Antialiasing); @@ -461,7 +463,9 @@ void OSDPretty::Reposition() { } -void OSDPretty::enterEvent(QEnterEvent*) { +void OSDPretty::enterEvent(QEnterEvent *e) { + + Q_UNUSED(e) if (mode_ == Mode::Popup) { setWindowOpacity(0.25); @@ -469,8 +473,12 @@ void OSDPretty::enterEvent(QEnterEvent*) { } -void OSDPretty::leaveEvent(QEvent*) { +void OSDPretty::leaveEvent(QEvent *e) { + + Q_UNUSED(e) + setWindowOpacity(1.0); + } void OSDPretty::mousePressEvent(QMouseEvent *e) { @@ -514,7 +522,9 @@ void OSDPretty::mouseMoveEvent(QMouseEvent *e) { } -void OSDPretty::mouseReleaseEvent(QMouseEvent *) { +void OSDPretty::mouseReleaseEvent(QMouseEvent *e) { + + Q_UNUSED(e) if (current_screen() && mode_ == Mode::Draggable) { popup_screen_ = current_screen(); diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index 238d0ebf7..cc2bdeaa8 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -188,7 +188,9 @@ void Playlist::InsertSongItems(const SongList &songs, const int pos, const bool } -QVariant Playlist::headerData(const int section, Qt::Orientation, const int role) const { +QVariant Playlist::headerData(const int section, Qt::Orientation orientation, const int role) const { + + Q_UNUSED(orientation) if (role != Qt::DisplayRole && role != Qt::ToolTipRole) return QVariant(); @@ -501,7 +503,8 @@ int Playlist::last_played_row() const { return last_played_item_index_.isValid() ? last_played_item_index_.row() : -1; } -void Playlist::ShuffleModeChanged(const PlaylistSequence::ShuffleMode) { +void Playlist::ShuffleModeChanged(const PlaylistSequence::ShuffleMode shuffle_mode) { + Q_UNUSED(shuffle_mode) ReshuffleIndices(); } @@ -787,7 +790,10 @@ Qt::DropActions Playlist::supportedDropActions() const { return Qt::MoveAction | Qt::CopyAction | Qt::LinkAction; } -bool Playlist::dropMimeData(const QMimeData *data, Qt::DropAction action, const int row, int, const QModelIndex&) { +bool Playlist::dropMimeData(const QMimeData *data, Qt::DropAction action, const int row, const int column, const QModelIndex &parent_index) { + + Q_UNUSED(column) + Q_UNUSED(parent_index) if (action == Qt::IgnoreAction) return false; @@ -2060,7 +2066,9 @@ PlaylistItemPtrList Playlist::collection_items_by_id(const int id) const { return collection_items_by_id_.values(id); } -void Playlist::TracksAboutToBeDequeued(const QModelIndex&, const int begin, const int end) { +void Playlist::TracksAboutToBeDequeued(const QModelIndex &idx, const int begin, const int end) { + + Q_UNUSED(idx) for (int i = begin; i <= end; ++i) { temp_dequeue_change_indexes_ << queue_->mapToSource(queue_->index(i, static_cast(Column::Title))); @@ -2078,7 +2086,9 @@ void Playlist::TracksDequeued() { } -void Playlist::TracksEnqueued(const QModelIndex&, const int begin, const int end) { +void Playlist::TracksEnqueued(const QModelIndex &parent_idx, const int begin, const int end) { + + Q_UNUSED(parent_idx) const QModelIndex &b = queue_->mapToSource(queue_->index(begin, static_cast(Column::Title))); const QModelIndex &e = queue_->mapToSource(queue_->index(end, static_cast(Column::Title))); diff --git a/src/playlist/playlist.h b/src/playlist/playlist.h index 3009bb688..8595a6754 100644 --- a/src/playlist/playlist.h +++ b/src/playlist/playlist.h @@ -255,7 +255,7 @@ class Playlist : public QAbstractListModel { QStringList mimeTypes() const override; Qt::DropActions supportedDropActions() const override; QMimeData *mimeData(const QModelIndexList &indexes) const override; - bool dropMimeData(const QMimeData *data, Qt::DropAction action, const int row, const int column, const QModelIndex &parent) override; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, const int row, const int column, const QModelIndex &parent_index) override; void sort(const int column_number, const Qt::SortOrder order) override; bool removeRows(const int row, const int count, const QModelIndex &parent = QModelIndex()) override; @@ -288,7 +288,7 @@ class Playlist : public QAbstractListModel { void RemoveUnavailableSongs(); void Shuffle(); - void ShuffleModeChanged(const PlaylistSequence::ShuffleMode); + void ShuffleModeChanged(const PlaylistSequence::ShuffleMode shuffle_mode); void SetColumnAlignment(const ColumnAlignmentMap &alignment); @@ -348,7 +348,7 @@ class Playlist : public QAbstractListModel { private Q_SLOTS: void TracksAboutToBeDequeued(const QModelIndex&, const int begin, const int end); void TracksDequeued(); - void TracksEnqueued(const QModelIndex&, const int begin, const int end); + void TracksEnqueued(const QModelIndex &parent_idx, const int begin, const int end); void QueueLayoutChanged(); void SongSaveComplete(TagReaderReply *reply, const QPersistentModelIndex &idx, const Song &old_metadata); void ItemReloadComplete(const QPersistentModelIndex &idx, const Song &old_metadata, const bool metadata_edit); diff --git a/src/playlist/playlistdelegates.cpp b/src/playlist/playlistdelegates.cpp index e96f1ea75..10b1f98b1 100644 --- a/src/playlist/playlistdelegates.cpp +++ b/src/playlist/playlistdelegates.cpp @@ -170,7 +170,9 @@ PlaylistDelegateBase::PlaylistDelegateBase(QObject *parent, const QString &suffi { } -QString PlaylistDelegateBase::displayText(const QVariant &value, const QLocale&) const { +QString PlaylistDelegateBase::displayText(const QVariant &value, const QLocale &locale) const { + + Q_UNUSED(locale) QString text; @@ -297,7 +299,9 @@ bool PlaylistDelegateBase::helpEvent(QHelpEvent *event, QAbstractItemView *view, } -QString LengthItemDelegate::displayText(const QVariant &value, const QLocale&) const { +QString LengthItemDelegate::displayText(const QVariant &value, const QLocale &locale) const { + + Q_UNUSED(locale) bool ok = false; qint64 nanoseconds = value.toLongLong(&ok); @@ -308,7 +312,9 @@ QString LengthItemDelegate::displayText(const QVariant &value, const QLocale&) c } -QString SizeItemDelegate::displayText(const QVariant &value, const QLocale&) const { +QString SizeItemDelegate::displayText(const QVariant &value, const QLocale &locale) const { + + Q_UNUSED(locale) bool ok = false; qint64 bytes = value.toLongLong(&ok); @@ -425,7 +431,10 @@ void TagCompleter::ModelReady() { } -QWidget *TagCompletionItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex&) const { +QWidget *TagCompletionItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &idx) const { + + Q_UNUSED(option) + Q_UNUSED(idx) QLineEdit *editor = new QLineEdit(parent); new TagCompleter(backend_, column_, editor); @@ -434,7 +443,9 @@ QWidget *TagCompletionItemDelegate::createEditor(QWidget *parent, const QStyleOp } -QString NativeSeparatorsDelegate::displayText(const QVariant &value, const QLocale&) const { +QString NativeSeparatorsDelegate::displayText(const QVariant &value, const QLocale &locale) const { + + Q_UNUSED(locale) const QString string_value = value.toString(); @@ -458,8 +469,9 @@ QString NativeSeparatorsDelegate::displayText(const QVariant &value, const QLoca SongSourceDelegate::SongSourceDelegate(QObject *parent) : PlaylistDelegateBase(parent) {} -QString SongSourceDelegate::displayText(const QVariant &value, const QLocale&) const { +QString SongSourceDelegate::displayText(const QVariant &value, const QLocale &locale) const { Q_UNUSED(value); + Q_UNUSED(locale) return QString(); } @@ -522,7 +534,9 @@ QSize RatingItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QMo } -QString RatingItemDelegate::displayText(const QVariant &value, const QLocale&) const { +QString RatingItemDelegate::displayText(const QVariant &value, const QLocale &locale) const { + + Q_UNUSED(locale) if (value.isNull() || value.toFloat() <= 0) return QString(); @@ -533,7 +547,9 @@ QString RatingItemDelegate::displayText(const QVariant &value, const QLocale&) c } -QString Ebur128LoudnessLUFSItemDelegate::displayText(const QVariant &value, const QLocale&) const { +QString Ebur128LoudnessLUFSItemDelegate::displayText(const QVariant &value, const QLocale &locale) const { + + Q_UNUSED(locale) bool ok = false; double v = value.toDouble(&ok); @@ -543,7 +559,9 @@ QString Ebur128LoudnessLUFSItemDelegate::displayText(const QVariant &value, cons } -QString Ebur128LoudnessRangeLUItemDelegate::displayText(const QVariant &value, const QLocale&) const { +QString Ebur128LoudnessRangeLUItemDelegate::displayText(const QVariant &value, const QLocale &locale) const { + + Q_UNUSED(locale) bool ok = false; double v = value.toDouble(&ok); diff --git a/src/playlist/playlistheader.cpp b/src/playlist/playlistheader.cpp index c4ea58a33..82dac43e0 100644 --- a/src/playlist/playlistheader.cpp +++ b/src/playlist/playlistheader.cpp @@ -164,7 +164,8 @@ void PlaylistHeader::ToggleVisible(const int section) { Q_EMIT SectionVisibilityChanged(section, !isSectionHidden(section)); } -void PlaylistHeader::enterEvent(QEnterEvent*) { +void PlaylistHeader::enterEvent(QEnterEvent *e) { + Q_UNUSED(e) Q_EMIT MouseEntered(); } diff --git a/src/playlist/playlistlistview.cpp b/src/playlist/playlistlistview.cpp index 4d674e9b1..9ab1b80ae 100644 --- a/src/playlist/playlistlistview.cpp +++ b/src/playlist/playlistlistview.cpp @@ -70,8 +70,13 @@ bool PlaylistListView::ItemsSelected() const { return selectionModel()->selectedRows().count() > 0; } -void PlaylistListView::selectionChanged(const QItemSelection&, const QItemSelection&) { +void PlaylistListView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) { + + Q_UNUSED(selected) + Q_UNUSED(deselected) + Q_EMIT ItemsSelectedChanged(selectionModel()->selectedRows().count() > 0); + } void PlaylistListView::dragEnterEvent(QDragEnterEvent *e) { diff --git a/src/playlist/playlisttabbar.cpp b/src/playlist/playlisttabbar.cpp index 3c1656cbc..1640da5c8 100644 --- a/src/playlist/playlisttabbar.cpp +++ b/src/playlist/playlisttabbar.cpp @@ -408,7 +408,8 @@ void PlaylistTabBar::dragMoveEvent(QDragMoveEvent *e) { } -void PlaylistTabBar::dragLeaveEvent(QDragLeaveEvent*) { +void PlaylistTabBar::dragLeaveEvent(QDragLeaveEvent *e) { + Q_UNUSED(e) drag_hover_timer_.stop(); } diff --git a/src/playlistparsers/asxparser.cpp b/src/playlistparsers/asxparser.cpp index 8b93f803b..f18f1d04a 100644 --- a/src/playlistparsers/asxparser.cpp +++ b/src/playlistparsers/asxparser.cpp @@ -133,7 +133,10 @@ return_song: } -void ASXParser::Save(const SongList &songs, QIODevice *device, const QDir&, const PlaylistSettingsPage::PathType) const { +void ASXParser::Save(const SongList &songs, QIODevice *device, const QDir &dir, const PlaylistSettingsPage::PathType path_type) const { + + Q_UNUSED(dir) + Q_UNUSED(path_type) QXmlStreamWriter writer(device); writer.setAutoFormatting(true); diff --git a/src/queue/queue.cpp b/src/queue/queue.cpp index ad5bbfc57..0fbb67b56 100644 --- a/src/queue/queue.cpp +++ b/src/queue/queue.cpp @@ -148,7 +148,10 @@ int Queue::rowCount(const QModelIndex &parent) const { return static_cast(source_indexes_.count()); } -int Queue::columnCount(const QModelIndex&) const { return 1; } +int Queue::columnCount(const QModelIndex &parent) const { + Q_UNUSED(parent) + return 1; +} QVariant Queue::data(const QModelIndex &proxy_index, int role) const { @@ -356,7 +359,10 @@ QMimeData *Queue::mimeData(const QModelIndexList &indexes) const { } -bool Queue::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int, const QModelIndex&) { +bool Queue::dropMimeData(const QMimeData *data, Qt::DropAction action, const int row, const int column, const QModelIndex &parent_index) { + + Q_UNUSED(column) + Q_UNUSED(parent_index) if (action == Qt::IgnoreAction) return false; diff --git a/src/queue/queue.h b/src/queue/queue.h index b75977c37..ca8b49885 100644 --- a/src/queue/queue.h +++ b/src/queue/queue.h @@ -74,7 +74,7 @@ class Queue : public QAbstractProxyModel { QStringList mimeTypes() const override; Qt::DropActions supportedDropActions() const override; QMimeData *mimeData(const QModelIndexList &indexes) const override; - bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, const int row, const int column, const QModelIndex &parent_index) override; Qt::ItemFlags flags(const QModelIndex &idx) const override; public Q_SLOTS: diff --git a/src/radios/radioview.cpp b/src/radios/radioview.cpp index 816f9c82b..90cfb00b6 100644 --- a/src/radios/radioview.cpp +++ b/src/radios/radioview.cpp @@ -54,7 +54,9 @@ RadioView::RadioView(QWidget *parent) RadioView::~RadioView() { delete menu_; } -void RadioView::showEvent(QShowEvent*) { +void RadioView::showEvent(QShowEvent *e) { + + Q_UNUSED(e) if (!initialized_) { Q_EMIT GetChannels(); diff --git a/src/settings/notificationssettingspage.cpp b/src/settings/notificationssettingspage.cpp index cafedbf21..79992025f 100644 --- a/src/settings/notificationssettingspage.cpp +++ b/src/settings/notificationssettingspage.cpp @@ -142,11 +142,13 @@ NotificationsSettingsPage::~NotificationsSettingsPage() { delete ui_; } -void NotificationsSettingsPage::showEvent(QShowEvent*) { +void NotificationsSettingsPage::showEvent(QShowEvent *e) { + Q_UNUSED(e) UpdatePopupVisible(); } -void NotificationsSettingsPage::hideEvent(QHideEvent*) { +void NotificationsSettingsPage::hideEvent(QHideEvent *e) { + Q_UNUSED(e) UpdatePopupVisible(); } diff --git a/src/settings/settingsdialog.cpp b/src/settings/settingsdialog.cpp index c690e5d8e..95f53de53 100644 --- a/src/settings/settingsdialog.cpp +++ b/src/settings/settingsdialog.cpp @@ -209,7 +209,9 @@ void SettingsDialog::showEvent(QShowEvent *e) { } -void SettingsDialog::closeEvent(QCloseEvent*) { +void SettingsDialog::closeEvent(QCloseEvent *e) { + + Q_UNUSED(e) SaveGeometry(); diff --git a/src/smartplaylists/smartplaylistsearchtermwidgetoverlay.cpp b/src/smartplaylists/smartplaylistsearchtermwidgetoverlay.cpp index 3303bb84c..732124534 100644 --- a/src/smartplaylists/smartplaylistsearchtermwidgetoverlay.cpp +++ b/src/smartplaylists/smartplaylistsearchtermwidgetoverlay.cpp @@ -80,7 +80,9 @@ void SmartPlaylistSearchTermWidgetOverlay::SetOpacity(const float opacity) { } -void SmartPlaylistSearchTermWidgetOverlay::paintEvent(QPaintEvent*) { +void SmartPlaylistSearchTermWidgetOverlay::paintEvent(QPaintEvent *e) { + + Q_UNUSED(e) QPainter p(this); diff --git a/src/smartplaylists/smartplaylistsview.cpp b/src/smartplaylists/smartplaylistsview.cpp index a2070fc63..24f818f56 100644 --- a/src/smartplaylists/smartplaylistsview.cpp +++ b/src/smartplaylists/smartplaylistsview.cpp @@ -39,7 +39,9 @@ SmartPlaylistsView::SmartPlaylistsView(QWidget *_parent) : QListView(_parent) { SmartPlaylistsView::~SmartPlaylistsView() = default; -void SmartPlaylistsView::selectionChanged(const QItemSelection&, const QItemSelection&) { +void SmartPlaylistsView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) { + Q_UNUSED(selected) + Q_UNUSED(deselected) Q_EMIT ItemsSelectedChanged(); } diff --git a/src/smartplaylists/smartplaylistsview.h b/src/smartplaylists/smartplaylistsview.h index c543b5e62..cc60901c5 100644 --- a/src/smartplaylists/smartplaylistsview.h +++ b/src/smartplaylists/smartplaylistsview.h @@ -35,7 +35,7 @@ class SmartPlaylistsView : public QListView { ~SmartPlaylistsView(); protected: - void selectionChanged(const QItemSelection&, const QItemSelection&) override; + void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override; void contextMenuEvent(QContextMenuEvent *e) override; Q_SIGNALS: diff --git a/src/streaming/streamingsearchview.cpp b/src/streaming/streamingsearchview.cpp index 7b006daf1..c17d8d103 100644 --- a/src/streaming/streamingsearchview.cpp +++ b/src/streaming/streamingsearchview.cpp @@ -732,15 +732,18 @@ void StreamingSearchView::SetGroupBy(const CollectionModel::Grouping g) { } -void StreamingSearchView::SearchArtistsClicked(const bool) { +void StreamingSearchView::SearchArtistsClicked(const bool checked) { + Q_UNUSED(checked) SetSearchType(StreamingSearchView::SearchType::Artists); } -void StreamingSearchView::SearchAlbumsClicked(const bool) { +void StreamingSearchView::SearchAlbumsClicked(const bool checked) { + Q_UNUSED(checked) SetSearchType(StreamingSearchView::SearchType::Albums); } -void StreamingSearchView::SearchSongsClicked(const bool) { +void StreamingSearchView::SearchSongsClicked(const bool checked) { + Q_UNUSED(checked) SetSearchType(StreamingSearchView::SearchType::Songs); } diff --git a/src/streaming/streamingsearchview.h b/src/streaming/streamingsearchview.h index fa954bc38..d4f77d62a 100644 --- a/src/streaming/streamingsearchview.h +++ b/src/streaming/streamingsearchview.h @@ -165,9 +165,9 @@ class StreamingSearchView : public QWidget { void SearchForThis(); void OpenSettingsDialog(); - void SearchArtistsClicked(const bool); - void SearchAlbumsClicked(const bool); - void SearchSongsClicked(const bool); + void SearchArtistsClicked(const bool checked); + void SearchAlbumsClicked(const bool checked); + void SearchSongsClicked(const bool checked); void GroupByClicked(QAction *action); void SetGroupBy(const CollectionModel::Grouping g); diff --git a/src/transcoder/transcoder.cpp b/src/transcoder/transcoder.cpp index 3b55fcef9..561b59694 100644 --- a/src/transcoder/transcoder.cpp +++ b/src/transcoder/transcoder.cpp @@ -350,7 +350,9 @@ Transcoder::StartJobStatus Transcoder::MaybeStartNextJob() { } -void Transcoder::NewPadCallback(GstElement*, GstPad *pad, gpointer data) { +void Transcoder::NewPadCallback(GstElement *element, GstPad *pad, gpointer data) { + + Q_UNUSED(element) JobState *state = reinterpret_cast(data); GstPad *const audiopad = gst_element_get_static_pad(state->convert_element_, "sink"); @@ -365,7 +367,9 @@ void Transcoder::NewPadCallback(GstElement*, GstPad *pad, gpointer data) { } -GstBusSyncReply Transcoder::BusCallbackSync(GstBus*, GstMessage *msg, gpointer data) { +GstBusSyncReply Transcoder::BusCallbackSync(GstBus *bus, GstMessage *msg, gpointer data) { + + Q_UNUSED(bus) JobState *state = reinterpret_cast(data); switch (GST_MESSAGE_TYPE(msg)) { diff --git a/src/transcoder/transcoder.h b/src/transcoder/transcoder.h index 31123718d..0d12cbd75 100644 --- a/src/transcoder/transcoder.h +++ b/src/transcoder/transcoder.h @@ -138,8 +138,8 @@ class Transcoder : public QObject { GstElement *CreateElementForMimeType(GstElementFactoryListType element_type, const QString &mime_type, GstElement *bin = nullptr); void SetElementProperties(const QString &name, GObject *object); - static void NewPadCallback(GstElement*, GstPad *pad, gpointer data); - static GstBusSyncReply BusCallbackSync(GstBus*, GstMessage *msg, gpointer data); + static void NewPadCallback(GstElement *element, GstPad *pad, gpointer data); + static GstBusSyncReply BusCallbackSync(GstBus *bus, GstMessage *msg, gpointer data); private: using JobStateList = QList>; diff --git a/src/widgets/busyindicator.cpp b/src/widgets/busyindicator.cpp index 23ea3f161..e896fd973 100644 --- a/src/widgets/busyindicator.cpp +++ b/src/widgets/busyindicator.cpp @@ -72,11 +72,13 @@ BusyIndicator::~BusyIndicator() { delete movie_; } -void BusyIndicator::showEvent(QShowEvent*) { +void BusyIndicator::showEvent(QShowEvent *e) { + Q_UNUSED(e) movie_->start(); } -void BusyIndicator::hideEvent(QHideEvent*) { +void BusyIndicator::hideEvent(QHideEvent *e) { + Q_UNUSED(e) movie_->stop(); } diff --git a/src/widgets/busyindicator.h b/src/widgets/busyindicator.h index 8e7007fe3..7e954e4ac 100644 --- a/src/widgets/busyindicator.h +++ b/src/widgets/busyindicator.h @@ -44,8 +44,8 @@ class BusyIndicator : public QWidget { void set_text(const QString &text); protected: - void showEvent(QShowEvent *event) override; - void hideEvent(QHideEvent *event) override; + void showEvent(QShowEvent *e) override; + void hideEvent(QHideEvent *e) override; private: void Init(const QString &text); diff --git a/src/widgets/fancytabwidget.cpp b/src/widgets/fancytabwidget.cpp index f5296196a..e208411c0 100644 --- a/src/widgets/fancytabwidget.cpp +++ b/src/widgets/fancytabwidget.cpp @@ -77,7 +77,7 @@ FancyTabWidget::FancyTabWidget(QWidget *parent) } -FancyTabWidget::~FancyTabWidget() {} +FancyTabWidget::~FancyTabWidget() = default; void FancyTabWidget::AddTab(QWidget *widget_view, const QString &name, const QIcon &icon, const QString &label) { diff --git a/src/widgets/favoritewidget.cpp b/src/widgets/favoritewidget.cpp index 8c5508bed..3dece562f 100644 --- a/src/widgets/favoritewidget.cpp +++ b/src/widgets/favoritewidget.cpp @@ -72,7 +72,9 @@ void FavoriteWidget::paintEvent(QPaintEvent *e) { } -void FavoriteWidget::mouseDoubleClickEvent(QMouseEvent*) { +void FavoriteWidget::mouseDoubleClickEvent(QMouseEvent *e) { + + Q_UNUSED(e) favorite_ = !favorite_; update(); diff --git a/src/widgets/favoritewidget.h b/src/widgets/favoritewidget.h index eb4318730..eb84d34ed 100644 --- a/src/widgets/favoritewidget.h +++ b/src/widgets/favoritewidget.h @@ -48,7 +48,7 @@ class FavoriteWidget : public QWidget { protected: void paintEvent(QPaintEvent *e) override; - void mouseDoubleClickEvent(QMouseEvent*) override; + void mouseDoubleClickEvent(QMouseEvent *e) override; private: // The playlist's id this widget belongs to diff --git a/src/widgets/freespacebar.cpp b/src/widgets/freespacebar.cpp index a7f720ef7..aa95b021c 100644 --- a/src/widgets/freespacebar.cpp +++ b/src/widgets/freespacebar.cpp @@ -80,7 +80,9 @@ QSize FreeSpaceBar::sizeHint() const { return QSize(150, kBarHeight + kLabelBoxPadding + fontMetrics().height()); } -void FreeSpaceBar::paintEvent(QPaintEvent*) { +void FreeSpaceBar::paintEvent(QPaintEvent *e) { + + Q_UNUSED(e) // Geometry QRect bar_rect(rect()); diff --git a/src/widgets/freespacebar.h b/src/widgets/freespacebar.h index 8d85a8d2b..cfc9a97f3 100644 --- a/src/widgets/freespacebar.h +++ b/src/widgets/freespacebar.h @@ -50,7 +50,7 @@ class FreeSpaceBar : public QWidget { QSize sizeHint() const override; protected: - void paintEvent(QPaintEvent*) override; + void paintEvent(QPaintEvent *e) override; private: struct Label { diff --git a/src/widgets/groupediconview.cpp b/src/widgets/groupediconview.cpp index 8d669a401..6ef5282fd 100644 --- a/src/widgets/groupediconview.cpp +++ b/src/widgets/groupediconview.cpp @@ -132,9 +132,13 @@ void GroupedIconView::rowsInserted(const QModelIndex &parent, int start, int end LayoutItems(); } -void GroupedIconView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList&) { - QListView::dataChanged(topLeft, bottomRight); +void GroupedIconView::dataChanged(const QModelIndex &top_left, const QModelIndex &bottom_right, const QList &roles) { + + Q_UNUSED(roles) + + QListView::dataChanged(top_left, bottom_right); LayoutItems(); + } void GroupedIconView::LayoutItems() { @@ -363,7 +367,9 @@ QRegion GroupedIconView::visualRegionForSelection(const QItemSelection &selectio } -QModelIndex GroupedIconView::moveCursor(CursorAction action, Qt::KeyboardModifiers) { +QModelIndex GroupedIconView::moveCursor(CursorAction action, const Qt::KeyboardModifiers keyboard_modifiers) { + + Q_UNUSED(keyboard_modifiers) if (model()->rowCount() == 0) { return QModelIndex(); diff --git a/src/widgets/groupediconview.h b/src/widgets/groupediconview.h index c1f117dc3..66e9530c1 100644 --- a/src/widgets/groupediconview.h +++ b/src/widgets/groupediconview.h @@ -76,7 +76,7 @@ class GroupedIconView : public QListView { void set_header_text(const QString &value) { header_text_ = value; } // QAbstractItemView - QModelIndex moveCursor(CursorAction action, Qt::KeyboardModifiers modifiers) override; + QModelIndex moveCursor(CursorAction action, const Qt::KeyboardModifiers keyboard_modifiers) override; void setModel(QAbstractItemModel *model) override; static void DrawHeader(QPainter *painter, const QRect rect, const QFont &font, const QPalette &palette, const QString &text); @@ -89,7 +89,7 @@ class GroupedIconView : public QListView { void resizeEvent(QResizeEvent *e) override; // QAbstractItemView - void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList& = QList()) override; + void dataChanged(const QModelIndex &top_left, const QModelIndex &bottom_right, const QList &roles = QList()) override; QModelIndex indexAt(const QPoint &p) const override; void rowsInserted(const QModelIndex &parent, int start, int end) override; void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override; diff --git a/src/widgets/multiloadingindicator.cpp b/src/widgets/multiloadingindicator.cpp index 5c6db849e..daec78e72 100644 --- a/src/widgets/multiloadingindicator.cpp +++ b/src/widgets/multiloadingindicator.cpp @@ -98,7 +98,9 @@ void MultiLoadingIndicator::UpdateText() { } -void MultiLoadingIndicator::paintEvent(QPaintEvent*) { +void MultiLoadingIndicator::paintEvent(QPaintEvent *e) { + + Q_UNUSED(e) QPainter p(this); diff --git a/src/widgets/multiloadingindicator.h b/src/widgets/multiloadingindicator.h index 04026cb99..bb14b2ba4 100644 --- a/src/widgets/multiloadingindicator.h +++ b/src/widgets/multiloadingindicator.h @@ -47,7 +47,7 @@ class MultiLoadingIndicator : public QWidget { void TaskCountChange(const int tasks); protected: - void paintEvent(QPaintEvent*) override; + void paintEvent(QPaintEvent *e) override; private Q_SLOTS: void UpdateText(); diff --git a/src/widgets/ratingwidget.cpp b/src/widgets/ratingwidget.cpp index e773071fa..48c282ade 100644 --- a/src/widgets/ratingwidget.cpp +++ b/src/widgets/ratingwidget.cpp @@ -128,7 +128,9 @@ void RatingWidget::set_rating(const float rating) { } -void RatingWidget::paintEvent(QPaintEvent*) { +void RatingWidget::paintEvent(QPaintEvent *e) { + + Q_UNUSED(e) QStylePainter p(this); @@ -161,7 +163,9 @@ void RatingWidget::mouseMoveEvent(QMouseEvent *e) { } -void RatingWidget::leaveEvent(QEvent*) { +void RatingWidget::leaveEvent(QEvent *e) { + + Q_UNUSED(e) hover_rating_ = -1.0; update(); diff --git a/src/widgets/ratingwidget.h b/src/widgets/ratingwidget.h index 3488ee376..3788153e2 100644 --- a/src/widgets/ratingwidget.h +++ b/src/widgets/ratingwidget.h @@ -62,7 +62,7 @@ class RatingWidget : public QWidget { void paintEvent(QPaintEvent*) override; void mousePressEvent(QMouseEvent *e) override; void mouseMoveEvent(QMouseEvent *e) override; - void leaveEvent(QEvent*) override; + void leaveEvent(QEvent *e) override; private: RatingPainter painter_; diff --git a/src/widgets/sliderslider.cpp b/src/widgets/sliderslider.cpp index 0ac07dac7..6dd357683 100644 --- a/src/widgets/sliderslider.cpp +++ b/src/widgets/sliderslider.cpp @@ -121,7 +121,9 @@ void SliderSlider::mousePressEvent(QMouseEvent *e) { } -void SliderSlider::mouseReleaseEvent(QMouseEvent*) { +void SliderSlider::mouseReleaseEvent(QMouseEvent *e) { + + Q_UNUSED(e) if (!outside_ && QSlider::value() != prev_value_) { Q_EMIT SliderReleased(value()); diff --git a/src/widgets/stretchheaderview.h b/src/widgets/stretchheaderview.h index a4f04081d..c130162c7 100644 --- a/src/widgets/stretchheaderview.h +++ b/src/widgets/stretchheaderview.h @@ -47,7 +47,7 @@ class StretchHeaderView : public QHeaderView { // Serialises the proportional and actual column widths. // Use these instead of QHeaderView::restoreState and QHeaderView::saveState to persist the proportional values directly and avoid floating point errors over time. - bool RestoreState(const QByteArray &sdata); + bool RestoreState(const QByteArray &state); QByteArray SaveState() const; QByteArray ResetState(); diff --git a/src/widgets/tracksliderpopup.cpp b/src/widgets/tracksliderpopup.cpp index 4b5c5141c..7e154be0a 100644 --- a/src/widgets/tracksliderpopup.cpp +++ b/src/widgets/tracksliderpopup.cpp @@ -75,7 +75,8 @@ void TrackSliderPopup::SetPopupPosition(const QPoint pos) { UpdatePosition(); } -void TrackSliderPopup::paintEvent(QPaintEvent*) { +void TrackSliderPopup::paintEvent(QPaintEvent *e) { + Q_UNUSED(e) QPainter p(this); p.drawPixmap(0, 0, pixmap_); } diff --git a/src/widgets/volumeslider.cpp b/src/widgets/volumeslider.cpp index 2b0ccaec8..9583c1775 100644 --- a/src/widgets/volumeslider.cpp +++ b/src/widgets/volumeslider.cpp @@ -94,7 +94,9 @@ void VolumeSlider::HandleWheel(const int delta) { } -void VolumeSlider::paintEvent(QPaintEvent*) { +void VolumeSlider::paintEvent(QPaintEvent *e) { + + Q_UNUSED(e) QPainter p(this); @@ -162,7 +164,8 @@ void VolumeSlider::slotAnimTimer() { } -void VolumeSlider::paletteChange(const QPalette&) { +void VolumeSlider::paletteChange(const QPalette &palette) { + Q_UNUSED(palette) generateGradient(); } @@ -229,7 +232,9 @@ void VolumeSlider::drawVolumeSliderHandle() { } -void VolumeSlider::enterEvent(QEnterEvent*) { +void VolumeSlider::enterEvent(QEnterEvent *e) { + + Q_UNUSED(e) anim_enter_ = true; anim_count_ = 0; @@ -238,7 +243,9 @@ void VolumeSlider::enterEvent(QEnterEvent*) { } -void VolumeSlider::leaveEvent(QEvent*) { +void VolumeSlider::leaveEvent(QEvent *e) { + + Q_UNUSED(e) // This can happen if you enter and leave the widget quickly if (anim_count_ == 0) anim_count_ = 1; diff --git a/src/widgets/volumeslider.h b/src/widgets/volumeslider.h index 2eaebbebd..022ccf564 100644 --- a/src/widgets/volumeslider.h +++ b/src/widgets/volumeslider.h @@ -48,12 +48,12 @@ class VolumeSlider : public SliderSlider { void HandleWheel(const int delta); protected: - void enterEvent(QEnterEvent*) override; - void leaveEvent(QEvent*) override; - void paintEvent(QPaintEvent*) override; - virtual void paletteChange(const QPalette&); - void slideEvent(QMouseEvent*) override; - void contextMenuEvent(QContextMenuEvent*) override; + void enterEvent(QEnterEvent *e) override; + void leaveEvent(QEvent *e) override; + void paintEvent(QPaintEvent *e) override; + virtual void paletteChange(const QPalette &palette); + void slideEvent(QMouseEvent *e) override; + void contextMenuEvent(QContextMenuEvent *e) override; void mousePressEvent(QMouseEvent*) override; void wheelEvent(QWheelEvent *e) override;