diff --git a/ext/gstmoodbar/gstfastspectrum.cpp b/ext/gstmoodbar/gstfastspectrum.cpp index 356576cf1..b447f9b8d 100644 --- a/ext/gstmoodbar/gstfastspectrum.cpp +++ b/ext/gstmoodbar/gstfastspectrum.cpp @@ -335,7 +335,7 @@ static void input_data_mixed_int16_max (const guint8 * _in, double * out, guint static gboolean gst_fastspectrum_setup (GstAudioFilter * base, const GstAudioInfo * info) { GstFastSpectrum *spectrum = GST_FASTSPECTRUM (base); - GstFastSpectrumInputData input_data = NULL; + GstFastSpectrumInputData input_data = nullptr; g_mutex_lock (&spectrum->lock); switch (GST_AUDIO_INFO_FORMAT (info)) { diff --git a/src/analyzer/blockanalyzer.cpp b/src/analyzer/blockanalyzer.cpp index ae187f5f2..64f35c35f 100644 --- a/src/analyzer/blockanalyzer.cpp +++ b/src/analyzer/blockanalyzer.cpp @@ -386,7 +386,7 @@ void BlockAnalyzer::drawBackground() { QPainter p(&background_); - if (p.paintEngine() == 0) return; + if (!p.paintEngine()) return; for (int x = 0; (uint)x < columns_; ++x) for (int y = 0; (uint)y < rows_; ++y) diff --git a/src/collection/collection.cpp b/src/collection/collection.cpp index ef04d0d73..acbe36597 100644 --- a/src/collection/collection.cpp +++ b/src/collection/collection.cpp @@ -119,8 +119,8 @@ void SCollection::Exit() { wait_for_exit_ << backend_ << watcher_; - disconnect(backend_, 0, watcher_, 0); - disconnect(watcher_, 0, backend_, 0); + disconnect(backend_, nullptr, watcher_, nullptr); + disconnect(watcher_, nullptr, backend_, nullptr); connect(backend_, SIGNAL(ExitFinished()), this, SLOT(ExitReceived())); connect(watcher_, SIGNAL(ExitFinished()), this, SLOT(ExitReceived())); @@ -132,7 +132,7 @@ void SCollection::Exit() { void SCollection::ExitReceived() { QObject *obj = static_cast(sender()); - disconnect(obj, 0, this, 0); + disconnect(obj, nullptr, this, nullptr); qLog(Debug) << obj << "successfully exited."; wait_for_exit_.removeAll(obj); if (wait_for_exit_.isEmpty()) emit ExitFinished(); diff --git a/src/collection/collectionfilterwidget.cpp b/src/collection/collectionfilterwidget.cpp index f5b1f647c..3b9aa69a5 100644 --- a/src/collection/collectionfilterwidget.cpp +++ b/src/collection/collectionfilterwidget.cpp @@ -155,7 +155,7 @@ QString CollectionFilterWidget::group_by(const int number) { return group_by() + void CollectionFilterWidget::UpdateGroupByActions() { if (group_by_group_) { - disconnect(group_by_group_, 0, 0, 0); + disconnect(group_by_group_, nullptr, nullptr, nullptr); delete group_by_group_; } @@ -264,11 +264,11 @@ void CollectionFilterWidget::FocusOnFilter(QKeyEvent *event) { void CollectionFilterWidget::SetCollectionModel(CollectionModel *model) { if (model_) { - disconnect(model_, 0, this, 0); - disconnect(model_, 0, group_by_dialog_.get(), 0); - disconnect(group_by_dialog_.get(), 0, model_, 0); + disconnect(model_, nullptr, this, nullptr); + disconnect(model_, nullptr, group_by_dialog_.get(), nullptr); + disconnect(group_by_dialog_.get(), nullptr, model_, nullptr); for (QAction *action : filter_ages_.keys()) { - disconnect(action, &QAction::triggered, model_, 0); + disconnect(action, &QAction::triggered, model_, nullptr); } } diff --git a/src/core/application.cpp b/src/core/application.cpp index 46f0102e9..c5b68cd07 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -278,7 +278,7 @@ void Application::Exit() { void Application::ExitReceived() { QObject *obj = static_cast(sender()); - disconnect(obj, 0, this, 0); + disconnect(obj, nullptr, this, nullptr); qLog(Debug) << obj << "successfully exited."; diff --git a/src/core/commandlineoptions.cpp b/src/core/commandlineoptions.cpp index b54ded8e5..d0bb0632d 100644 --- a/src/core/commandlineoptions.cpp +++ b/src/core/commandlineoptions.cpp @@ -118,34 +118,34 @@ void CommandlineOptions::RemoveArg(const QString &starts_with, int count) { bool CommandlineOptions::Parse() { static const struct option kOptions[] = { - {"help", no_argument, 0, 'h'}, - {"play", no_argument, 0, 'p'}, - {"play-pause", no_argument, 0, 't'}, - {"pause", no_argument, 0, 'u'}, - {"stop", no_argument, 0, 's'}, - {"stop-after-current", no_argument, 0, 'q'}, - {"previous", no_argument, 0, 'r'}, - {"next", no_argument, 0, 'f'}, - {"volume", required_argument, 0, 'v'}, - {"volume-up", no_argument, 0, VolumeUp}, - {"volume-down", no_argument, 0, VolumeDown}, - {"volume-increase-by", required_argument, 0, VolumeIncreaseBy}, - {"volume-decrease-by", required_argument, 0, VolumeDecreaseBy}, - {"seek-to", required_argument, 0, SeekTo}, - {"seek-by", required_argument, 0, SeekBy}, - {"restart-or-previous", no_argument, 0, RestartOrPrevious}, - {"create", required_argument, 0, 'c'}, - {"append", no_argument, 0, 'a'}, - {"load", no_argument, 0, 'l'}, - {"play-track", required_argument, 0, 'k'}, - {"show-osd", no_argument, 0, 'o'}, - {"toggle-pretty-osd", no_argument, 0, 'y'}, - {"language", required_argument, 0, 'g'}, - {"quiet", no_argument, 0, Quiet}, - {"verbose", no_argument, 0, Verbose}, - {"log-levels", required_argument, 0, LogLevels}, - {"version", no_argument, 0, Version}, - {0, 0, 0, 0}}; + {"help", no_argument, nullptr, 'h'}, + {"play", no_argument, nullptr, 'p'}, + {"play-pause", no_argument, nullptr, 't'}, + {"pause", no_argument, nullptr, 'u'}, + {"stop", no_argument, nullptr, 's'}, + {"stop-after-current", no_argument, nullptr, 'q'}, + {"previous", no_argument, nullptr, 'r'}, + {"next", no_argument, nullptr, 'f'}, + {"volume", required_argument, nullptr, 'v'}, + {"volume-up", no_argument, nullptr, VolumeUp}, + {"volume-down", no_argument, nullptr, VolumeDown}, + {"volume-increase-by", required_argument, nullptr, VolumeIncreaseBy}, + {"volume-decrease-by", required_argument, nullptr, VolumeDecreaseBy}, + {"seek-to", required_argument, nullptr, SeekTo}, + {"seek-by", required_argument, nullptr, SeekBy}, + {"restart-or-previous", no_argument, nullptr, RestartOrPrevious}, + {"create", required_argument, nullptr, 'c'}, + {"append", no_argument, nullptr, 'a'}, + {"load", no_argument, nullptr, 'l'}, + {"play-track", required_argument, nullptr, 'k'}, + {"show-osd", no_argument, nullptr, 'o'}, + {"toggle-pretty-osd", no_argument, nullptr, 'y'}, + {"language", required_argument, nullptr, 'g'}, + {"quiet", no_argument, nullptr, Quiet}, + {"verbose", no_argument, nullptr, Verbose}, + {"log-levels", required_argument, nullptr, LogLevels}, + {"version", no_argument, nullptr, Version}, + {nullptr, 0, nullptr, 0}}; // Parse the arguments bool ok = false; diff --git a/src/core/screensaver.cpp b/src/core/screensaver.cpp index d4a80a958..7395ab649 100644 --- a/src/core/screensaver.cpp +++ b/src/core/screensaver.cpp @@ -42,7 +42,7 @@ const char *Screensaver::kKdeService = "org.kde.ScreenSaver"; const char *Screensaver::kKdePath = "/ScreenSaver/"; const char *Screensaver::kKdeInterface = "org.freedesktop.ScreenSaver"; -Screensaver *Screensaver::screensaver_ = 0; +Screensaver *Screensaver::screensaver_ = nullptr; Screensaver *Screensaver::GetScreensaver() { if (!screensaver_) { diff --git a/src/core/utilities.cpp b/src/core/utilities.cpp index 97743af32..2dbe4421d 100644 --- a/src/core/utilities.cpp +++ b/src/core/utilities.cpp @@ -657,7 +657,7 @@ const char *EnumToString(const QMetaObject &meta, const char *name, int value) { if (index == -1) return "[UnknownEnum]"; QMetaEnum metaenum = meta.enumerator(index); const char *result = metaenum.valueToKey(value); - if (result == 0) return "[UnknownEnumValue]"; + if (!result) return "[UnknownEnumValue]"; return result; } diff --git a/src/covermanager/albumcoverloader.cpp b/src/covermanager/albumcoverloader.cpp index 51486868b..08f8729fb 100644 --- a/src/covermanager/albumcoverloader.cpp +++ b/src/covermanager/albumcoverloader.cpp @@ -416,7 +416,7 @@ void AlbumCoverLoader::RemoteFetchFinished(QNetworkReply *reply, const QUrl &cov if (reply->error() == QNetworkReply::NoError) { // Try to load the image QImage image; - if (image.load(reply, 0)) { + if (image.load(reply, nullptr)) { QPair images = ScaleAndPad(task.options, image); emit AlbumCoverLoaded(task.id, AlbumCoverLoaderResult(task.type, cover_url, image, images.first, images.second, task.art_updated)); return; diff --git a/src/device/devicemanager.cpp b/src/device/devicemanager.cpp index 1a35ab3ad..c12a3e971 100644 --- a/src/device/devicemanager.cpp +++ b/src/device/devicemanager.cpp @@ -206,7 +206,7 @@ void DeviceManager::CloseBackend() { void DeviceManager::BackendClosed() { QObject *obj = static_cast(sender()); - disconnect(obj, 0, this, 0); + disconnect(obj, nullptr, this, nullptr); qLog(Debug) << obj << "successfully closed."; wait_for_exit_.removeAll(obj); if (wait_for_exit_.isEmpty()) emit ExitFinished(); @@ -218,7 +218,7 @@ void DeviceManager::ListerClosed() { DeviceLister *lister = static_cast(sender()); if (!lister) return; - disconnect(lister, 0, this, 0); + disconnect(lister, nullptr, this, nullptr); qLog(Debug) << lister << "successfully closed."; wait_for_exit_.removeAll(lister); diff --git a/src/device/filesystemdevice.cpp b/src/device/filesystemdevice.cpp index 80425b672..95c8091f4 100644 --- a/src/device/filesystemdevice.cpp +++ b/src/device/filesystemdevice.cpp @@ -93,8 +93,8 @@ void FilesystemDevice::Close() { wait_for_exit_ << backend_ << watcher_; - disconnect(backend_, 0, watcher_, 0); - disconnect(watcher_, 0, backend_, 0); + disconnect(backend_, nullptr, watcher_, nullptr); + disconnect(watcher_, nullptr, backend_, nullptr); connect(backend_, SIGNAL(ExitFinished()), this, SLOT(ExitFinished())); connect(watcher_, SIGNAL(ExitFinished()), this, SLOT(ExitFinished())); @@ -107,7 +107,7 @@ void FilesystemDevice::ExitFinished() { QObject *obj = static_cast(sender()); if (!obj) return; - disconnect(obj, 0, this, 0); + disconnect(obj, nullptr, this, nullptr); qLog(Debug) << obj << "successfully exited."; wait_for_exit_.removeAll(obj); if (wait_for_exit_.isEmpty()) { diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index 0944701d0..79b77b9a3 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -211,7 +211,7 @@ void GstEngine::Stop(const bool stop_after) { // Check if we started a fade out. If it isn't finished yet and the user pressed stop, we cancel the fader and just stop the playback. if (is_fading_out_to_pause_) { - disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), 0, 0); + disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), nullptr, nullptr); is_fading_out_to_pause_ = false; has_faded_out_ = true; @@ -233,7 +233,7 @@ void GstEngine::Pause() { // Check if we started a fade out. If it isn't finished yet and the user pressed play, we inverse the fader and resume the playback. if (is_fading_out_to_pause_) { - disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), 0, 0); + disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), nullptr, nullptr); current_pipeline_->StartFader(fadeout_pause_duration_nanosec_, QTimeLine::Forward, QTimeLine::EaseInOutCurve, false); is_fading_out_to_pause_ = false; has_faded_out_ = false; @@ -264,7 +264,7 @@ void GstEngine::Unpause() { // Check if we faded out last time. If yes, fade in no matter what the settings say. // If we pause with fadeout, deactivate fadeout and resume playback, the player would be muted if not faded in. if (has_faded_out_) { - disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), 0, 0); + disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), nullptr, nullptr); current_pipeline_->StartFader(fadeout_pause_duration_nanosec_, QTimeLine::Forward, QTimeLine::EaseInOutCurve, false); has_faded_out_ = false; } @@ -713,7 +713,7 @@ void GstEngine::StartFadeout() { if (is_fading_out_to_pause_) return; fadeout_pipeline_ = current_pipeline_; - disconnect(fadeout_pipeline_.get(), 0, 0, 0); + disconnect(fadeout_pipeline_.get(), nullptr, nullptr, nullptr); fadeout_pipeline_->RemoveAllBufferConsumers(); fadeout_pipeline_->StartFader(fadeout_duration_nanosec_, QTimeLine::Backward); @@ -724,7 +724,7 @@ void GstEngine::StartFadeout() { void GstEngine::StartFadeoutPause() { fadeout_pause_pipeline_ = current_pipeline_; - disconnect(fadeout_pause_pipeline_.get(), SIGNAL(FaderFinished()), 0, 0); + disconnect(fadeout_pause_pipeline_.get(), SIGNAL(FaderFinished()), nullptr, nullptr); fadeout_pause_pipeline_->StartFader(fadeout_pause_duration_nanosec_, QTimeLine::Backward, QTimeLine::EaseInOutCurve, false); if (fadeout_pipeline_ && fadeout_pipeline_->state() == GST_STATE_PLAYING) { diff --git a/src/internet/internetservices.cpp b/src/internet/internetservices.cpp index 2445cf872..7feee410d 100644 --- a/src/internet/internetservices.cpp +++ b/src/internet/internetservices.cpp @@ -54,7 +54,7 @@ void InternetServices::RemoveService(InternetService *service) { if (!services_.contains(service->source())) return; services_.remove(service->source()); - disconnect(service, 0, this, 0); + disconnect(service, nullptr, this, nullptr); qLog(Debug) << "Removed internet service" << service->name(); diff --git a/src/organise/organiseerrordialog.cpp b/src/organise/organiseerrordialog.cpp index 05e73e085..8d031e3c4 100644 --- a/src/organise/organiseerrordialog.cpp +++ b/src/organise/organiseerrordialog.cpp @@ -40,8 +40,8 @@ OrganiseErrorDialog::OrganiseErrorDialog(QWidget *parent) : QDialog(parent), ui_ ui_->setupUi(this); - const int icon_size = style()->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, this); - QIcon icon = style()->standardIcon(QStyle::SP_MessageBoxCritical, 0, this); + const int icon_size = style()->pixelMetric(QStyle::PM_MessageBoxIconSize, nullptr, this); + QIcon icon = style()->standardIcon(QStyle::SP_MessageBoxCritical, nullptr, this); ui_->icon->setPixmap(icon.pixmap(icon_size)); diff --git a/src/playlist/playlisttabbar.cpp b/src/playlist/playlisttabbar.cpp index 9a9d94b48..75ec31ad2 100644 --- a/src/playlist/playlisttabbar.cpp +++ b/src/playlist/playlisttabbar.cpp @@ -88,8 +88,8 @@ PlaylistTabBar::PlaylistTabBar(QWidget *parent) void PlaylistTabBar::SetActions(QAction *new_playlist, QAction *load_playlist) { - menu_->insertAction(0, new_playlist); - menu_->insertAction(0, load_playlist); + menu_->insertAction(nullptr, new_playlist); + menu_->insertAction(nullptr, load_playlist); new_ = new_playlist; diff --git a/src/playlist/playlistundocommands.cpp b/src/playlist/playlistundocommands.cpp index b665c8e03..00b19c686 100644 --- a/src/playlist/playlistundocommands.cpp +++ b/src/playlist/playlistundocommands.cpp @@ -34,8 +34,7 @@ namespace PlaylistUndoCommands { -Base::Base(Playlist* playlist) : QUndoCommand(0), playlist_(playlist) {} - +Base::Base(Playlist* playlist) : QUndoCommand(nullptr), playlist_(playlist) {} InsertItems::InsertItems(Playlist *playlist, const PlaylistItemList &items, int pos, bool enqueue, bool enqueue_next) : Base(playlist), diff --git a/src/scrobbler/scrobblerservices.cpp b/src/scrobbler/scrobblerservices.cpp index e6e973f3c..56448d36c 100644 --- a/src/scrobbler/scrobblerservices.cpp +++ b/src/scrobbler/scrobblerservices.cpp @@ -57,7 +57,7 @@ void ScrobblerServices::RemoveService(ScrobblerService *service) { { QMutexLocker locker(&mutex_); scrobbler_services_.remove(service->name()); - disconnect(service, 0, this, 0); + disconnect(service, nullptr, this, nullptr); } qLog(Debug) << "Unregistered scrobbler service" << service->name(); diff --git a/src/tidal/tidalrequest.cpp b/src/tidal/tidalrequest.cpp index 5b6c2c207..a8e460da1 100644 --- a/src/tidal/tidalrequest.cpp +++ b/src/tidal/tidalrequest.cpp @@ -737,10 +737,10 @@ void TidalRequest::SongsReplyReceived(QNetworkReply *reply, const int limit_requ --songs_requests_active_; if (type_ == QueryType_SearchSongs && fetchalbums_) { - AlbumsReceived(reply, 0, limit_requested, offset_requested, (offset_requested == 0)); + AlbumsReceived(reply, QString(), limit_requested, offset_requested, (offset_requested == 0)); } else { - SongsReceived(reply, 0, 0, limit_requested, offset_requested, (offset_requested == 0)); + SongsReceived(reply, QString(), QString(), limit_requested, offset_requested, (offset_requested == 0)); } } diff --git a/src/widgets/fancytabwidget.cpp b/src/widgets/fancytabwidget.cpp index c5a91560a..0cd711e57 100644 --- a/src/widgets/fancytabwidget.cpp +++ b/src/widgets/fancytabwidget.cpp @@ -68,7 +68,7 @@ class FancyTabBar: public QTabBar { QMap spacers; public: - explicit FancyTabBar(QWidget* parent=0) : QTabBar(parent) { + explicit FancyTabBar(QWidget *parent = nullptr) : QTabBar(parent) { setMouseTracking(true); }