From 93af86618579e9484d4418b8b1d82c9ef7e3e4e8 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 8 Dec 2025 23:49:48 +0100 Subject: [PATCH] Formatting --- 3rdparty/discord-rpc/discord_connection.h | 2 +- .../discord-rpc/discord_connection_unix.cpp | 6 +- .../discord-rpc/discord_connection_win.cpp | 12 +- 3rdparty/discord-rpc/discord_msg_queue.h | 6 +- 3rdparty/discord-rpc/discord_register_win.cpp | 1 - 3rdparty/discord-rpc/discord_rpc.cpp | 68 ++++----- 3rdparty/discord-rpc/discord_rpc_connection.h | 12 +- src/analyzer/analyzerbase.cpp | 2 +- src/analyzer/analyzerbase.h | 3 +- src/analyzer/analyzercontainer.cpp | 2 +- src/analyzer/analyzercontainer.h | 2 +- src/analyzer/blockanalyzer.cpp | 6 +- src/analyzer/blockanalyzer.h | 2 +- src/analyzer/boomanalyzer.cpp | 4 +- src/analyzer/boomanalyzer.h | 2 +- src/analyzer/fht.cpp | 2 +- src/analyzer/fht.h | 10 +- src/analyzer/rainbowanalyzer.cpp | 2 +- src/analyzer/rainbowanalyzer.h | 6 +- src/analyzer/sonogramanalyzer.h | 2 +- src/analyzer/turbineanalyzer.cpp | 4 +- src/analyzer/turbineanalyzer.h | 2 +- src/analyzer/waverubberanalyzer.h | 2 +- src/collection/collectionbackend.h | 1 - src/collection/collectionfilterwidget.h | 1 - src/collection/collectionplaylistitem.h | 1 - src/collection/collectionquery.cpp | 6 +- src/constants/appearancesettings.h | 34 ++--- src/constants/backendsettings.h | 34 ++--- src/constants/behavioursettings.h | 34 ++--- src/constants/collectionsettings.h | 34 ++--- src/constants/contextsettings.h | 34 ++--- src/constants/coverssettings.h | 34 ++--- src/constants/filefilterconstants.h | 34 ++--- src/constants/filenameconstants.h | 34 ++--- src/constants/filesystemconstants.h | 34 ++--- src/constants/globalshortcutssettings.h | 34 ++--- src/constants/lyricssettings.h | 34 ++--- src/constants/mainwindowsettings.h | 34 ++--- src/constants/moodbarsettings.h | 34 ++--- src/constants/networkproxysettings.h | 34 ++--- src/constants/notificationssettings.h | 34 ++--- src/constants/playlistsettings.h | 34 ++--- src/constants/qobuzsettings.h | 34 ++--- src/constants/scrobblersettings.h | 34 ++--- src/constants/spotifysettings.h | 34 ++--- src/constants/subsonicsettings.h | 34 ++--- src/constants/tidalsettings.h | 34 ++--- src/constants/timeconstants.h | 34 ++--- src/constants/transcodersettings.h | 35 +++-- src/core/application.cpp | 6 +- src/core/database.cpp | 11 +- src/core/enginemetadata.cpp | 34 ++--- src/core/enginemetadata.h | 34 ++--- src/core/httpbaserequest.cpp | 4 +- src/core/localredirectserver.cpp | 6 +- src/core/logging.cpp | 4 +- src/core/logging.h | 8 +- src/core/memorydatabase.cpp | 2 +- src/core/mimedata.cpp | 14 +- src/core/musicstorage.h | 2 +- src/core/scoped_nsautorelease_pool.h | 2 +- src/core/simpletreemodel.h | 2 +- src/core/song.cpp | 83 ++++++----- src/core/songloader.cpp | 5 +- src/core/songmimedata.h | 1 - src/core/stylehelper.cpp | 18 +-- src/core/thread.cpp | 2 +- src/core/thread.h | 2 +- src/core/urlhandler.cpp | 1 - .../albumcoverchoicecontroller.cpp | 8 +- src/covermanager/albumcoverexporter.h | 1 - src/covermanager/albumcoverimageresult.h | 8 +- src/covermanager/albumcoverloaderoptions.cpp | 34 ++--- src/covermanager/albumcoverloaderresult.h | 14 +- src/covermanager/albumcovermanager.cpp | 11 +- .../coversearchstatisticsdialog.cpp | 30 ++-- src/covermanager/musixmatchcoverprovider.cpp | 2 +- src/device/cddadevice.cpp | 1 - src/device/devicedatabasebackend.cpp | 13 +- src/device/gpoddevice.h | 2 +- src/device/mtpconnection.cpp | 2 +- src/device/udisks2lister.cpp | 5 +- src/dialogs/saveplaylistsdialog.h | 2 +- src/engine/ebur128analysis.cpp | 9 +- src/engine/enginebase.h | 16 +-- src/engine/enginedevice.cpp | 34 ++--- src/engine/enginedevice.h | 34 ++--- src/engine/gstengine.cpp | 45 +++--- src/engine/gstengine.h | 40 +++--- src/engine/gstfastspectrum.cpp | 2 +- src/engine/pulsedevicefinder.cpp | 1 - src/equalizer/equalizer.h | 4 +- src/equalizer/equalizerslider.cpp | 1 - .../filterparserinteqcomparator.h | 1 - .../filterparserintgecomparator.h | 1 - .../filterparserintnecomparator.h | 1 - src/includes/lazy.h | 6 +- src/includes/scoped_ptr.h | 2 +- src/lyrics/htmllyricsprovider.cpp | 6 +- src/lyrics/lyricfindlyricsprovider.cpp | 2 +- src/lyrics/lyricssearchrequest.h | 34 ++--- src/lyrics/lyricssearchresult.h | 34 ++--- src/lyrics/ovhlyricsprovider.cpp | 2 +- src/lyrics/ovhlyricsprovider.h | 2 +- src/main.cpp | 2 +- src/mpris2/mpris2.cpp | 2 +- src/musicbrainz/musicbrainzclient.cpp | 1 - src/musicbrainz/musicbrainzclient.h | 2 +- src/organize/organizeformat.h | 2 +- src/osd/osddbus.cpp | 1 - src/playlist/playlistcontainer.cpp | 2 +- src/playlist/playlistlistsortfiltermodel.cpp | 14 +- src/playlist/playlistlistview.cpp | 2 +- src/playlist/playlistsequence.cpp | 4 +- src/playlist/playlisttabbar.cpp | 11 +- src/qobuz/qobuzrequest.cpp | 16 +-- src/qobuz/qobuzservice.cpp | 4 +- src/radios/radioview.cpp | 1 - src/scrobbler/lastfmimport.cpp | 2 +- src/scrobbler/lastfmscrobbler.cpp | 12 +- src/scrobbler/scrobblemetadata.cpp | 34 ++--- src/scrobbler/scrobblemetadata.h | 34 ++--- src/scrobbler/scrobblercache.cpp | 6 +- src/settings/appearancesettingspage.cpp | 1 - src/settings/behavioursettingspage.cpp | 5 +- src/settings/settingspage.cpp | 1 - src/settings/subsonicsettingspage.cpp | 2 +- ...smartplaylistquerywizardpluginsortpage.cpp | 2 +- src/smartplaylists/smartplaylistsearch.cpp | 2 +- .../smartplaylistwizardfinishpage.h | 1 - .../smartplaylistwizardtypepage.h | 1 - src/spotify/spotifyrequest.cpp | 40 +++--- src/spotify/spotifyservice.cpp | 2 +- src/streaming/streamingservices.h | 2 +- src/streaming/streamingtabsview.h | 2 +- src/subsonic/subsonicbaserequest.cpp | 4 +- src/subsonic/subsonicrequest.cpp | 18 +-- src/subsonic/subsonicservice.cpp | 4 +- src/systemtrayicon/macsystemtrayicon.h | 2 +- src/systemtrayicon/qtsystemtrayicon.cpp | 4 +- src/tidal/tidalrequest.cpp | 42 +++--- src/tidal/tidalservice.cpp | 2 +- src/tidal/tidalstreamurlrequest.h | 2 +- src/utilities/colorutils.cpp | 6 +- src/utilities/coveroptions.cpp | 34 ++--- src/utilities/coveroptions.h | 34 ++--- src/utilities/sqlhelper.h | 28 ++-- src/widgets/autoexpandingtreeview.cpp | 2 +- src/widgets/clickablelabel.cpp | 2 +- src/widgets/clickablelabel.h | 2 +- src/widgets/fancytabbar.cpp | 8 +- src/widgets/fancytabwidget.cpp | 2 +- src/widgets/forcescrollperpixel.cpp | 2 +- src/widgets/groupediconview.cpp | 8 +- src/widgets/loginstatewidget.cpp | 2 +- src/widgets/loginstatewidget.h | 2 +- src/widgets/playingwidget.cpp | 2 +- src/widgets/prettyslider.cpp | 30 ++-- src/widgets/prettyslider.h | 30 ++-- src/widgets/renametablineedit.cpp | 4 +- src/widgets/searchfield_qt_private.cpp | 2 +- src/widgets/sliderslider.cpp | 30 ++-- src/widgets/sliderslider.h | 30 ++-- src/widgets/volumeslider.cpp | 30 ++-- src/widgets/volumeslider.h | 30 ++-- tests/src/collectionbackend_test.cpp | 2 +- tests/src/collectionmodel_test.cpp | 6 +- tests/src/concurrentrun_test.cpp | 14 +- tests/src/main.cpp | 2 +- tests/src/mergedproxymodel_test.cpp | 4 +- tests/src/mock_networkaccessmanager.cpp | 16 +-- tests/src/mock_networkaccessmanager.h | 6 +- tests/src/organizeformat_test.cpp | 2 +- tests/src/playlist_test.cpp | 24 ++-- tests/src/songplaylistitem_test.cpp | 6 +- tests/src/tagreader_test.cpp | 130 +++++++++--------- tests/src/test_utils.cpp | 10 +- tests/src/test_utils.h | 20 +-- 179 files changed, 1187 insertions(+), 1269 deletions(-) diff --git a/3rdparty/discord-rpc/discord_connection.h b/3rdparty/discord-rpc/discord_connection.h index 6a1edf30c..a8bfbec8c 100644 --- a/3rdparty/discord-rpc/discord_connection.h +++ b/3rdparty/discord-rpc/discord_connection.h @@ -35,7 +35,7 @@ int GetProcessId(); struct BaseConnection { static BaseConnection *Create(); - static void Destroy(BaseConnection *&); + static void Destroy(BaseConnection*&); bool isOpen = false; bool Open(); bool Close(); diff --git a/3rdparty/discord-rpc/discord_connection_unix.cpp b/3rdparty/discord-rpc/discord_connection_unix.cpp index 7ef6d55d6..3fd3fbd74 100644 --- a/3rdparty/discord-rpc/discord_connection_unix.cpp +++ b/3rdparty/discord-rpc/discord_connection_unix.cpp @@ -39,11 +39,11 @@ int GetProcessId() { } struct BaseConnectionUnix : public BaseConnection { - int sock { -1 }; + int sock{ -1 }; }; static BaseConnectionUnix Connection; -static sockaddr_un PipeAddr {}; +static sockaddr_un PipeAddr{}; #ifdef MSG_NOSIGNAL static int MsgFlags = MSG_NOSIGNAL; #else @@ -105,7 +105,7 @@ bool BaseConnection::Open() { bool BaseConnection::Close() { - auto self = reinterpret_cast(this); + auto self = reinterpret_cast(this); if (self->sock == -1) { return false; } diff --git a/3rdparty/discord-rpc/discord_connection_win.cpp b/3rdparty/discord-rpc/discord_connection_win.cpp index 187eedf50..f85792bba 100644 --- a/3rdparty/discord-rpc/discord_connection_win.cpp +++ b/3rdparty/discord-rpc/discord_connection_win.cpp @@ -38,7 +38,7 @@ int GetProcessId() { } struct BaseConnectionWin : public BaseConnection { - HANDLE pipe { INVALID_HANDLE_VALUE }; + HANDLE pipe{ INVALID_HANDLE_VALUE }; }; static BaseConnectionWin Connection; @@ -57,10 +57,10 @@ void BaseConnection::Destroy(BaseConnection *&c) { bool BaseConnection::Open() { - wchar_t pipeName[] { L"\\\\?\\pipe\\discord-ipc-0" }; + wchar_t pipeName[]{ L"\\\\?\\pipe\\discord-ipc-0" }; const size_t pipeDigit = sizeof(pipeName) / sizeof(wchar_t) - 2; pipeName[pipeDigit] = L'0'; - auto self = reinterpret_cast(this); + auto self = reinterpret_cast(this); for (;;) { self->pipe = ::CreateFileW(pipeName, GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr); if (self->pipe != INVALID_HANDLE_VALUE) { @@ -88,7 +88,7 @@ bool BaseConnection::Open() { bool BaseConnection::Close() { - auto self = reinterpret_cast(this); + auto self = reinterpret_cast(this); ::CloseHandle(self->pipe); self->pipe = INVALID_HANDLE_VALUE; self->isOpen = false; @@ -102,7 +102,7 @@ bool BaseConnection::Write(const void *data, size_t length) { if (length == 0) { return true; } - auto self = reinterpret_cast(this); + auto self = reinterpret_cast(this); assert(self); if (!self) { return false; @@ -127,7 +127,7 @@ bool BaseConnection::Read(void *data, size_t length) { if (!data) { return false; } - auto self = reinterpret_cast(this); + auto self = reinterpret_cast(this); assert(self); if (!self) { return false; diff --git a/3rdparty/discord-rpc/discord_msg_queue.h b/3rdparty/discord-rpc/discord_msg_queue.h index f13da800a..07054d681 100644 --- a/3rdparty/discord-rpc/discord_msg_queue.h +++ b/3rdparty/discord-rpc/discord_msg_queue.h @@ -34,9 +34,9 @@ namespace discord_rpc { template class MsgQueue { ElementType queue_[QueueSize]; - std::atomic_uint nextAdd_ { 0 }; - std::atomic_uint nextSend_ { 0 }; - std::atomic_uint pendingSends_ { 0 }; + std::atomic_uint nextAdd_{ 0 }; + std::atomic_uint nextSend_{ 0 }; + std::atomic_uint pendingSends_{ 0 }; public: MsgQueue() {} diff --git a/3rdparty/discord-rpc/discord_register_win.cpp b/3rdparty/discord-rpc/discord_register_win.cpp index be177b6b7..7503f13fe 100644 --- a/3rdparty/discord-rpc/discord_register_win.cpp +++ b/3rdparty/discord-rpc/discord_register_win.cpp @@ -163,4 +163,3 @@ extern "C" void Discord_Register(const char *applicationId, const char *command) Discord_RegisterW(appId, wcommand); } - diff --git a/3rdparty/discord-rpc/discord_rpc.cpp b/3rdparty/discord-rpc/discord_rpc.cpp index 989acc8ff..84153be42 100644 --- a/3rdparty/discord-rpc/discord_rpc.cpp +++ b/3rdparty/discord-rpc/discord_rpc.cpp @@ -40,9 +40,9 @@ static void Discord_UpdateConnection(); namespace { -constexpr size_t MaxMessageSize { 16 * 1024 }; -constexpr size_t MessageQueueSize { 8 }; -constexpr size_t JoinQueueSize { 8 }; +constexpr size_t MaxMessageSize{ 16 * 1024 }; +constexpr size_t MessageQueueSize{ 8 }; +constexpr size_t JoinQueueSize{ 8 }; struct QueuedMessage { size_t length; @@ -70,24 +70,24 @@ struct User { // Rounded way up because I'm paranoid about games breaking from future changes in these sizes }; -static RpcConnection *Connection { nullptr }; -static DiscordEventHandlers QueuedHandlers {}; -static DiscordEventHandlers Handlers {}; -static std::atomic_bool WasJustConnected { false }; -static std::atomic_bool WasJustDisconnected { false }; -static std::atomic_bool GotErrorMessage { false }; -static std::atomic_bool WasJoinGame { false }; -static std::atomic_bool WasSpectateGame { false }; -static std::atomic_bool UpdatePresence { false }; +static RpcConnection *Connection{ nullptr }; +static DiscordEventHandlers QueuedHandlers{}; +static DiscordEventHandlers Handlers{}; +static std::atomic_bool WasJustConnected{ false }; +static std::atomic_bool WasJustDisconnected{ false }; +static std::atomic_bool GotErrorMessage{ false }; +static std::atomic_bool WasJoinGame{ false }; +static std::atomic_bool WasSpectateGame{ false }; +static std::atomic_bool UpdatePresence{ false }; static char JoinGameSecret[256]; static char SpectateGameSecret[256]; -static int LastErrorCode { 0 }; +static int LastErrorCode{ 0 }; static char LastErrorMessage[256]; -static int LastDisconnectErrorCode { 0 }; +static int LastDisconnectErrorCode{ 0 }; static char LastDisconnectErrorMessage[256]; static std::mutex PresenceMutex; static std::mutex HandlerMutex; -static QueuedMessage QueuedPresence {}; +static QueuedMessage QueuedPresence{}; static MsgQueue SendQueue; static MsgQueue JoinAskQueue; static User connectedUser; @@ -95,12 +95,12 @@ static User connectedUser; // We want to auto connect, and retry on failure, but not as fast as possible. This does expoential backoff from 0.5 seconds to 1 minute static Backoff ReconnectTimeMs(500, 60 * 1000); static auto NextConnect = std::chrono::system_clock::now(); -static int Pid { 0 }; -static int Nonce { 1 }; +static int Pid{ 0 }; +static int Nonce{ 1 }; class IoThreadHolder { private: - std::atomic_bool keepRunning { true }; + std::atomic_bool keepRunning{ true }; std::mutex waitForIOMutex; std::condition_variable waitForIOActivity; std::thread ioThread; @@ -109,14 +109,14 @@ class IoThreadHolder { void Start() { keepRunning.store(true); ioThread = std::thread([&]() { - const std::chrono::duration maxWait { 500LL }; - Discord_UpdateConnection(); - while (keepRunning.load()) { - std::unique_lock lock(waitForIOMutex); - waitForIOActivity.wait_for(lock, maxWait); + const std::chrono::duration maxWait { 500LL }; Discord_UpdateConnection(); - } - }); + while (keepRunning.load()) { + std::unique_lock lock(waitForIOMutex); + waitForIOActivity.wait_for(lock, maxWait); + Discord_UpdateConnection(); + } + }); } void Notify() { waitForIOActivity.notify_all(); } @@ -132,7 +132,7 @@ class IoThreadHolder { ~IoThreadHolder() { Stop(); } }; -static IoThreadHolder *IoThread { nullptr }; +static IoThreadHolder *IoThread{ nullptr }; static void UpdateReconnectTime() { @@ -429,7 +429,7 @@ extern "C" void Discord_RunCallbacks() { if (WasJustConnected.exchange(false)) { std::lock_guard guard(HandlerMutex); if (Handlers.ready) { - DiscordUser du { connectedUser.userId, connectedUser.username, connectedUser.discriminator, connectedUser.avatar }; + DiscordUser du{ connectedUser.userId, connectedUser.username, connectedUser.discriminator, connectedUser.avatar }; Handlers.ready(&du); } } @@ -465,7 +465,7 @@ extern "C" void Discord_RunCallbacks() { { std::lock_guard guard(HandlerMutex); if (Handlers.joinRequest) { - DiscordUser du { req->userId, req->username, req->discriminator, req->avatar }; + DiscordUser du{ req->userId, req->username, req->discriminator, req->avatar }; Handlers.joinRequest(&du); } } @@ -486,12 +486,12 @@ extern "C" void Discord_UpdateHandlers(DiscordEventHandlers *newHandlers) { if (newHandlers) { #define HANDLE_EVENT_REGISTRATION(handler_name, event) \ - if (!Handlers.handler_name && newHandlers->handler_name) { \ - RegisterForEvent(event); \ - } \ - else if (Handlers.handler_name && !newHandlers->handler_name) { \ - DeregisterForEvent(event); \ - } + if (!Handlers.handler_name && newHandlers->handler_name) { \ + RegisterForEvent(event); \ + } \ + else if (Handlers.handler_name && !newHandlers->handler_name) { \ + DeregisterForEvent(event); \ + } std::lock_guard guard(HandlerMutex); HANDLE_EVENT_REGISTRATION(joinGame, "ACTIVITY_JOIN") diff --git a/3rdparty/discord-rpc/discord_rpc_connection.h b/3rdparty/discord-rpc/discord_rpc_connection.h index 550c8aea5..e5cbe9da2 100644 --- a/3rdparty/discord-rpc/discord_rpc_connection.h +++ b/3rdparty/discord-rpc/discord_rpc_connection.h @@ -63,17 +63,17 @@ struct RpcConnection { Connected, }; - BaseConnection *connection { nullptr }; - State state { State::Disconnected }; + BaseConnection *connection{ nullptr }; + State state{ State::Disconnected }; void (*onConnect)(JsonDocument &message) { nullptr }; void (*onDisconnect)(int errorCode, const char *message) { nullptr }; - char appId[64] {}; - int lastErrorCode { 0 }; - char lastErrorMessage[256] {}; + char appId[64]{}; + int lastErrorCode{ 0 }; + char lastErrorMessage[256]{}; RpcConnection::MessageFrame sendFrame; static RpcConnection *Create(const char *applicationId); - static void Destroy(RpcConnection *&); + static void Destroy(RpcConnection*&); inline bool IsOpen() const { return state == State::Connected; } diff --git a/src/analyzer/analyzerbase.cpp b/src/analyzer/analyzerbase.cpp index 91596563a..4ca64e440 100644 --- a/src/analyzer/analyzerbase.cpp +++ b/src/analyzer/analyzerbase.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include "config.h" diff --git a/src/analyzer/analyzerbase.h b/src/analyzer/analyzerbase.h index ecede3bd4..218a6b7f1 100644 --- a/src/analyzer/analyzerbase.h +++ b/src/analyzer/analyzerbase.h @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef ANALYZERBASE_H #define ANALYZERBASE_H @@ -90,4 +90,3 @@ class AnalyzerBase : public QWidget { }; #endif // ANALYZERBASE_H - diff --git a/src/analyzer/analyzercontainer.cpp b/src/analyzer/analyzercontainer.cpp index ad25ad68e..bd4fbff99 100644 --- a/src/analyzer/analyzercontainer.cpp +++ b/src/analyzer/analyzercontainer.cpp @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include "config.h" diff --git a/src/analyzer/analyzercontainer.h b/src/analyzer/analyzercontainer.h index 20f36eafa..342b0ab1f 100644 --- a/src/analyzer/analyzercontainer.h +++ b/src/analyzer/analyzercontainer.h @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef ANALYZERCONTAINER_H #define ANALYZERCONTAINER_H diff --git a/src/analyzer/blockanalyzer.cpp b/src/analyzer/blockanalyzer.cpp index 5d61f88ec..55c7c409d 100644 --- a/src/analyzer/blockanalyzer.cpp +++ b/src/analyzer/blockanalyzer.cpp @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include "blockanalyzer.h" @@ -61,7 +61,7 @@ BlockAnalyzer::BlockAnalyzer(QWidget *parent) fade_intensity_(1 << 8, 32), step_(0) { - setMinimumSize(kMinColumns * (kWidth + 1) - 1, kMinRows * (kHeight + 1) - 1); //-1 is padding, no drawing takes place there + setMinimumSize(kMinColumns * (kWidth + 1) - 1, kMinRows * (kHeight + 1) - 1); // -1 is padding, no drawing takes place there setMaximumWidth(kMaxColumns * (kWidth + 1) - 1); // mxcl says null pixmaps cause crashes, so let's play it safe @@ -237,7 +237,7 @@ static inline void adjustToLimits(const int b, int &f, int &amount) { * Clever contrast function * * It will try to adjust the foreground color such that it contrasts well with - *the background + * the background * It won't modify the hue of fg unless absolutely necessary * @return the adjusted form of fg */ diff --git a/src/analyzer/blockanalyzer.h b/src/analyzer/blockanalyzer.h index d3fdf2106..e6cb2f501 100644 --- a/src/analyzer/blockanalyzer.h +++ b/src/analyzer/blockanalyzer.h @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef BLOCKANALYZER_H #define BLOCKANALYZER_H diff --git a/src/analyzer/boomanalyzer.cpp b/src/analyzer/boomanalyzer.cpp index 91cfc5b28..5454db249 100644 --- a/src/analyzer/boomanalyzer.cpp +++ b/src/analyzer/boomanalyzer.cpp @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include "boomanalyzer.h" @@ -143,7 +143,7 @@ void BoomAnalyzer::analyze(QPainter &p, const Scope &scope, const bool new_frame bar_height_[i] = std::max(0.0, bar_height_[i]); } - peak_handling: + peak_handling: if (peak_height_[i] > 0.0) { peak_height_[i] -= peak_speed_[i]; diff --git a/src/analyzer/boomanalyzer.h b/src/analyzer/boomanalyzer.h index ac5105c86..631e048ea 100644 --- a/src/analyzer/boomanalyzer.h +++ b/src/analyzer/boomanalyzer.h @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef BOOMANALYZER_H #define BOOMANALYZER_H diff --git a/src/analyzer/fht.cpp b/src/analyzer/fht.cpp index 6af05930c..b49423aa7 100644 --- a/src/analyzer/fht.cpp +++ b/src/analyzer/fht.cpp @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include "fht.h" diff --git a/src/analyzer/fht.h b/src/analyzer/fht.h index 28860f98e..b0da944bc 100644 --- a/src/analyzer/fht.h +++ b/src/analyzer/fht.h @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef FHT_H #define FHT_H @@ -59,10 +59,10 @@ class FHT { public: /** - * Prepare transform for data sets with @f$2^n@f$ numbers, whereby @f$n@f$ - * should be at least 3. Values of more than 3 need a trigonometry table. - * @see makeCasTable() - */ + * Prepare transform for data sets with @f$2^n@f$ numbers, whereby @f$n@f$ + * should be at least 3. Values of more than 3 need a trigonometry table. + * @see makeCasTable() + */ explicit FHT(uint); ~FHT(); diff --git a/src/analyzer/rainbowanalyzer.cpp b/src/analyzer/rainbowanalyzer.cpp index 00bb6bd06..0f6a76163 100644 --- a/src/analyzer/rainbowanalyzer.cpp +++ b/src/analyzer/rainbowanalyzer.cpp @@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include "rainbowanalyzer.h" diff --git a/src/analyzer/rainbowanalyzer.h b/src/analyzer/rainbowanalyzer.h index b2c710271..2c29cc207 100644 --- a/src/analyzer/rainbowanalyzer.h +++ b/src/analyzer/rainbowanalyzer.h @@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef RAINBOWANALYZER_H #define RAINBOWANALYZER_H @@ -85,7 +85,7 @@ class RainbowAnalyzer : public AnalyzerBase { private: // "constants" that get initialized in the constructor - float band_scale_[kRainbowBands] {}; + float band_scale_[kRainbowBands]{}; QPen colors_[kRainbowBands]; // Rainbow Nyancat & Dash @@ -96,7 +96,7 @@ class RainbowAnalyzer : public AnalyzerBase { int frame_; // The y positions of each point on the rainbow. - float history_[kHistorySize * kRainbowBands] {}; + float history_[kHistorySize * kRainbowBands]{}; // A cache of the last frame's rainbow, // so it can be used in the next frame. diff --git a/src/analyzer/sonogramanalyzer.h b/src/analyzer/sonogramanalyzer.h index f533a361f..11f647b65 100644 --- a/src/analyzer/sonogramanalyzer.h +++ b/src/analyzer/sonogramanalyzer.h @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef SONOGRAMANALYZER_H #define SONOGRAMANALYZER_H diff --git a/src/analyzer/turbineanalyzer.cpp b/src/analyzer/turbineanalyzer.cpp index 97cece0ba..ec33f8479 100644 --- a/src/analyzer/turbineanalyzer.cpp +++ b/src/analyzer/turbineanalyzer.cpp @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with Clementine. If not, see . -*/ + */ #include "config.h" @@ -70,7 +70,7 @@ void TurbineAnalyzer::analyze(QPainter &p, const Scope &scope, const bool new_fr bar_height_[i] = std::max(0.0, bar_height_[i]); } - peak_handling: + peak_handling: if (peak_height_[i] > 0.0) { peak_height_[i] -= peak_speed_[i]; peak_speed_[i] *= F_peakSpeed_; // 1.12 diff --git a/src/analyzer/turbineanalyzer.h b/src/analyzer/turbineanalyzer.h index ef4c8ea8e..4f898b5f1 100644 --- a/src/analyzer/turbineanalyzer.h +++ b/src/analyzer/turbineanalyzer.h @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with Clementine. If not, see . -*/ + */ #ifndef TURBINEANALYZER_H #define TURBINEANALYZER_H diff --git a/src/analyzer/waverubberanalyzer.h b/src/analyzer/waverubberanalyzer.h index 421f6143e..41e9a2c40 100644 --- a/src/analyzer/waverubberanalyzer.h +++ b/src/analyzer/waverubberanalyzer.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include diff --git a/src/collection/collectionbackend.h b/src/collection/collectionbackend.h index ed769f8a1..7f9e24a19 100644 --- a/src/collection/collectionbackend.h +++ b/src/collection/collectionbackend.h @@ -331,4 +331,3 @@ class CollectionBackend : public CollectionBackendInterface { }; #endif // COLLECTIONBACKEND_H - diff --git a/src/collection/collectionfilterwidget.h b/src/collection/collectionfilterwidget.h index 36282f64f..d6b84d655 100644 --- a/src/collection/collectionfilterwidget.h +++ b/src/collection/collectionfilterwidget.h @@ -135,4 +135,3 @@ class CollectionFilterWidget : public QWidget { }; #endif // COLLECTIONFILTERWIDGET_H - diff --git a/src/collection/collectionplaylistitem.h b/src/collection/collectionplaylistitem.h index 5e9dd05be..7092bbf5c 100644 --- a/src/collection/collectionplaylistitem.h +++ b/src/collection/collectionplaylistitem.h @@ -58,4 +58,3 @@ class CollectionPlaylistItem : public PlaylistItem { }; #endif // COLLECTIONPLAYLISTITEM_H - diff --git a/src/collection/collectionquery.cpp b/src/collection/collectionquery.cpp index 533bf5c66..5af0578ee 100644 --- a/src/collection/collectionquery.cpp +++ b/src/collection/collectionquery.cpp @@ -101,9 +101,9 @@ void CollectionQuery::AddCompilationRequirement(const bool compilation) { QString CollectionQuery::GetInnerQuery() const { return duplicates_only_ ? QStringLiteral(" INNER JOIN (select * from duplicated_songs) dsongs " - "ON (%songs_table.artist = dsongs.dup_artist " - "AND %songs_table.album = dsongs.dup_album " - "AND %songs_table.title = dsongs.dup_title) ") + "ON (%songs_table.artist = dsongs.dup_artist " + "AND %songs_table.album = dsongs.dup_album " + "AND %songs_table.title = dsongs.dup_title) ") : QString(); } diff --git a/src/constants/appearancesettings.h b/src/constants/appearancesettings.h index 4efaf809d..b275646f9 100644 --- a/src/constants/appearancesettings.h +++ b/src/constants/appearancesettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef APPEARANCESETTINGS_H #define APPEARANCESETTINGS_H diff --git a/src/constants/backendsettings.h b/src/constants/backendsettings.h index 5a55becad..314ae0a4a 100644 --- a/src/constants/backendsettings.h +++ b/src/constants/backendsettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef BACKENDSETTINGS_H #define BACKENDSETTINGS_H diff --git a/src/constants/behavioursettings.h b/src/constants/behavioursettings.h index 14dd80a07..f24a03d03 100644 --- a/src/constants/behavioursettings.h +++ b/src/constants/behavioursettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef BEHAVIOURSETTINGS_H #define BEHAVIOURSETTINGS_H diff --git a/src/constants/collectionsettings.h b/src/constants/collectionsettings.h index b7495d0f8..60cc847bd 100644 --- a/src/constants/collectionsettings.h +++ b/src/constants/collectionsettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024-2025, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024-2025, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef COLLECTIONSETTINGS_H #define COLLECTIONSETTINGS_H diff --git a/src/constants/contextsettings.h b/src/constants/contextsettings.h index 74d894c43..2987494ee 100644 --- a/src/constants/contextsettings.h +++ b/src/constants/contextsettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef CONTEXTSETTINGS_H #define CONTEXTSETTINGS_H diff --git a/src/constants/coverssettings.h b/src/constants/coverssettings.h index 2cef4f872..28565008e 100644 --- a/src/constants/coverssettings.h +++ b/src/constants/coverssettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef COVERSSETTINGS_H #define COVERSSETTINGS_H diff --git a/src/constants/filefilterconstants.h b/src/constants/filefilterconstants.h index ffbaee22d..6a6e98121 100644 --- a/src/constants/filefilterconstants.h +++ b/src/constants/filefilterconstants.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef FILEFILTERCONSTANTS_H #define FILEFILTERCONSTANTS_H diff --git a/src/constants/filenameconstants.h b/src/constants/filenameconstants.h index 61cb727ed..dd35f3fb0 100644 --- a/src/constants/filenameconstants.h +++ b/src/constants/filenameconstants.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef FILENAMECONSTANTS_H #define FILENAMECONSTANTS_H diff --git a/src/constants/filesystemconstants.h b/src/constants/filesystemconstants.h index 447bb986f..447357e2b 100644 --- a/src/constants/filesystemconstants.h +++ b/src/constants/filesystemconstants.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2025, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2025, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef FILESYSTEMCONSTANTS_H #define FILESYSTEMCONSTANTS_H diff --git a/src/constants/globalshortcutssettings.h b/src/constants/globalshortcutssettings.h index c50309aa6..5f932580c 100644 --- a/src/constants/globalshortcutssettings.h +++ b/src/constants/globalshortcutssettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef GLOBALSHORTCUTSSETTINGS_H #define GLOBALSHORTCUTSSETTINGS_H diff --git a/src/constants/lyricssettings.h b/src/constants/lyricssettings.h index d539601b6..a90eeed51 100644 --- a/src/constants/lyricssettings.h +++ b/src/constants/lyricssettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef LYRICSSETTINGS_H #define LYRICSSETTINGS_H diff --git a/src/constants/mainwindowsettings.h b/src/constants/mainwindowsettings.h index bf83af4af..9afdb6a4c 100644 --- a/src/constants/mainwindowsettings.h +++ b/src/constants/mainwindowsettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef MAINWINDOWSETTINGS_H #define MAINWINDOWSETTINGS_H diff --git a/src/constants/moodbarsettings.h b/src/constants/moodbarsettings.h index 9a7bd529d..10b22325a 100644 --- a/src/constants/moodbarsettings.h +++ b/src/constants/moodbarsettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef MOODBARSETTINGS_H #define MOODBARSETTINGS_H diff --git a/src/constants/networkproxysettings.h b/src/constants/networkproxysettings.h index fe45e40fb..54afff020 100644 --- a/src/constants/networkproxysettings.h +++ b/src/constants/networkproxysettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef NETWORKPROXYSETTINGS_H #define NETWORKPROXYSETTINGS_H diff --git a/src/constants/notificationssettings.h b/src/constants/notificationssettings.h index 4aa87f42b..a073bdccb 100644 --- a/src/constants/notificationssettings.h +++ b/src/constants/notificationssettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef NOTIFICATIONSSETTINGS_H #define NOTIFICATIONSSETTINGS_H diff --git a/src/constants/playlistsettings.h b/src/constants/playlistsettings.h index 7c43ec87c..d90ade63e 100644 --- a/src/constants/playlistsettings.h +++ b/src/constants/playlistsettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef PLAYLISTSETTINGS_H #define PLAYLISTSETTINGS_H diff --git a/src/constants/qobuzsettings.h b/src/constants/qobuzsettings.h index 51c3f5247..5d0d66e05 100644 --- a/src/constants/qobuzsettings.h +++ b/src/constants/qobuzsettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef QOBUZSETTINGS_H #define QOBUZSETTINGS_H diff --git a/src/constants/scrobblersettings.h b/src/constants/scrobblersettings.h index 5f1719eb7..13c040f49 100644 --- a/src/constants/scrobblersettings.h +++ b/src/constants/scrobblersettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef SCROBBLERSETTINGS_H #define SCROBBLERSETTINGS_H diff --git a/src/constants/spotifysettings.h b/src/constants/spotifysettings.h index 6c185ea20..81e003535 100644 --- a/src/constants/spotifysettings.h +++ b/src/constants/spotifysettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef SPOTIFYSETTINGS_H #define SPOTIFYSETTINGS_H diff --git a/src/constants/subsonicsettings.h b/src/constants/subsonicsettings.h index 8baecc75c..d1718ff6f 100644 --- a/src/constants/subsonicsettings.h +++ b/src/constants/subsonicsettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef SUBSONICETTINGS_H diff --git a/src/constants/tidalsettings.h b/src/constants/tidalsettings.h index 8a1737ace..2b18cb87c 100644 --- a/src/constants/tidalsettings.h +++ b/src/constants/tidalsettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef TIDALSETTINGS_H #define TIDALSETTINGS_H diff --git a/src/constants/timeconstants.h b/src/constants/timeconstants.h index a2e4b012f..c507d8b57 100644 --- a/src/constants/timeconstants.h +++ b/src/constants/timeconstants.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it wiLL be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it wiLL be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef TIMECONSTANTS_H #define TIMECONSTANTS_H diff --git a/src/constants/transcodersettings.h b/src/constants/transcodersettings.h index 3319984e8..de7ac504b 100644 --- a/src/constants/transcodersettings.h +++ b/src/constants/transcodersettings.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2024, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it wiLL be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2024, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it wiLL be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef TRANSCODERSETTINGS_H @@ -26,4 +26,3 @@ constexpr char kSettingsGroup[] = "Transcoder"; } #endif // TRANSCODERSETTINGS_H - diff --git a/src/core/application.cpp b/src/core/application.cpp index b99cadfba..c034e9249 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -117,8 +117,8 @@ using namespace std::chrono_literals; class ApplicationImpl { public: - explicit ApplicationImpl(Application *app) : - tagreader_client_([app](){ + explicit ApplicationImpl(Application *app) + : tagreader_client_([app](){ TagReaderClient *client = new TagReaderClient(); app->MoveToNewThread(client); return client; @@ -264,7 +264,7 @@ Application::Application(QObject *parent) Application::~Application() { - qLog(Debug) << "Terminating application"; + qLog(Debug) << "Terminating application"; for (QThread *thread : std::as_const(threads_)) { thread->quit(); diff --git a/src/core/database.cpp b/src/core/database.cpp index 09ae9c3fb..213f6f575 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -61,8 +61,8 @@ constexpr char kMagicAllSongsTables[] = "%allsongstables"; int Database::sNextConnectionId = 1; QMutex Database::sNextConnectionIdMutex; -Database::Database(SharedPtr task_manager, QObject *parent, const QString &database_name) : - QObject(parent), +Database::Database(SharedPtr task_manager, QObject *parent, const QString &database_name) + : QObject(parent), task_manager_(task_manager), injected_database_name_(database_name), query_hash_(0), @@ -134,7 +134,7 @@ QSqlDatabase Database::Connect() { return db; } db.setConnectOptions(u"QSQLITE_BUSY_TIMEOUT=30000"_s); - //qLog(Debug) << "Opened database with connection id" << connection_id; + // qLog(Debug) << "Opened database with connection id" << connection_id; if (injected_database_name_.isNull()) { db.setDatabaseName(directory_ + u'/' + QLatin1String(kDatabaseFilename)); @@ -210,7 +210,7 @@ void Database::Close() { QSqlDatabase db = QSqlDatabase::database(connection_id); if (db.isOpen()) { db.close(); - //qLog(Debug) << "Closed database with connection id" << connection_id; + // qLog(Debug) << "Closed database with connection id" << connection_id; } } QSqlDatabase::removeDatabase(connection_id); @@ -594,8 +594,7 @@ void Database::BackupFile(const QString &filename) { ret = sqlite3_backup_step(backup, 16); const int page_count = sqlite3_backup_pagecount(backup); task_manager_->SetTaskProgress(task_id, static_cast(page_count - sqlite3_backup_remaining(backup)), static_cast(page_count)); - } - while (ret == SQLITE_OK); + } while (ret == SQLITE_OK); if (ret != SQLITE_DONE) { qLog(Error) << "Database backup failed"; diff --git a/src/core/enginemetadata.cpp b/src/core/enginemetadata.cpp index 29538cc91..5ea8a05d7 100644 --- a/src/core/enginemetadata.cpp +++ b/src/core/enginemetadata.cpp @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2018-2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2018-2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #include "enginemetadata.h" #include "core/song.h" diff --git a/src/core/enginemetadata.h b/src/core/enginemetadata.h index 721605c2c..93d1d0b15 100644 --- a/src/core/enginemetadata.h +++ b/src/core/enginemetadata.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2018-2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2018-2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef ENGINEMETADATA_H #define ENGINEMETADATA_H diff --git a/src/core/httpbaserequest.cpp b/src/core/httpbaserequest.cpp index 849496b2e..24b0e694f 100644 --- a/src/core/httpbaserequest.cpp +++ b/src/core/httpbaserequest.cpp @@ -93,7 +93,7 @@ QNetworkReply *HttpBaseRequest::CreateGetRequest(const QUrl &url, const QUrlQuer QObject::connect(reply, &QNetworkReply::sslErrors, this, &HttpBaseRequest::HandleSSLErrors); replies_ << reply; - //qLog(Debug) << service_name() << "Sending get request" << request_url; + // qLog(Debug) << service_name() << "Sending get request" << request_url; return reply; @@ -111,7 +111,7 @@ QNetworkReply *HttpBaseRequest::CreatePostRequest(const QUrl &url, const QByteAr QObject::connect(reply, &QNetworkReply::sslErrors, this, &HttpBaseRequest::HandleSSLErrors); replies_ << reply; - //qLog(Debug) << service_name() << "Sending post request" << url << data; + // qLog(Debug) << service_name() << "Sending post request" << url << data; return reply; diff --git a/src/core/localredirectserver.cpp b/src/core/localredirectserver.cpp index 47aa1154e..db4664649 100644 --- a/src/core/localredirectserver.cpp +++ b/src/core/localredirectserver.cpp @@ -155,11 +155,7 @@ void LocalRedirectServer::WriteTemplate() const { QBuffer image_buffer; if (image_buffer.open(QIODevice::ReadWrite)) { - QApplication::style() - ->standardIcon(QStyle::SP_DialogOkButton) - .pixmap(16) - .toImage() - .save(&image_buffer, "PNG"); + QApplication::style()->standardIcon(QStyle::SP_DialogOkButton).pixmap(16).toImage().save(&image_buffer, "PNG"); page_data.replace("@IMAGE_DATA@"_L1, QString::fromUtf8(image_buffer.data().toBase64())); image_buffer.close(); } diff --git a/src/core/logging.cpp b/src/core/logging.cpp index 9dbd9def9..fa43c2411 100644 --- a/src/core/logging.cpp +++ b/src/core/logging.cpp @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/ + */ #include @@ -257,7 +257,7 @@ static QString ParsePrettyFunction(const char *pretty_function) { } -template +template static T CreateLogger(Level level, const QString &class_name, int line, const char *category) { // Map the level to a string diff --git a/src/core/logging.h b/src/core/logging.h index bdf5424c8..b0ff78705 100644 --- a/src/core/logging.h +++ b/src/core/logging.h @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/ + */ #ifndef LOGGING_H #define LOGGING_H @@ -67,10 +67,10 @@ enum Level { Level_Debug, }; - void Init(); - void SetLevels(const QString &levels); +void Init(); +void SetLevels(const QString &levels); - void DumpStackTrace(); +void DumpStackTrace(); QDebug CreateLoggerFatal(const int line, const char *pretty_function, const char *category); QDebug CreateLoggerError(const int line, const char *pretty_function, const char *category); diff --git a/src/core/memorydatabase.cpp b/src/core/memorydatabase.cpp index d4156e2ee..3872c4f28 100644 --- a/src/core/memorydatabase.cpp +++ b/src/core/memorydatabase.cpp @@ -22,7 +22,7 @@ using namespace Qt::Literals::StringLiterals; MemoryDatabase::MemoryDatabase(SharedPtr task_manager, QObject *parent) - : Database(task_manager, parent, u":memory:"_s) {} + : Database(task_manager, parent, u":memory:"_s) {} MemoryDatabase::~MemoryDatabase() { // Make sure Qt doesn't reuse the same database diff --git a/src/core/mimedata.cpp b/src/core/mimedata.cpp index 7247ffba3..0597a04d4 100644 --- a/src/core/mimedata.cpp +++ b/src/core/mimedata.cpp @@ -26,13 +26,13 @@ #include "mimedata.h" MimeData::MimeData(const bool clear, const bool play_now, const bool enqueue, const bool enqueue_next_now, const bool open_in_new_playlist, QObject *parent) - : override_user_settings_(false), - clear_first_(clear), - play_now_(play_now), - enqueue_now_(enqueue), - enqueue_next_now_(enqueue_next_now), - open_in_new_playlist_(open_in_new_playlist), - from_doubleclick_(false) { + : override_user_settings_(false), + clear_first_(clear), + play_now_(play_now), + enqueue_now_(enqueue), + enqueue_next_now_(enqueue_next_now), + open_in_new_playlist_(open_in_new_playlist), + from_doubleclick_(false) { Q_UNUSED(parent); diff --git a/src/core/musicstorage.h b/src/core/musicstorage.h index afe5fafc8..dcd6eb805 100644 --- a/src/core/musicstorage.h +++ b/src/core/musicstorage.h @@ -57,7 +57,7 @@ class MusicStorage { Transcode_Unsupported = 3, }; - using ProgressFunction = std::function; + using ProgressFunction = std::function; struct CopyJob { CopyJob() : overwrite_(false), remove_original_(false), albumcover_(false) {} diff --git a/src/core/scoped_nsautorelease_pool.h b/src/core/scoped_nsautorelease_pool.h index fb8a79d56..53da5b721 100644 --- a/src/core/scoped_nsautorelease_pool.h +++ b/src/core/scoped_nsautorelease_pool.h @@ -29,7 +29,7 @@ class ScopedNSAutoreleasePool { // no longer needed. void Recycle(); private: - NSAutoreleasePool* autorelease_pool_; + NSAutoreleasePool *autorelease_pool_; private: Q_DISABLE_COPY(ScopedNSAutoreleasePool); diff --git a/src/core/simpletreemodel.h b/src/core/simpletreemodel.h index b0ceb93cc..6260f1372 100644 --- a/src/core/simpletreemodel.h +++ b/src/core/simpletreemodel.h @@ -70,7 +70,7 @@ QModelIndex SimpleTreeModel::ItemToIndex(T *item) const { return createIndex(item->row, 0, item); } -template +template int SimpleTreeModel::columnCount(const QModelIndex&) const { return 1; } diff --git a/src/core/song.cpp b/src/core/song.cpp index 70f1f0f0c..3b43f697e 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -720,17 +720,17 @@ bool Song::write_tags_supported() const { bool Song::additional_tags_supported() const { return d->filetype_ == FileType::FLAC || - d->filetype_ == FileType::WavPack || - d->filetype_ == FileType::OggFlac || - d->filetype_ == FileType::OggVorbis || - d->filetype_ == FileType::OggOpus || - d->filetype_ == FileType::OggSpeex || - d->filetype_ == FileType::MPEG || - d->filetype_ == FileType::MP4 || - d->filetype_ == FileType::MPC || - d->filetype_ == FileType::APE || - d->filetype_ == FileType::WAV || - d->filetype_ == FileType::AIFF; + d->filetype_ == FileType::WavPack || + d->filetype_ == FileType::OggFlac || + d->filetype_ == FileType::OggVorbis || + d->filetype_ == FileType::OggOpus || + d->filetype_ == FileType::OggSpeex || + d->filetype_ == FileType::MPEG || + d->filetype_ == FileType::MP4 || + d->filetype_ == FileType::MPC || + d->filetype_ == FileType::APE || + d->filetype_ == FileType::WAV || + d->filetype_ == FileType::AIFF; } @@ -745,16 +745,16 @@ bool Song::composer_supported() const { bool Song::performer_supported() const { return d->filetype_ == FileType::FLAC || - d->filetype_ == FileType::WavPack || - d->filetype_ == FileType::OggFlac || - d->filetype_ == FileType::OggVorbis || - d->filetype_ == FileType::OggOpus || - d->filetype_ == FileType::OggSpeex || - d->filetype_ == FileType::MPEG || - d->filetype_ == FileType::MPC || - d->filetype_ == FileType::APE || - d->filetype_ == FileType::WAV || - d->filetype_ == FileType::AIFF; + d->filetype_ == FileType::WavPack || + d->filetype_ == FileType::OggFlac || + d->filetype_ == FileType::OggVorbis || + d->filetype_ == FileType::OggOpus || + d->filetype_ == FileType::OggSpeex || + d->filetype_ == FileType::MPEG || + d->filetype_ == FileType::MPC || + d->filetype_ == FileType::APE || + d->filetype_ == FileType::WAV || + d->filetype_ == FileType::AIFF; } @@ -773,18 +773,18 @@ bool Song::compilation_supported() const { bool Song::rating_supported() const { return d->filetype_ == FileType::FLAC || - d->filetype_ == FileType::WavPack || - d->filetype_ == FileType::OggFlac || - d->filetype_ == FileType::OggVorbis || - d->filetype_ == FileType::OggOpus || - d->filetype_ == FileType::OggSpeex || - d->filetype_ == FileType::MPEG || - d->filetype_ == FileType::MP4 || - d->filetype_ == FileType::ASF || - d->filetype_ == FileType::MPC || - d->filetype_ == FileType::APE || - d->filetype_ == FileType::WAV || - d->filetype_ == FileType::AIFF; + d->filetype_ == FileType::WavPack || + d->filetype_ == FileType::OggFlac || + d->filetype_ == FileType::OggVorbis || + d->filetype_ == FileType::OggOpus || + d->filetype_ == FileType::OggSpeex || + d->filetype_ == FileType::MPEG || + d->filetype_ == FileType::MP4 || + d->filetype_ == FileType::ASF || + d->filetype_ == FileType::MPC || + d->filetype_ == FileType::APE || + d->filetype_ == FileType::WAV || + d->filetype_ == FileType::AIFF; } @@ -824,12 +824,12 @@ bool Song::titlesort_supported() const { bool Song::save_embedded_cover_supported(const FileType filetype) { return filetype == FileType::FLAC || - filetype == FileType::OggVorbis || - filetype == FileType::OggOpus || - filetype == FileType::MPEG || - filetype == FileType::MP4 || - filetype == FileType::WAV || - filetype == FileType::AIFF; + filetype == FileType::OggVorbis || + filetype == FileType::OggOpus || + filetype == FileType::MPEG || + filetype == FileType::MP4 || + filetype == FileType::WAV || + filetype == FileType::AIFF; } @@ -1444,7 +1444,7 @@ Song::FileType Song::FiletypeByExtension(const QString &ext) { if (ext.compare("ape"_L1, Qt::CaseInsensitive) == 0) return FileType::APE; if (ext.compare("mod"_L1, Qt::CaseInsensitive) == 0 || ext.compare("module"_L1, Qt::CaseInsensitive) == 0 || - ext.compare("nst"_L1, Qt::CaseInsensitive) == 0|| + ext.compare("nst"_L1, Qt::CaseInsensitive) == 0 || ext.compare("wow"_L1, Qt::CaseInsensitive) == 0) return FileType::MOD; if (ext.compare("s3m"_L1, Qt::CaseInsensitive) == 0) return FileType::S3M; if (ext.compare("xm"_L1, Qt::CaseInsensitive) == 0) return FileType::XM; @@ -1689,7 +1689,7 @@ void Song::InitFromItdb(Itdb_Track *track, const QString &prefix) { d->bitrate_ = track->bitrate; d->samplerate_ = track->samplerate; - d->bitdepth_ = -1; //track->bitdepth; + d->bitdepth_ = -1; // track->bitdepth; d->source_ = Source::Device; QString filename = QString::fromLocal8Bit(track->ipod_path); @@ -2150,4 +2150,3 @@ QString Song::GetNameForNewPlaylist(const SongList &songs) { return result; } - diff --git a/src/core/songloader.cpp b/src/core/songloader.cpp index fba50f948..bbbef1cbc 100644 --- a/src/core/songloader.cpp +++ b/src/core/songloader.cpp @@ -667,9 +667,9 @@ void SongLoader::EndOfStreamReached() { // Do the magic on the data we have already MagicReady(); if (state_ == State::Finished) break; - // It looks like a playlist, so parse it + // It looks like a playlist, so parse it - [[fallthrough]]; + [[fallthrough]]; case State::WaitingForData: // It's a playlist and we've got all the data - finish and parse it StopTypefindAsync(true); @@ -784,4 +784,3 @@ void SongLoader::CleanupPipeline() { state_ = State::Finished; } - diff --git a/src/core/songmimedata.h b/src/core/songmimedata.h index 91f039f83..a465fc72d 100644 --- a/src/core/songmimedata.h +++ b/src/core/songmimedata.h @@ -41,4 +41,3 @@ class SongMimeData : public MimeData { }; #endif // SONGMIMEDATA_H - diff --git a/src/core/stylehelper.cpp b/src/core/stylehelper.cpp index c7552c2dc..56cbb8379 100644 --- a/src/core/stylehelper.cpp +++ b/src/core/stylehelper.cpp @@ -383,30 +383,30 @@ void StyleHelper::drawCornerImage(const QImage &img, QPainter *painter, const QR const qreal bottomDIP = bottom * imagePixelRatio; const QSize size = img.size(); - if (top > 0) { //top + if (top > 0) { // top painter->drawImage(QRectF(rect.left() + left, rect.top(), rect.width() - right - left, top), img, QRectF(leftDIP, 0, size.width() - rightDIP - leftDIP, topDIP)); - if (left > 0) { //top-left + if (left > 0) { // top-left painter->drawImage(QRectF(rect.left(), rect.top(), left, top), img, QRectF(0, 0, leftDIP, topDIP)); } - if (right > 0) { //top-right + if (right > 0) { // top-right painter->drawImage(QRectF(rect.left() + rect.width() - right, rect.top(), right, top), img, QRectF(size.width() - rightDIP, 0, rightDIP, topDIP)); } } - //left + // left if (left > 0) { painter->drawImage(QRectF(rect.left(), rect.top() + top, left, rect.height() - top - bottom), img, QRectF(0, topDIP, leftDIP, size.height() - bottomDIP - topDIP)); } - //center + // center painter->drawImage(QRectF(rect.left() + left, rect.top() + top, rect.width() - right - left, rect.height() - bottom - top), img, QRectF(leftDIP, topDIP, size.width() - rightDIP - leftDIP, size.height() - bottomDIP - topDIP)); - if (right > 0) { //right + if (right > 0) { // right painter->drawImage(QRectF(rect.left() + rect.width() - right, rect.top() + top, right, rect.height() - top - bottom), img, QRectF(size.width() - rightDIP, topDIP, rightDIP, size.height() - bottomDIP - topDIP)); } - if (bottom > 0) { //bottom + if (bottom > 0) { // bottom painter->drawImage(QRectF(rect.left() + left, rect.top() + rect.height() - bottom, rect.width() - right - left, bottom), img, QRectF(leftDIP, size.height() - bottomDIP, size.width() - rightDIP - leftDIP, bottomDIP)); - if (left > 0) { //bottom-left + if (left > 0) { // bottom-left painter->drawImage(QRectF(rect.left(), rect.top() + rect.height() - bottom, left, bottom), img, QRectF(0, size.height() - bottomDIP, leftDIP, bottomDIP)); } - if (right > 0) { //bottom-right + if (right > 0) { // bottom-right painter->drawImage(QRectF(rect.left() + rect.width() - right, rect.top() + rect.height() - bottom, right, bottom), img, QRectF(size.width() - rightDIP, size.height() - bottomDIP, rightDIP, bottomDIP)); } } diff --git a/src/core/thread.cpp b/src/core/thread.cpp index ee64a1ac5..7b01237f7 100644 --- a/src/core/thread.cpp +++ b/src/core/thread.cpp @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include "config.h" diff --git a/src/core/thread.h b/src/core/thread.h index 284a04fd1..4a1006f44 100644 --- a/src/core/thread.h +++ b/src/core/thread.h @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef THREAD_H #define THREAD_H diff --git a/src/core/urlhandler.cpp b/src/core/urlhandler.cpp index 9058cadc0..216fe16f3 100644 --- a/src/core/urlhandler.cpp +++ b/src/core/urlhandler.cpp @@ -53,4 +53,3 @@ UrlHandler::LoadResult::LoadResult(const QUrl &media_url, const Type type, const bit_depth_(-1), length_nanosec_(-1), error_(error) {} - diff --git a/src/covermanager/albumcoverchoicecontroller.cpp b/src/covermanager/albumcoverchoicecontroller.cpp index 38271c8a8..998e199c4 100644 --- a/src/covermanager/albumcoverchoicecontroller.cpp +++ b/src/covermanager/albumcoverchoicecontroller.cpp @@ -299,7 +299,7 @@ QString AlbumCoverChoiceController::GetInitialPathForFileDialog(const Song &song // Art automatic is first to show user which cover the album may be using now; // The song is using it if there's no manual path but we cannot use manual path here because it can contain cached paths if (song.art_automatic_is_valid()) { - return song.art_automatic().toLocalFile(); + return song.art_automatic().toLocalFile(); } // If no automatic art, start in the song's folder @@ -757,7 +757,7 @@ bool AlbumCoverChoiceController::IsKnownImageExtension(const QString &suffix) { if (!sImageExtensions) { sImageExtensions = new QSet(); - (*sImageExtensions) << u"png"_s << u"jpg"_s << u"jpeg"_s << u"bmp"_s << u"gif"_s << u"xpm"_s << u"pbm"_s << u"pgm"_s << u"ppm"_s << u"xbm"_s; + (*sImageExtensions) << u"png"_s << u"jpg"_s << u"jpeg"_s << u"bmp"_s << u"gif"_s << u"xpm"_s << u"pbm"_s << u"pgm"_s << u"ppm"_s << u"xbm"_s; } return sImageExtensions->contains(suffix); @@ -806,14 +806,14 @@ void AlbumCoverChoiceController::SaveCover(Song *song, const QDropEvent *e) { QUrl AlbumCoverChoiceController::SaveCoverAutomatic(Song *song, const AlbumCoverImageResult &result) { QUrl cover_url; - switch(get_save_album_cover_type()) { case CoverOptions::CoverType::Embedded:{ + switch (get_save_album_cover_type()) { if (song->save_embedded_cover_supported()) { SaveCoverEmbeddedToCollectionSongs(*song, result); break; } } - [[fallthrough]]; + [[fallthrough]]; case CoverOptions::CoverType::Cache: case CoverOptions::CoverType::Album:{ cover_url = SaveCoverToFileAutomatic(song, result); diff --git a/src/covermanager/albumcoverexporter.h b/src/covermanager/albumcoverexporter.h index 95dea3dd6..3eb584cca 100644 --- a/src/covermanager/albumcoverexporter.h +++ b/src/covermanager/albumcoverexporter.h @@ -75,4 +75,3 @@ class AlbumCoverExporter : public QObject { }; #endif // ALBUMCOVEREXPORTER_H - diff --git a/src/covermanager/albumcoverimageresult.h b/src/covermanager/albumcoverimageresult.h index 5c4514c44..030f57810 100644 --- a/src/covermanager/albumcoverimageresult.h +++ b/src/covermanager/albumcoverimageresult.h @@ -29,10 +29,10 @@ class AlbumCoverImageResult { public: explicit AlbumCoverImageResult(const QUrl &_cover_url = QUrl(), const QString &_mime_type = QString(), const QByteArray &_image_data = QByteArray(), const QImage &_image = QImage()) - : cover_url(_cover_url), - mime_type(_mime_type), - image_data(_image_data), - image(_image) {} + : cover_url(_cover_url), + mime_type(_mime_type), + image_data(_image_data), + image(_image) {} explicit AlbumCoverImageResult(const QImage &_image) : image(_image) {} QUrl cover_url; diff --git a/src/covermanager/albumcoverloaderoptions.cpp b/src/covermanager/albumcoverloaderoptions.cpp index 155e458d2..7bc9b8b9e 100644 --- a/src/covermanager/albumcoverloaderoptions.cpp +++ b/src/covermanager/albumcoverloaderoptions.cpp @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2018-2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2018-2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #include "albumcoverloaderoptions.h" diff --git a/src/covermanager/albumcoverloaderresult.h b/src/covermanager/albumcoverloaderresult.h index f43e8b39a..1914ad303 100644 --- a/src/covermanager/albumcoverloaderresult.h +++ b/src/covermanager/albumcoverloaderresult.h @@ -44,13 +44,13 @@ class AlbumCoverLoaderResult { const AlbumCoverImageResult &_album_cover = AlbumCoverImageResult(), const QImage &_image_scaled = QImage(), const QUrl &_art_manual_updated = QUrl(), - const QUrl &_art_automatic_updated = QUrl()) : - success(_success), - type(_type), - album_cover(_album_cover), - image_scaled(_image_scaled), - art_manual_updated(_art_manual_updated), - art_automatic_updated(_art_automatic_updated) {} + const QUrl &_art_automatic_updated = QUrl()) + : success(_success), + type(_type), + album_cover(_album_cover), + image_scaled(_image_scaled), + art_manual_updated(_art_manual_updated), + art_automatic_updated(_art_automatic_updated) {} bool success; Type type; diff --git a/src/covermanager/albumcovermanager.cpp b/src/covermanager/albumcovermanager.cpp index 8da41dcac..1b5753c08 100644 --- a/src/covermanager/albumcovermanager.cpp +++ b/src/covermanager/albumcovermanager.cpp @@ -604,10 +604,7 @@ void AlbumCoverManager::AlbumCoverFetched(const quint64 id, const AlbumCoverImag void AlbumCoverManager::UpdateStatusText() { - QString message = tr("Got %1 covers out of %2 (%3 failed)") - .arg(fetch_statistics_.chosen_images_) - .arg(jobs_) - .arg(fetch_statistics_.missing_images_); + QString message = tr("Got %1 covers out of %2 (%3 failed)").arg(fetch_statistics_.chosen_images_).arg(jobs_).arg(fetch_statistics_.missing_images_); if (fetch_statistics_.bytes_transferred_ > 0) { message += ", "_L1 + tr("%1 transferred").arg(Utilities::PrettySize(fetch_statistics_.bytes_transferred_)); @@ -1083,10 +1080,7 @@ void AlbumCoverManager::UpdateExportStatus(const int exported, const int skipped progress_bar_->setValue(exported); - QString message = tr("Exported %1 covers out of %2 (%3 skipped)") - .arg(exported) - .arg(max) - .arg(skipped); + QString message = tr("Exported %1 covers out of %2 (%3 skipped)").arg(exported).arg(max).arg(skipped); statusBar()->showMessage(message); // End of the current process @@ -1131,4 +1125,3 @@ void AlbumCoverManager::SaveEmbeddedCoverFinished(TagReaderReplyPtr reply, Album LoadAlbumCoverAsync(album_item); } - diff --git a/src/covermanager/coversearchstatisticsdialog.cpp b/src/covermanager/coversearchstatisticsdialog.cpp index 387a879fc..41544d3d2 100644 --- a/src/covermanager/coversearchstatisticsdialog.cpp +++ b/src/covermanager/coversearchstatisticsdialog.cpp @@ -45,19 +45,18 @@ CoverSearchStatisticsDialog::CoverSearchStatisticsDialog(QWidget *parent) details_layout_ = new QVBoxLayout(ui_->details); details_layout_->setSpacing(0); - setStyleSheet( - u"#details {" - " background-color: palette(base);" - "}" - "#details QLabel[type=\"label\"] {" - " border: 2px solid transparent;" - " border-right: 2px solid palette(midlight);" - " margin-right: 10px;" - "}" - "#details QLabel[type=\"value\"] {" - " font-weight: bold;" - " max-width: 100px;" - "}"_s); + setStyleSheet(u"#details {" + " background-color: palette(base);" + "}" + "#details QLabel[type=\"label\"] {" + " border: 2px solid transparent;" + " border-right: 2px solid palette(midlight);" + " margin-right: 10px;" + "}" + "#details QLabel[type=\"value\"] {" + " font-weight: bold;" + " max-width: 100px;" + "}"_s); } CoverSearchStatisticsDialog::~CoverSearchStatisticsDialog() { delete ui_; } @@ -67,10 +66,7 @@ void CoverSearchStatisticsDialog::Show(const CoverSearchStatistics &statistics) QStringList providers(statistics.total_images_by_provider_.keys()); std::sort(providers.begin(), providers.end()); - ui_->summary->setText(tr("Got %1 covers out of %2 (%3 failed)") - .arg(statistics.chosen_images_) - .arg(statistics.chosen_images_ + statistics.missing_images_) - .arg(statistics.missing_images_)); + ui_->summary->setText(tr("Got %1 covers out of %2 (%3 failed)").arg(statistics.chosen_images_).arg(statistics.chosen_images_ + statistics.missing_images_).arg(statistics.missing_images_)); for (const QString &provider : std::as_const(providers)) { AddLine(tr("Covers from %1").arg(provider), QString::number(statistics.chosen_images_by_provider_[provider])); diff --git a/src/covermanager/musixmatchcoverprovider.cpp b/src/covermanager/musixmatchcoverprovider.cpp index c426d1af1..e835b16f5 100644 --- a/src/covermanager/musixmatchcoverprovider.cpp +++ b/src/covermanager/musixmatchcoverprovider.cpp @@ -59,7 +59,7 @@ bool MusixmatchCoverProvider::StartSearch(const QString &artist, const QString & QNetworkReply *reply = CreateGetRequest(QUrl(QStringLiteral("https://www.musixmatch.com/album/%1/%2").arg(artist_stripped, album_stripped))); QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, id, artist, album]() { HandleSearchReply(reply, id, artist, album); }); - //qLog(Debug) << "Musixmatch: Sending request for" << artist_stripped << album_stripped << url; + // qLog(Debug) << "Musixmatch: Sending request for" << artist_stripped << album_stripped << url; return true; diff --git a/src/device/cddadevice.cpp b/src/device/cddadevice.cpp index b43c0b241..0c50c7769 100644 --- a/src/device/cddadevice.cpp +++ b/src/device/cddadevice.cpp @@ -138,4 +138,3 @@ void CDDADevice::SongLoadingFinished() { WatchForDiscChanges(true); } - diff --git a/src/device/devicedatabasebackend.cpp b/src/device/devicedatabasebackend.cpp index 7dae15b24..688bc54e6 100644 --- a/src/device/devicedatabasebackend.cpp +++ b/src/device/devicedatabasebackend.cpp @@ -227,13 +227,12 @@ void DeviceDatabaseBackend::SetDeviceOptions(const int id, const QString &friend QSqlDatabase db(db_->Connect()); SqlQuery q(db); - q.prepare(QStringLiteral( - "UPDATE devices" - " SET friendly_name=:friendly_name," - " icon=:icon_name," - " transcode_mode=:transcode_mode," - " transcode_format=:transcode_format" - " WHERE ROWID=:id")); + q.prepare(QStringLiteral("UPDATE devices" + " SET friendly_name=:friendly_name," + " icon=:icon_name," + " transcode_mode=:transcode_mode," + " transcode_format=:transcode_format" + " WHERE ROWID=:id")); q.BindValue(u":friendly_name"_s, friendly_name); q.BindValue(u":icon_name"_s, icon_name); q.BindValue(u":transcode_mode"_s, static_cast(mode)); diff --git a/src/device/gpoddevice.h b/src/device/gpoddevice.h index a7486292c..647fcbd24 100644 --- a/src/device/gpoddevice.h +++ b/src/device/gpoddevice.h @@ -100,7 +100,7 @@ class GPodDevice : public ConnectedDevice, public virtual MusicStorage { bool WriteDatabase(QString &error_text); protected: - const SharedPtr task_manager_; + const SharedPtr task_manager_; GPodLoader *loader_; QThread *loader_thread_; diff --git a/src/device/mtpconnection.cpp b/src/device/mtpconnection.cpp index 7cfac6711..e5a4bd403 100644 --- a/src/device/mtpconnection.cpp +++ b/src/device/mtpconnection.cpp @@ -122,7 +122,7 @@ MtpConnection::~MtpConnection() { QString MtpConnection::ErrorString(const LIBMTP_error_number_t error_number) { - switch(error_number) { + switch (error_number) { case LIBMTP_ERROR_NO_DEVICE_ATTACHED: return u"No Devices have been found."_s; case LIBMTP_ERROR_CONNECTING: diff --git a/src/device/udisks2lister.cpp b/src/device/udisks2lister.cpp index 6e851fa8f..273f42f6c 100644 --- a/src/device/udisks2lister.cpp +++ b/src/device/udisks2lister.cpp @@ -411,10 +411,7 @@ Udisks2Lister::PartitionData Udisks2Lister::ReadPartitionData(const QDBusObjectP } QString Udisks2Lister::PartitionData::unique_id() const { - return u"Udisks2/%1/%2/%3/%4/%5"_s - .arg(serial, vendor, model) - .arg(capacity) - .arg(uuid); + return u"Udisks2/%1/%2/%3/%4/%5"_s.arg(serial, vendor, model).arg(capacity).arg(uuid); } Udisks2Lister::Udisks2Job::Udisks2Job() : is_mount(true) {} diff --git a/src/dialogs/saveplaylistsdialog.h b/src/dialogs/saveplaylistsdialog.h index 380257acb..55925aaec 100644 --- a/src/dialogs/saveplaylistsdialog.h +++ b/src/dialogs/saveplaylistsdialog.h @@ -28,7 +28,7 @@ #include "ui_saveplaylistsdialog.h" class SavePlaylistsDialog : public QDialog { - Q_OBJECT + Q_OBJECT public: explicit SavePlaylistsDialog(const QStringList &types, const QString &default_extension, QWidget *parent = nullptr); diff --git a/src/engine/ebur128analysis.cpp b/src/engine/ebur128analysis.cpp index c0e330d47..53d616d4e 100644 --- a/src/engine/ebur128analysis.cpp +++ b/src/engine/ebur128analysis.cpp @@ -315,7 +315,7 @@ void EBUR128State::AddFrames(const char *data, size_t size) { } -std::optional EBUR128State::Finalize(EBUR128State&& state) { +std::optional EBUR128State::Finalize(EBUR128State &&state) { ebur128_state *ebur128 = &*state.st; @@ -419,10 +419,9 @@ std::optional EBUR128AnalysisImpl::Compute(const Song &song) { // Connect the elements gst_element_link_many(src, decode, nullptr); - GstStaticCaps static_caps = GST_STATIC_CAPS( - "audio/x-raw," - "format = (string) { S16LE, S32LE, F32LE, F64LE }," - "layout = (string) interleaved"); + GstStaticCaps static_caps = GST_STATIC_CAPS("audio/x-raw," + "format = (string) { S16LE, S32LE, F32LE, F64LE }," + "layout = (string) interleaved"); GstCaps *caps = gst_static_caps_get(&static_caps); // Place a queue before the sink. It really does matter for performance. diff --git a/src/engine/enginebase.h b/src/engine/enginebase.h index 821ad90a9..b34b5e416 100644 --- a/src/engine/enginebase.h +++ b/src/engine/enginebase.h @@ -50,14 +50,14 @@ class EngineBase : public QObject { public: ~EngineBase() override; - // State: - // Playing when playing, - // Paused when paused - // Idle when you still have a URL loaded (ie you have not been told to stop()) - // Empty when you have been told to stop(), - // Error when an error occurred and you stopped yourself - // - // It is vital to be Idle just after the track has ended! + // State: + // Playing when playing, + // Paused when paused + // Idle when you still have a URL loaded (ie you have not been told to stop()) + // Empty when you have been told to stop(), + // Error when an error occurred and you stopped yourself + // + // It is vital to be Idle just after the track has ended! enum class State { Empty, diff --git a/src/engine/enginedevice.cpp b/src/engine/enginedevice.cpp index b8454fe2b..f8f7f277d 100644 --- a/src/engine/enginedevice.cpp +++ b/src/engine/enginedevice.cpp @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2021-2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2021-2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #include "enginedevice.h" diff --git a/src/engine/enginedevice.h b/src/engine/enginedevice.h index bd0b0c4b6..ff173081d 100644 --- a/src/engine/enginedevice.h +++ b/src/engine/enginedevice.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2021-2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2021-2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef ENGINEDEVICE_H #define ENGINEDEVICE_H diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index 25d53e616..916564660 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -1,24 +1,24 @@ /*************************************************************************** - * Copyright (C) 2003-2005 by Mark Kretschmann * - * Copyright (C) 2005 by Jakub Stachowski * - * Copyright (C) 2006 Paul Cifarelli * - * Copyright (C) 2017-2024 Jonas Kvinge * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +* Copyright (C) 2003-2005 by Mark Kretschmann * +* Copyright (C) 2005 by Jakub Stachowski * +* Copyright (C) 2006 Paul Cifarelli * +* Copyright (C) 2017-2024 Jonas Kvinge * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307, USA. * +***************************************************************************/ #include "config.h" @@ -674,7 +674,7 @@ void GstEngine::HandlePipelineError(const int pipeline_id, const int domain, con void GstEngine::NewMetaData(const int pipeline_id, const EngineMetadata &engine_metadata) { - if (!current_pipeline_|| current_pipeline_->id() != pipeline_id) return; + if (!current_pipeline_ || current_pipeline_->id() != pipeline_id) return; Q_EMIT MetaData(engine_metadata); } @@ -1064,8 +1064,7 @@ void GstEngine::UpdateScope(const int chunk_length) { buffer_format_.startsWith("S24LE"_L1) || buffer_format_.startsWith("S24_32LE"_L1) || buffer_format_.startsWith("S32LE"_L1) || - buffer_format_.startsWith("F32LE"_L1) - ) { + buffer_format_.startsWith("F32LE"_L1)) { memcpy(dest, source, bytes); } else { diff --git a/src/engine/gstengine.h b/src/engine/gstengine.h index 661a49ce1..a64234d4f 100644 --- a/src/engine/gstengine.h +++ b/src/engine/gstengine.h @@ -1,24 +1,24 @@ /*************************************************************************** - * Copyright (C) 2003-2005 by Mark Kretschmann * - * Copyright (C) 2005 by Jakub Stachowski * - * Copyright (C) 2006 Paul Cifarelli * - * Copyright (C) 2017-2024 Jonas Kvinge * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +* Copyright (C) 2003-2005 by Mark Kretschmann * +* Copyright (C) 2005 by Jakub Stachowski * +* Copyright (C) 2006 Paul Cifarelli * +* Copyright (C) 2017-2024 Jonas Kvinge * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307, USA. * +***************************************************************************/ #ifndef GSTENGINE_H #define GSTENGINE_H diff --git a/src/engine/gstfastspectrum.cpp b/src/engine/gstfastspectrum.cpp index 5bd93fa29..963db436d 100644 --- a/src/engine/gstfastspectrum.cpp +++ b/src/engine/gstfastspectrum.cpp @@ -138,7 +138,7 @@ static void gst_strawberry_fastspectrum_alloc_channel_data(GstStrawberryFastSpec fastspectrum->fft_input = reinterpret_cast(fftw_malloc(sizeof(double) * nfft)); fastspectrum->fft_output = reinterpret_cast(fftw_malloc(sizeof(fftw_complex) * (nfft / 2 + 1))); - fastspectrum->spect_magnitude = new double[bands] {}; + fastspectrum->spect_magnitude = new double[bands]{}; GstStrawberryFastSpectrumClass *klass = reinterpret_cast(G_OBJECT_GET_CLASS(fastspectrum)); { diff --git a/src/engine/pulsedevicefinder.cpp b/src/engine/pulsedevicefinder.cpp index 662b8911e..959a45f3c 100644 --- a/src/engine/pulsedevicefinder.cpp +++ b/src/engine/pulsedevicefinder.cpp @@ -147,4 +147,3 @@ PulseDeviceFinder::~PulseDeviceFinder() { pa_mainloop_free(mainloop_); } } - diff --git a/src/equalizer/equalizer.h b/src/equalizer/equalizer.h index b11c39ce8..a5757d35e 100644 --- a/src/equalizer/equalizer.h +++ b/src/equalizer/equalizer.h @@ -54,7 +54,7 @@ class Equalizer : public QDialog { bool operator!=(const Params &other) const; int preamp; - int gain[kBands] {}; + int gain[kBands]{}; }; bool is_equalizer_enabled() const; @@ -98,7 +98,7 @@ class Equalizer : public QDialog { QString last_preset_; EqualizerSlider *preamp_; - EqualizerSlider *gain_[kBands] {}; + EqualizerSlider *gain_[kBands]{}; QMap presets_; }; diff --git a/src/equalizer/equalizerslider.cpp b/src/equalizer/equalizerslider.cpp index 68eb5edc4..36d359ff5 100644 --- a/src/equalizer/equalizerslider.cpp +++ b/src/equalizer/equalizerslider.cpp @@ -68,4 +68,3 @@ int EqualizerSlider::value() const { void EqualizerSlider::set_value(const int value) { ui_->slider->setValue(value); } - diff --git a/src/filterparser/filterparserinteqcomparator.h b/src/filterparser/filterparserinteqcomparator.h index 4b6494d96..1bd6f685f 100644 --- a/src/filterparser/filterparserinteqcomparator.h +++ b/src/filterparser/filterparserinteqcomparator.h @@ -34,4 +34,3 @@ class FilterParserIntEqComparator : public FilterParserSearchTermComparator { }; #endif // FILTERPARSERINTEQCOMPARATOR_H - diff --git a/src/filterparser/filterparserintgecomparator.h b/src/filterparser/filterparserintgecomparator.h index 6e6bc5657..d6becb152 100644 --- a/src/filterparser/filterparserintgecomparator.h +++ b/src/filterparser/filterparserintgecomparator.h @@ -34,4 +34,3 @@ class FilterParserIntGeComparator : public FilterParserSearchTermComparator { }; #endif // FILTERPARSERINTGECOMPARATOR_H - diff --git a/src/filterparser/filterparserintnecomparator.h b/src/filterparser/filterparserintnecomparator.h index 9e7800210..cc6aaa11c 100644 --- a/src/filterparser/filterparserintnecomparator.h +++ b/src/filterparser/filterparserintnecomparator.h @@ -34,4 +34,3 @@ class FilterParserIntNeComparator : public FilterParserSearchTermComparator { }; #endif // FILTERPARSERINTNECOMPARATOR_H - diff --git a/src/includes/lazy.h b/src/includes/lazy.h index ad2763552..9102fa41e 100644 --- a/src/includes/lazy.h +++ b/src/includes/lazy.h @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef LAZY_H #define LAZY_H @@ -37,7 +37,7 @@ class Lazy { // Convenience constructor that will lazily default construct the object. Lazy() : init_([]() { return new T; }) {} - T* get() const { + T *get() const { CheckInitialized(); return ptr_.get(); } @@ -63,7 +63,7 @@ class Lazy { private: void CheckInitialized() const { if (!ptr_) { - ptr_ = SharedPtr(init_(), [](T*obj) { qLog(Debug) << obj << "deleted"; delete obj; }); + ptr_ = SharedPtr(init_(), [](T *obj) { qLog(Debug) << obj << "deleted"; delete obj; }); qLog(Debug) << &*ptr_ << "created"; } } diff --git a/src/includes/scoped_ptr.h b/src/includes/scoped_ptr.h index 2b8941baf..40e9fa097 100644 --- a/src/includes/scoped_ptr.h +++ b/src/includes/scoped_ptr.h @@ -22,7 +22,7 @@ #include -template > +template> using ScopedPtr = std::unique_ptr; #endif // SCOPED_PTR_H diff --git a/src/lyrics/htmllyricsprovider.cpp b/src/lyrics/htmllyricsprovider.cpp index 2773ca245..4cedbfc7f 100644 --- a/src/lyrics/htmllyricsprovider.cpp +++ b/src/lyrics/htmllyricsprovider.cpp @@ -153,8 +153,7 @@ QString HtmlLyricsProvider::ParseLyricsFromHTML(const QString &content, const QR start_idx = rematch_end_tag.capturedEnd(); } } - } - while (tags > 0 && (rematch_start_tag.hasMatch() || rematch_end_tag.hasMatch())); + } while (tags > 0 && (rematch_start_tag.hasMatch() || rematch_end_tag.hasMatch())); if (end_lyrics_idx != -1 && start_lyrics_idx < end_lyrics_idx) { if (!lyrics.isEmpty()) { @@ -163,8 +162,7 @@ QString HtmlLyricsProvider::ParseLyricsFromHTML(const QString &content, const QR lyrics.append(content.mid(start_lyrics_idx, end_lyrics_idx - start_lyrics_idx).remove(u'\r').remove(u'\n')); } - } - while (start_idx > 0 && multiple); + } while (start_idx > 0 && multiple); for (auto it = regex_removes.cbegin(); it != regex_removes.cend(); it++) { lyrics.remove(*it); diff --git a/src/lyrics/lyricfindlyricsprovider.cpp b/src/lyrics/lyricfindlyricsprovider.cpp index cebf79b04..2342b15e9 100644 --- a/src/lyrics/lyricfindlyricsprovider.cpp +++ b/src/lyrics/lyricfindlyricsprovider.cpp @@ -158,7 +158,7 @@ void LyricFindLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int Error(u"Missing response."_s); return; } - //const QJsonObject obj_response = obj[QLatin1String("response")].toObject(); + // const QJsonObject obj_response = obj[QLatin1String("response")].toObject(); if (!json_object.contains("track"_L1) || !json_object["track"_L1].isObject()) { Error(u"Missing track."_s); diff --git a/src/lyrics/lyricssearchrequest.h b/src/lyrics/lyricssearchrequest.h index b87b967eb..20b7d4d03 100644 --- a/src/lyrics/lyricssearchrequest.h +++ b/src/lyrics/lyricssearchrequest.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2018-2021, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2018-2021, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef LYRICSSEARCHREQUEST_H #define LYRICSSEARCHREQUEST_H diff --git a/src/lyrics/lyricssearchresult.h b/src/lyrics/lyricssearchresult.h index 7bd962252..68185ad3a 100644 --- a/src/lyrics/lyricssearchresult.h +++ b/src/lyrics/lyricssearchresult.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2018-2021, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2018-2021, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef LYRICSSEARCHRESULT_H #define LYRICSSEARCHRESULT_H diff --git a/src/lyrics/ovhlyricsprovider.cpp b/src/lyrics/ovhlyricsprovider.cpp index 5535e7574..9515340bc 100644 --- a/src/lyrics/ovhlyricsprovider.cpp +++ b/src/lyrics/ovhlyricsprovider.cpp @@ -141,6 +141,6 @@ void OVHLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, co else { qLog(Debug) << "OVHLyrics: Got lyrics for" << request.artist << request.title; results << LyricsSearchResult(Utilities::DecodeHtmlEntities(lyrics)); - } + } } diff --git a/src/lyrics/ovhlyricsprovider.h b/src/lyrics/ovhlyricsprovider.h index 9b309999f..95f5157a7 100644 --- a/src/lyrics/ovhlyricsprovider.h +++ b/src/lyrics/ovhlyricsprovider.h @@ -38,7 +38,7 @@ class OVHLyricsProvider : public JsonLyricsProvider { protected Q_SLOTS: void StartSearch(const int id, const LyricsSearchRequest &request) override; -private: + private: OVHLyricsProvider::JsonObjectResult ParseJsonObject(QNetworkReply *reply); private Q_SLOTS: diff --git a/src/main.cpp b/src/main.cpp index 6a0bfbe3a..e6ac8d42c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -282,7 +282,7 @@ int main(int argc, char *argv[]) { // Use system UI languages if (languages.isEmpty()) { #if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) - languages = QLocale::system().uiLanguages(QLocale::TagSeparator::Underscore); + languages = QLocale::system().uiLanguages(QLocale::TagSeparator::Underscore); #else const QStringList system_languages = QLocale::system().uiLanguages(); for (const QString &language : system_languages) { diff --git a/src/mpris2/mpris2.cpp b/src/mpris2/mpris2.cpp index d7b49c643..5aa6bbde5 100644 --- a/src/mpris2/mpris2.cpp +++ b/src/mpris2/mpris2.cpp @@ -251,7 +251,7 @@ void Mpris2::EmitNotification(const QString &name) { } -//------------------Root Interface--------------------------// +// ------------------Root Interface--------------------------// bool Mpris2::CanQuit() const { return true; } diff --git a/src/musicbrainz/musicbrainzclient.cpp b/src/musicbrainz/musicbrainzclient.cpp index 1caba4cc4..efa9e972e 100644 --- a/src/musicbrainz/musicbrainzclient.cpp +++ b/src/musicbrainz/musicbrainzclient.cpp @@ -524,4 +524,3 @@ MusicBrainzClient::ResultList MusicBrainzClient::UniqueResults(const ResultList return unique_results; } - diff --git a/src/musicbrainz/musicbrainzclient.h b/src/musicbrainz/musicbrainzclient.h index 8c36e44d2..322d6a937 100644 --- a/src/musicbrainz/musicbrainzclient.h +++ b/src/musicbrainz/musicbrainzclient.h @@ -62,7 +62,7 @@ class MusicBrainzClient : public JsonBaseRequest { Result() : duration_msec_(0), track_(0), year_(-1) {} bool operator<(const Result &other) const { - return std::tie(title_, artist_, sort_artist_, album_artist_, sort_album_artist_, album_, duration_msec_, track_, year_) + return std::tie(title_, artist_, sort_artist_, album_artist_, sort_album_artist_, album_, duration_msec_, track_, year_) < std::tie(other.title_, other.artist_, other.sort_artist_, other.album_artist_, other.sort_album_artist_, other.album_, other.duration_msec_, other.track_, other.year_); } diff --git a/src/organize/organizeformat.h b/src/organize/organizeformat.h index 34c6d7640..37472dbc7 100644 --- a/src/organize/organizeformat.h +++ b/src/organize/organizeformat.h @@ -58,7 +58,7 @@ class OrganizeFormat { QString filename; bool unique_filename; }; - GetFilenameForSongResult GetFilenameForSong(const Song& song, QString extension = QString()) const; + GetFilenameForSongResult GetFilenameForSong(const Song &song, QString extension = QString()) const; private: QString ParseBlock(QString block, const Song &song, bool *have_tagdata = nullptr, bool *any_empty = nullptr) const; diff --git a/src/osd/osddbus.cpp b/src/osd/osddbus.cpp index 50d617a18..75374c39e 100644 --- a/src/osd/osddbus.cpp +++ b/src/osd/osddbus.cpp @@ -193,4 +193,3 @@ void OSDDBus::CallFinished(QDBusPendingCallWatcher *watcher) { } } - diff --git a/src/playlist/playlistcontainer.cpp b/src/playlist/playlistcontainer.cpp index 0ca9139f8..57eac237d 100644 --- a/src/playlist/playlistcontainer.cpp +++ b/src/playlist/playlistcontainer.cpp @@ -505,7 +505,7 @@ bool PlaylistContainer::eventFilter(QObject *objectWatched, QEvent *event) { if (event->type() == QEvent::KeyPress) { QKeyEvent *e = static_cast(event); switch (e->key()) { - //case Qt::Key_Up: + // case Qt::Key_Up: case Qt::Key_Down: case Qt::Key_PageUp: case Qt::Key_PageDown: diff --git a/src/playlist/playlistlistsortfiltermodel.cpp b/src/playlist/playlistlistsortfiltermodel.cpp index 9a0607d3e..441b3081e 100644 --- a/src/playlist/playlistlistsortfiltermodel.cpp +++ b/src/playlist/playlistlistsortfiltermodel.cpp @@ -22,15 +22,15 @@ #include "playlistlistsortfiltermodel.h" PlaylistListSortFilterModel::PlaylistListSortFilterModel(QObject *parent) - : QSortFilterProxyModel(parent) {} + : QSortFilterProxyModel(parent) {} bool PlaylistListSortFilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const { - // Compare the display text first. - const int ret = left.data().toString().localeAwareCompare(right.data().toString()); - if (ret < 0) return true; - if (ret > 0) return false; + // Compare the display text first. + const int ret = left.data().toString().localeAwareCompare(right.data().toString()); + if (ret < 0) return true; + if (ret > 0) return false; - // Now use the source model row order to ensure we always get a deterministic sorting even when two items are named the same. - return left.row() < right.row(); + // Now use the source model row order to ensure we always get a deterministic sorting even when two items are named the same. + return left.row() < right.row(); } diff --git a/src/playlist/playlistlistview.cpp b/src/playlist/playlistlistview.cpp index 22d747b25..3dc261d5d 100644 --- a/src/playlist/playlistlistview.cpp +++ b/src/playlist/playlistlistview.cpp @@ -142,7 +142,7 @@ void PlaylistListView::dropEvent(QDropEvent *e) { Q_EMIT ItemMimeDataDroppedSignal(currentIndex(), e->mimeData()); } } - else { + else { AutoExpandingTreeView::dropEvent(e); } diff --git a/src/playlist/playlistsequence.cpp b/src/playlist/playlistsequence.cpp index 3f0f723b2..6b194ff96 100644 --- a/src/playlist/playlistsequence.cpp +++ b/src/playlist/playlistsequence.cpp @@ -234,11 +234,11 @@ void PlaylistSequence::CycleShuffleMode() { } -//called from global shortcut +// called from global shortcut void PlaylistSequence::CycleRepeatMode() { RepeatMode mode = RepeatMode::Off; - //we cycle through the repeat modes + // we cycle through the repeat modes switch (repeat_mode()) { case RepeatMode::Off: mode = RepeatMode::Track; break; case RepeatMode::Track: mode = RepeatMode::Album; break; diff --git a/src/playlist/playlisttabbar.cpp b/src/playlist/playlisttabbar.cpp index 2625731ec..1c3341009 100644 --- a/src/playlist/playlisttabbar.cpp +++ b/src/playlist/playlisttabbar.cpp @@ -127,7 +127,7 @@ void PlaylistTabBar::contextMenuEvent(QContextMenuEvent *e) { // We need to finish the renaming action before showing context menu if (rename_editor_->isVisible()) { - //discard any change + // discard any change HideEditor(); } @@ -231,11 +231,10 @@ void PlaylistTabBar::CloseSlot() { confirmation_box.setWindowIcon(QIcon(u":/icons/64x64/strawberry.png"_s)); confirmation_box.setWindowTitle(tr("Remove playlist")); confirmation_box.setIcon(QMessageBox::Question); - confirmation_box.setText( - tr("You are about to remove a playlist which is not part of your " - "favorite playlists: " - "the playlist will be deleted (this action cannot be undone). \n" - "Are you sure you want to continue?")); + confirmation_box.setText(tr("You are about to remove a playlist which is not part of your " + "favorite playlists: " + "the playlist will be deleted (this action cannot be undone). \n" + "Are you sure you want to continue?")); confirmation_box.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel); QCheckBox dont_prompt_again(tr("Warn me when closing a playlist tab"), &confirmation_box); diff --git a/src/qobuz/qobuzrequest.cpp b/src/qobuz/qobuzrequest.cpp index 514278e2f..8bee893a0 100644 --- a/src/qobuz/qobuzrequest.cpp +++ b/src/qobuz/qobuzrequest.cpp @@ -424,7 +424,7 @@ void QobuzRequest::ArtistsReplyReceived(QNetworkReply *reply, const int limit_re Error(u"Json artists object is missing values."_s, json_object); return; } - //int limit = obj_artists["limit"].toInt(); + // int limit = obj_artists["limit"].toInt(); offset = object_artists["offset"_L1].toInt(); int artists_total = object_artists["total"_L1].toInt(); @@ -648,7 +648,7 @@ void QobuzRequest::AlbumsReceived(QNetworkReply *reply, const Artist &artist_req return; } - //int limit = obj_albums["limit"].toInt(); + // int limit = obj_albums["limit"].toInt(); offset = object_albums["offset"_L1].toInt(); albums_total = object_albums["total"_L1].toInt(); @@ -936,7 +936,7 @@ void QobuzRequest::SongsReceived(QNetworkReply *reply, const Artist &artist_requ return; } - //int limit = obj_tracks["limit"].toInt(); + // int limit = obj_tracks["limit"].toInt(); const int offset = obj_tracks["offset"_L1].toInt(); songs_total = obj_tracks["total"_L1].toInt(); @@ -1050,7 +1050,7 @@ void QobuzRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti int disc = 0; QString copyright = json_obj["copyright"_L1].toString(); qint64 duration = json_obj["duration"_L1].toInt() * kNsecPerSec; - //bool streamable = json_obj["streamable"].toBool(); + // bool streamable = json_obj["streamable"].toBool(); QString composer; QString performer; @@ -1148,9 +1148,9 @@ void QobuzRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti performer = obj_performer["name"_L1].toString(); } - //if (!streamable) { - //Warn(QString("Song %1 %2 %3 is not streamable").arg(album_artist).arg(album).arg(title)); - //} + // if (!streamable) { + // Warn(QString("Song %1 %2 %3 is not streamable").arg(album_artist).arg(album).arg(title)); + // } QUrl url; url.setScheme(url_handler_->scheme()); @@ -1160,7 +1160,7 @@ void QobuzRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti title = Song::TitleRemoveMisc(title); } - //qLog(Debug) << "id" << song_id << "track" << track << "title" << title << "album" << album << "album artist" << album_artist << cover_url << streamable << url; + // qLog(Debug) << "id" << song_id << "track" << track << "title" << title << "album" << album << "album artist" << album_artist << cover_url << streamable << url; song.set_source(Song::Source::Qobuz); song.set_song_id(song_id); diff --git a/src/qobuz/qobuzservice.cpp b/src/qobuz/qobuzservice.cpp index fd796a47d..354bcb476 100644 --- a/src/qobuz/qobuzservice.cpp +++ b/src/qobuz/qobuzservice.cpp @@ -248,7 +248,7 @@ QString QobuzService::DecodeAppSecret(const QString &app_secret_base64) const { const QByteArray app_secret_binary = QByteArray::fromBase64(app_secret_base64.toUtf8()); QString app_secret_decoded; - for (int x = 0, y = 0; x < app_secret_binary.length(); ++x , ++y) { + for (int x = 0, y = 0; x < app_secret_binary.length(); ++x, ++y) { if (y == appid.length()) y = 0; const uint rc = static_cast(app_secret_binary[x] ^ appid[y]); if (rc > 0xFFFF) { @@ -296,7 +296,7 @@ void QobuzService::SendLoginWithCredentials(const QString &app_id, const QString QObject::connect(reply, &QNetworkReply::sslErrors, this, &QobuzService::HandleLoginSSLErrors); QObject::connect(reply, &QNetworkReply::finished, this, [this, reply]() { HandleAuthReply(reply); }); - //qLog(Debug) << "Qobuz: Sending request" << url << query; + // qLog(Debug) << "Qobuz: Sending request" << url << query; } diff --git a/src/radios/radioview.cpp b/src/radios/radioview.cpp index 36b36e4d9..aaa0285ec 100644 --- a/src/radios/radioview.cpp +++ b/src/radios/radioview.cpp @@ -184,4 +184,3 @@ void RadioView::Donate() { } } - diff --git a/src/scrobbler/lastfmimport.cpp b/src/scrobbler/lastfmimport.cpp index a4fba77ea..d680a36ae 100644 --- a/src/scrobbler/lastfmimport.cpp +++ b/src/scrobbler/lastfmimport.cpp @@ -118,7 +118,7 @@ QNetworkReply *LastFMImport::CreateRequest(const ParamList &request_params) { QNetworkReply *reply = CreateGetRequest(QUrl(QLatin1String(LastFMScrobbler::kApiUrl)), params); - //qLog(Debug) << "Sending request" << url_query.toString(QUrl::FullyDecoded); + // qLog(Debug) << "Sending request" << url_query.toString(QUrl::FullyDecoded); return reply; diff --git a/src/scrobbler/lastfmscrobbler.cpp b/src/scrobbler/lastfmscrobbler.cpp index 746758c30..0cb2a6011 100644 --- a/src/scrobbler/lastfmscrobbler.cpp +++ b/src/scrobbler/lastfmscrobbler.cpp @@ -643,7 +643,7 @@ void LastFMScrobbler::ScrobbleRequestFinished(QNetworkReply *reply, ScrobblerCac const QJsonValue value_album = json_track["album"_L1]; const QJsonValue value_song = json_track["track"_L1]; const QJsonValue value_ignoredmessage = json_track["ignoredMessage"_L1]; - //const quint64 timestamp = json_track[u"timestamp"_s].toVariant().toULongLong(); + // const quint64 timestamp = json_track[u"timestamp"_s].toVariant().toULongLong(); if (!value_artist.isObject() || !value_album.isObject() || !value_song.isObject() || !value_ignoredmessage.isObject()) { Error(u"Json scrobbles scrobble values are not objects."_s, json_track); @@ -664,8 +664,8 @@ void LastFMScrobbler::ScrobbleRequestFinished(QNetworkReply *reply, ScrobblerCac continue; } - //const QString artist = obj_artist["#text"].toString(); - //const QString album = obj_album["#text"].toString(); + // const QString artist = obj_artist["#text"].toString(); + // const QString album = obj_album["#text"].toString(); const QString song = object_song["#text"_L1].toString(); const bool ignoredmessage = object_ignoredmessage["code"_L1].toVariant().toBool(); const QString ignoredmessage_text = object_ignoredmessage["#text"_L1].toString(); @@ -800,8 +800,8 @@ void LastFMScrobbler::SingleScrobbleRequestFinished(QNetworkReply *reply, Scrobb return; } - //QString artist = json_obj_artist["#text"].toString(); - //QString album = json_obj_album["#text"].toString(); + // QString artist = json_obj_artist["#text"].toString(); + // QString album = json_obj_album["#text"].toString(); const QString song = json_object_song["#text"_L1].toString(); const int accepted = object_attr["accepted"_L1].toVariant().toInt(); @@ -839,7 +839,7 @@ void LastFMScrobbler::Love() { } QNetworkReply *reply = CreateRequest(params); - QObject::connect(reply, &QNetworkReply::finished, this, [this, reply] { LoveRequestFinished(reply); }); + QObject::connect(reply, &QNetworkReply::finished, this, [this, reply]{ LoveRequestFinished(reply); }); } diff --git a/src/scrobbler/scrobblemetadata.cpp b/src/scrobbler/scrobblemetadata.cpp index 98c5f05ab..933508e00 100644 --- a/src/scrobbler/scrobblemetadata.cpp +++ b/src/scrobbler/scrobblemetadata.cpp @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #include "core/song.h" diff --git a/src/scrobbler/scrobblemetadata.h b/src/scrobbler/scrobblemetadata.h index 9a72be3e3..e8e978c02 100644 --- a/src/scrobbler/scrobblemetadata.h +++ b/src/scrobbler/scrobblemetadata.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef SCROBBLEMETADATA_H #define SCROBBLEMETADATA_H diff --git a/src/scrobbler/scrobblercache.cpp b/src/scrobbler/scrobblercache.cpp index f4cce0759..768a67b3f 100644 --- a/src/scrobbler/scrobblercache.cpp +++ b/src/scrobbler/scrobblercache.cpp @@ -118,15 +118,13 @@ void ScrobblerCache::ReadCache() { continue; } QJsonObject json_obj_track = value.toObject(); - if ( - !json_obj_track.contains("timestamp"_L1) || + if (!json_obj_track.contains("timestamp"_L1) || !json_obj_track.contains("artist"_L1) || !json_obj_track.contains("album"_L1) || !json_obj_track.contains("title"_L1) || !json_obj_track.contains("track"_L1) || !json_obj_track.contains("albumartist"_L1) || - !json_obj_track.contains("length_nanosec"_L1) - ) { + !json_obj_track.contains("length_nanosec"_L1)) { qLog(Error) << "Scrobbler cache JSON tracks array value is missing data."; qLog(Debug) << value; continue; diff --git a/src/settings/appearancesettingspage.cpp b/src/settings/appearancesettingspage.cpp index b61756a5c..8dcf9bb27 100644 --- a/src/settings/appearancesettingspage.cpp +++ b/src/settings/appearancesettingspage.cpp @@ -339,4 +339,3 @@ void AppearanceSettingsPage::PlaylistPlayingSongSelectColor() { set_changed(); } - diff --git a/src/settings/behavioursettingspage.cpp b/src/settings/behavioursettingspage.cpp index 36b19ed37..96af5fd90 100644 --- a/src/settings/behavioursettingspage.cpp +++ b/src/settings/behavioursettingspage.cpp @@ -94,10 +94,7 @@ BehaviourSettingsPage::BehaviourSettingsPage(SettingsDialog *dialog, QWidget *pa if (!re_match.hasMatch()) continue; QString code = re_match.captured(1); - QString lookup_code = QString(code) - .replace("@latin"_L1, "_Latn"_L1) - .replace("_CN"_L1, "_Hans_CN"_L1) - .replace("_TW"_L1, "_Hant_TW"_L1); + QString lookup_code = QString(code).replace("@latin"_L1, "_Latn"_L1).replace("_CN"_L1, "_Hans_CN"_L1).replace("_TW"_L1, "_Hant_TW"_L1); QString language_name = QLocale::languageToString(QLocale(lookup_code).language()); QString native_name = QLocale(lookup_code).nativeLanguageName(); diff --git a/src/settings/settingspage.cpp b/src/settings/settingspage.cpp index 266be30f5..cd66ca455 100644 --- a/src/settings/settingspage.cpp +++ b/src/settings/settingspage.cpp @@ -207,4 +207,3 @@ bool SettingsPage::eventFilter(QObject *obj, QEvent *e) { return false; } - diff --git a/src/settings/subsonicsettingspage.cpp b/src/settings/subsonicsettingspage.cpp index bf7c5b55d..4907cd9d2 100644 --- a/src/settings/subsonicsettingspage.cpp +++ b/src/settings/subsonicsettingspage.cpp @@ -121,7 +121,7 @@ void SubsonicSettingsPage::Save() { else { s.setValue(kAuthMethod, static_cast(AuthMethod::MD5)); } - + ui_->checkbox_use_album_id_for_album_covers->setEnabled(ui_->checkbox_download_album_covers->isChecked()); s.endGroup(); diff --git a/src/smartplaylists/smartplaylistquerywizardpluginsortpage.cpp b/src/smartplaylists/smartplaylistquerywizardpluginsortpage.cpp index 6ae026c93..6755b939b 100644 --- a/src/smartplaylists/smartplaylistquerywizardpluginsortpage.cpp +++ b/src/smartplaylists/smartplaylistquerywizardpluginsortpage.cpp @@ -22,7 +22,7 @@ #include "smartplaylistquerywizardpluginsortpage.h" SmartPlaylistQueryWizardPluginSortPage::SmartPlaylistQueryWizardPluginSortPage(SmartPlaylistQueryWizardPlugin *plugin, QWidget *parent, const int next_id) - : QWizardPage(parent), next_id_(next_id), plugin_(plugin) {} + : QWizardPage(parent), next_id_(next_id), plugin_(plugin) {} void SmartPlaylistQueryWizardPluginSortPage::showEvent(QShowEvent *e) { diff --git a/src/smartplaylists/smartplaylistsearch.cpp b/src/smartplaylists/smartplaylistsearch.cpp index 02a812c4d..882ec0880 100644 --- a/src/smartplaylists/smartplaylistsearch.cpp +++ b/src/smartplaylists/smartplaylistsearch.cpp @@ -100,7 +100,7 @@ QString SmartPlaylistSearch::ToSql(const QString &songs_table) const { else if (limit_ != -1) { sql += " LIMIT "_L1 + QString::number(limit_); } - //qLog(Debug) << sql; + // qLog(Debug) << sql; return sql; diff --git a/src/smartplaylists/smartplaylistwizardfinishpage.h b/src/smartplaylists/smartplaylistwizardfinishpage.h index 52f340e1f..799096f39 100644 --- a/src/smartplaylists/smartplaylistwizardfinishpage.h +++ b/src/smartplaylists/smartplaylistwizardfinishpage.h @@ -39,4 +39,3 @@ class SmartPlaylistWizardFinishPage : public QWizardPage { }; #endif // SMARTPLAYLISTWIZARDFINISHPAGE_H - diff --git a/src/smartplaylists/smartplaylistwizardtypepage.h b/src/smartplaylists/smartplaylistwizardtypepage.h index 5fa1caa38..82e68763b 100644 --- a/src/smartplaylists/smartplaylistwizardtypepage.h +++ b/src/smartplaylists/smartplaylistwizardtypepage.h @@ -34,4 +34,3 @@ class SmartPlaylistWizardTypePage : public QWizardPage { }; #endif // SMARTPLAYLISTWIZARDTYPEPAGE_H - diff --git a/src/spotify/spotifyrequest.cpp b/src/spotify/spotifyrequest.cpp index 250a2a71e..8c76821ed 100644 --- a/src/spotify/spotifyrequest.cpp +++ b/src/spotify/spotifyrequest.cpp @@ -816,14 +816,12 @@ void SpotifyRequest::AlbumsFinishCheck(const Artist &artist, const int limit, co } } - if ( - artists_requests_queue_.isEmpty() && + if (artists_requests_queue_.isEmpty() && artists_requests_active_ <= 0 && albums_requests_queue_.isEmpty() && albums_requests_active_ <= 0 && artist_albums_requests_queue_.isEmpty() && - artist_albums_requests_active_ <= 0 - ) { // Artist albums query is finished, get all songs for all albums. + artist_albums_requests_active_ <= 0) { // Artist albums query is finished, get all songs for all albums. // Get songs for all the albums. @@ -1018,7 +1016,7 @@ void SpotifyRequest::SongsFinishCheck(const Artist &artist, const Album &album, AddSongsSearchRequest(offset_next); break; } - // fallthrough + // fallthrough case Type::FavouriteArtists: case Type::SearchArtists: case Type::FavouriteAlbums: @@ -1039,15 +1037,13 @@ void SpotifyRequest::SongsFinishCheck(const Artist &artist, const Album &album, void SpotifyRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Artist &album_artist, const Album &album) { - if ( - !json_obj.contains("type"_L1) || + if (!json_obj.contains("type"_L1) || !json_obj.contains("id"_L1) || !json_obj.contains("name"_L1) || !json_obj.contains("uri"_L1) || !json_obj.contains("duration_ms"_L1) || !json_obj.contains("track_number"_L1) || - !json_obj.contains("disc_number"_L1) - ) { + !json_obj.contains("disc_number"_L1)) { Error(u"Invalid Json reply, track is missing one or more values."_s, json_obj); return; } @@ -1058,13 +1054,13 @@ void SpotifyRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Ar const QJsonArray array_artists = json_obj["artists"_L1].toArray(); for (const QJsonValue &value_artist : array_artists) { if (!value_artist.isObject()) continue; - QJsonObject obj_artist = value_artist.toObject(); - if (!obj_artist.contains("type"_L1) || !obj_artist.contains("id"_L1) || !obj_artist.contains("name"_L1)) { - continue; - } - artist_id = obj_artist["id"_L1].toString(); - artist_title = obj_artist["name"_L1].toString(); - break; + QJsonObject obj_artist = value_artist.toObject(); + if (!obj_artist.contains("type"_L1) || !obj_artist.contains("id"_L1) || !obj_artist.contains("name"_L1)) { + continue; + } + artist_id = obj_artist["id"_L1].toString(); + artist_title = obj_artist["name"_L1].toString(); + break; } } @@ -1145,8 +1141,7 @@ void SpotifyRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Ar void SpotifyRequest::GetAlbumCoversCheck() { - if ( - !finished_ && + if (!finished_ && service_->download_album_covers() && IsQuery() && artists_requests_queue_.isEmpty() && @@ -1163,8 +1158,7 @@ void SpotifyRequest::GetAlbumCoversCheck() { songs_requests_active_ <= 0 && artist_albums_requests_active_ <= 0 && album_songs_requests_active_ <= 0 && - album_covers_requests_active_ <= 0 - ) { + album_covers_requests_active_ <= 0) { GetAlbumCovers(); } @@ -1306,8 +1300,7 @@ void SpotifyRequest::AlbumCoverFinishCheck() { void SpotifyRequest::FinishCheck() { - if ( - !finished_ && + if (!finished_ && artists_requests_queue_.isEmpty() && albums_requests_queue_.isEmpty() && songs_requests_queue_.isEmpty() && @@ -1322,8 +1315,7 @@ void SpotifyRequest::FinishCheck() { songs_requests_active_ <= 0 && artist_albums_requests_active_ <= 0 && album_songs_requests_active_ <= 0 && - album_covers_requests_active_ <= 0 - ) { + album_covers_requests_active_ <= 0) { if (timer_flush_requests_->isActive()) { timer_flush_requests_->stop(); } diff --git a/src/spotify/spotifyservice.cpp b/src/spotify/spotifyservice.cpp index ea066c630..05ebed46c 100644 --- a/src/spotify/spotifyservice.cpp +++ b/src/spotify/spotifyservice.cpp @@ -430,7 +430,7 @@ void SpotifyService::SendSearch() { type = SpotifyBaseRequest::Type::SearchSongs; break; default: - //Error("Invalid search type."); + // Error("Invalid search type."); return; } diff --git a/src/streaming/streamingservices.h b/src/streaming/streamingservices.h index 7b6aca031..832df5bb0 100644 --- a/src/streaming/streamingservices.h +++ b/src/streaming/streamingservices.h @@ -45,7 +45,7 @@ class StreamingServices : public QObject { SharedPtr ServiceBySource(const Song::Source source) const; - template + template SharedPtr Service() { return std::static_pointer_cast(ServiceBySource(T::kSource)); } diff --git a/src/streaming/streamingtabsview.h b/src/streaming/streamingtabsview.h index 3a268342b..c676d77a7 100644 --- a/src/streaming/streamingtabsview.h +++ b/src/streaming/streamingtabsview.h @@ -73,7 +73,7 @@ class StreamingTabsView : public QWidget { void OpenSettingsDialog(const Song::Source source); private: - const SharedPtr service_; + const SharedPtr service_; QString settings_group_; Ui_StreamingTabsView *ui_; }; diff --git a/src/subsonic/subsonicbaserequest.cpp b/src/subsonic/subsonicbaserequest.cpp index 0662027b6..a5c82f536 100644 --- a/src/subsonic/subsonicbaserequest.cpp +++ b/src/subsonic/subsonicbaserequest.cpp @@ -116,7 +116,7 @@ QNetworkReply *SubsonicBaseRequest::CreateGetRequest(const QString &ressource_na QNetworkReply *reply = network_->get(network_request); QObject::connect(reply, &QNetworkReply::sslErrors, this, &SubsonicBaseRequest::HandleSSLErrors); - //qLog(Debug) << "Subsonic: Sending request" << url; + // qLog(Debug) << "Subsonic: Sending request" << url; return reply; @@ -184,7 +184,7 @@ JsonBaseRequest::JsonObjectResult SubsonicBaseRequest::ParseJsonObject(QNetworkR } if (reply->error() == QNetworkReply::AuthenticationRequiredError) { - //service_->ClearSession(); + // service_->ClearSession(); } return result; diff --git a/src/subsonic/subsonicrequest.cpp b/src/subsonic/subsonicrequest.cpp index fbae03a79..05c2e788a 100644 --- a/src/subsonic/subsonicrequest.cpp +++ b/src/subsonic/subsonicrequest.cpp @@ -421,15 +421,13 @@ void SubsonicRequest::SongsFinishCheck() { if (!album_songs_requests_queue_.isEmpty() && album_songs_requests_active_ < kMaxConcurrentAlbumSongsRequests) FlushAlbumSongsRequests(); - if ( - download_album_covers() && + if (download_album_covers() && album_songs_requests_queue_.isEmpty() && album_songs_requests_active_ <= 0 && album_cover_requests_queue_.isEmpty() && album_covers_received_ <= 0 && album_covers_requests_sent_.isEmpty() && - album_songs_received_ >= album_songs_requested_ - ) { + album_songs_received_ >= album_songs_requested_) { GetAlbumCovers(); } @@ -442,14 +440,12 @@ QString SubsonicRequest::ParseSong(Song &song, const QJsonObject &json_object, c Q_UNUSED(artist_id_requested); Q_UNUSED(album_id_requested); - if ( - !json_object.contains("id"_L1) || + if (!json_object.contains("id"_L1) || !json_object.contains("title"_L1) || !json_object.contains("size"_L1) || !json_object.contains("suffix"_L1) || !json_object.contains("duration"_L1) || - !json_object.contains("type"_L1) - ) { + !json_object.contains("type"_L1)) { Error(u"Invalid Json reply, song is missing one or more values."_s, json_object); return QString(); } @@ -813,8 +809,7 @@ void SubsonicRequest::AlbumCoverFinishCheck() { void SubsonicRequest::FinishCheck() { - if ( - !finished_ && + if (!finished_ && albums_requests_queue_.isEmpty() && album_songs_requests_queue_.isEmpty() && album_cover_requests_queue_.isEmpty() && @@ -824,8 +819,7 @@ void SubsonicRequest::FinishCheck() { album_songs_requests_active_ <= 0 && album_songs_received_ >= album_songs_requested_ && album_covers_requests_active_ <= 0 && - album_covers_received_ >= album_covers_requested_ - ) { + album_covers_received_ >= album_covers_requested_) { finished_ = true; if (no_results_ && songs_.isEmpty()) { Q_EMIT Results(SongMap(), QString()); diff --git a/src/subsonic/subsonicservice.cpp b/src/subsonic/subsonicservice.cpp index dc357db6b..c28aba53f 100644 --- a/src/subsonic/subsonicservice.cpp +++ b/src/subsonic/subsonicservice.cpp @@ -202,7 +202,7 @@ void SubsonicService::SendPingWithCredentials(QUrl url, const QString &username, QObject::connect(reply, &QNetworkReply::sslErrors, this, &SubsonicService::HandlePingSSLErrors); QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, url, username, password, auth_method]() { HandlePingReply(reply, url, username, password, auth_method); }); - //qLog(Debug) << "Subsonic: Sending request" << url << url.query(); + // qLog(Debug) << "Subsonic: Sending request" << url << url.query(); } @@ -332,7 +332,7 @@ void SubsonicService::HandlePingReply(QNetworkReply *reply, const QUrl &url, con PingError(u"Authentication error reply from server is missing status or message"_s, json_obj); return; } - //int status = obj_error["code"].toInt(); + // int status = obj_error["code"].toInt(); QString message = obj_error["message"_L1].toString(); Q_EMIT TestComplete(false, message); Q_EMIT TestFailure(message); diff --git a/src/systemtrayicon/macsystemtrayicon.h b/src/systemtrayicon/macsystemtrayicon.h index d08626cf0..3b04ba2cb 100644 --- a/src/systemtrayicon/macsystemtrayicon.h +++ b/src/systemtrayicon/macsystemtrayicon.h @@ -1,5 +1,5 @@ /* - *Strawberry Music Player + * Strawberry Music Player * This file was part of Clementine. * Copyright 2010, David Sansome * Copyright 2018-2025, Jonas Kvinge diff --git a/src/systemtrayicon/qtsystemtrayicon.cpp b/src/systemtrayicon/qtsystemtrayicon.cpp index 2d62f7010..ad8bcd075 100644 --- a/src/systemtrayicon/qtsystemtrayicon.cpp +++ b/src/systemtrayicon/qtsystemtrayicon.cpp @@ -87,8 +87,8 @@ void SystemTrayIcon::InitPixmaps() { } if (pixmap_playing_.isNull() || pixmap_playing_.devicePixelRatioF() != device_pixel_ratio_) { - pixmap_playing_ = icon_playing_.pixmap(icon_playing_.availableSizes().at(0)); - pixmap_playing_.setDevicePixelRatio(device_pixel_ratio_); + pixmap_playing_ = icon_playing_.pixmap(icon_playing_.availableSizes().at(0)); + pixmap_playing_.setDevicePixelRatio(device_pixel_ratio_); } if (pixmap_paused_.isNull() || pixmap_paused_.devicePixelRatioF() != device_pixel_ratio_) { diff --git a/src/tidal/tidalrequest.cpp b/src/tidal/tidalrequest.cpp index a02ebb6ef..1bec92942 100644 --- a/src/tidal/tidalrequest.cpp +++ b/src/tidal/tidalrequest.cpp @@ -398,7 +398,7 @@ void TidalRequest::ArtistsReplyReceived(QNetworkReply *reply, const int limit_re Error(u"Json object missing values."_s, json_object); return; } - //int limit = json_object["limit"].toInt(); + // int limit = json_object["limit"].toInt(); offset = json_object["offset"_L1].toInt(); const int artists_total = json_object["totalNumberOfItems"_L1].toInt(); @@ -591,7 +591,7 @@ void TidalRequest::AlbumsReceived(QNetworkReply *reply, const Artist &artist_req return; } - //int limit = json_obj["limit"].toInt(); + // int limit = json_obj["limit"].toInt(); offset = json_object["offset"_L1].toInt(); albums_total = json_object["totalNumberOfItems"_L1].toInt(); @@ -706,10 +706,10 @@ void TidalRequest::AlbumsReceived(QNetworkReply *reply, const Artist &artist_req } album_artist.artist = obj_artist["name"_L1].toString(); - //QString quality = obj_item["audioQuality"].toString(); - //QString copyright = obj_item["copyright"].toString(); + // QString quality = obj_item["audioQuality"].toString(); + // QString copyright = obj_item["copyright"].toString(); - //qLog(Debug) << "Tidal:" << artist << album << quality << copyright; + // qLog(Debug) << "Tidal:" << artist << album << quality << copyright; AlbumSongsRequest request; request.artist = album_artist; @@ -749,14 +749,12 @@ void TidalRequest::AlbumsFinishCheck(const Artist &artist, const int limit, cons } } - if ( - artists_requests_queue_.isEmpty() && + if (artists_requests_queue_.isEmpty() && artists_requests_active_ <= 0 && albums_requests_queue_.isEmpty() && albums_requests_active_ <= 0 && artist_albums_requests_queue_.isEmpty() && - artist_albums_requests_active_ <= 0 - ) { // Artist albums query is finished, get all songs for all albums. + artist_albums_requests_active_ <= 0) { // Artist albums query is finished, get all songs for all albums. // Get songs for all the albums. @@ -865,7 +863,7 @@ void TidalRequest::SongsReceived(QNetworkReply *reply, const Artist &artist, con return; } - //int limit = json_obj["limit"].toInt(); + // int limit = json_obj["limit"].toInt(); const int offset = json_object["offset"_L1].toInt(); songs_total = json_object["totalNumberOfItems"_L1].toInt(); @@ -964,8 +962,7 @@ void TidalRequest::SongsFinishCheck(const Artist &artist, const Album &album, co void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Artist &album_artist, const Album &album) { - if ( - !json_obj.contains("album"_L1) || + if (!json_obj.contains("album"_L1) || !json_obj.contains("allowStreaming"_L1) || !json_obj.contains("artist"_L1) || !json_obj.contains("artists"_L1) || @@ -977,8 +974,7 @@ void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti !json_obj.contains("trackNumber"_L1) || !json_obj.contains("url"_L1) || !json_obj.contains("volumeNumber"_L1) || - !json_obj.contains("copyright"_L1) - ) { + !json_obj.contains("copyright"_L1)) { Error(u"Invalid Json reply, track is missing one or more values."_s, json_obj); return; } @@ -986,7 +982,7 @@ void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti const QJsonValue value_artist = json_obj["artist"_L1]; const QJsonValue value_album = json_obj["album"_L1]; const QJsonValue json_duration = json_obj["duration"_L1]; - //const QJsonArray array_artists = json_obj["artists"].toArray(); + // const QJsonArray array_artists = json_obj["artists"].toArray(); QString song_id; if (json_obj["id"_L1].isString()) { @@ -997,7 +993,7 @@ void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti } QString title = json_obj["title"_L1].toString(); - //const QString urlstr = json_obj["url"].toString(); + // const QString urlstr = json_obj["url"].toString(); const int track = json_obj["trackNumber"_L1].toInt(); const int disc = json_obj["volumeNumber"_L1].toInt(); const bool allow_streaming = json_obj["allowStreaming"_L1].toBool(); @@ -1081,7 +1077,7 @@ void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti title = Song::TitleRemoveMisc(title); } - //qLog(Debug) << "id" << song_id << "track" << track << "disc" << disc << "title" << title << "album" << album << "album artist" << album_artist << "artist" << artist << cover << allow_streaming << url; + // qLog(Debug) << "id" << song_id << "track" << track << "disc" << disc << "title" << title << "album" << album << "album artist" << album_artist << "artist" << artist << cover << allow_streaming << url; song.set_source(Song::Source::Tidal); song.set_song_id(song_id); @@ -1110,8 +1106,7 @@ void TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const Arti void TidalRequest::GetAlbumCoversCheck() { - if ( - !finished_ && + if (!finished_ && service_->download_album_covers() && IsQuery() && artists_requests_queue_.isEmpty() && @@ -1128,8 +1123,7 @@ void TidalRequest::GetAlbumCoversCheck() { songs_requests_active_ <= 0 && artist_albums_requests_active_ <= 0 && album_songs_requests_active_ <= 0 && - album_covers_requests_active_ <= 0 - ) { + album_covers_requests_active_ <= 0) { GetAlbumCovers(); } @@ -1274,8 +1268,7 @@ void TidalRequest::AlbumCoverFinishCheck() { void TidalRequest::FinishCheck() { - if ( - !finished_ && + if (!finished_ && artists_requests_queue_.isEmpty() && albums_requests_queue_.isEmpty() && songs_requests_queue_.isEmpty() && @@ -1290,8 +1283,7 @@ void TidalRequest::FinishCheck() { songs_requests_active_ <= 0 && artist_albums_requests_active_ <= 0 && album_songs_requests_active_ <= 0 && - album_covers_requests_active_ <= 0 - ) { + album_covers_requests_active_ <= 0) { if (timer_flush_requests_->isActive()) { timer_flush_requests_->stop(); } diff --git a/src/tidal/tidalservice.cpp b/src/tidal/tidalservice.cpp index 3370dec3b..f0849d79c 100644 --- a/src/tidal/tidalservice.cpp +++ b/src/tidal/tidalservice.cpp @@ -451,7 +451,7 @@ void TidalService::SendSearch() { query_type = TidalBaseRequest::Type::SearchSongs; break; default: - //Error("Invalid search type."); + // Error("Invalid search type."); return; } diff --git a/src/tidal/tidalstreamurlrequest.h b/src/tidal/tidalstreamurlrequest.h index 6cce3356d..6964c8b7d 100644 --- a/src/tidal/tidalstreamurlrequest.h +++ b/src/tidal/tidalstreamurlrequest.h @@ -58,7 +58,7 @@ class TidalStreamURLRequest : public TidalBaseRequest { private Q_SLOTS: void StreamURLReceived(); -private: + private: static QList ParseUrls(const QJsonObject &json_object); private: diff --git a/src/utilities/colorutils.cpp b/src/utilities/colorutils.cpp index 4a19d8185..12228b25b 100644 --- a/src/utilities/colorutils.cpp +++ b/src/utilities/colorutils.cpp @@ -26,11 +26,7 @@ namespace Utilities { QString ColorToRgba(const QColor &c) { - return QStringLiteral("rgba(%1, %2, %3, %4)") - .arg(c.red()) - .arg(c.green()) - .arg(c.blue()) - .arg(c.alpha()); + return QStringLiteral("rgba(%1, %2, %3, %4)").arg(c.red()).arg(c.green()).arg(c.blue()).arg(c.alpha()); } diff --git a/src/utilities/coveroptions.cpp b/src/utilities/coveroptions.cpp index f6aa3f1b1..5df409a7a 100644 --- a/src/utilities/coveroptions.cpp +++ b/src/utilities/coveroptions.cpp @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #include "coveroptions.h" diff --git a/src/utilities/coveroptions.h b/src/utilities/coveroptions.h index 845aeaf11..c2a5dd5d4 100644 --- a/src/utilities/coveroptions.h +++ b/src/utilities/coveroptions.h @@ -1,21 +1,21 @@ /* -* Strawberry Music Player -* Copyright 2023, Jonas Kvinge -* -* Strawberry is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Strawberry is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Strawberry. If not, see . -* -*/ + * Strawberry Music Player + * Copyright 2023, Jonas Kvinge + * + * Strawberry is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Strawberry is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Strawberry. If not, see . + * + */ #ifndef COVEROPTIONS_H #define COVEROPTIONS_H diff --git a/src/utilities/sqlhelper.h b/src/utilities/sqlhelper.h index 54aa4dc8a..1749186c6 100644 --- a/src/utilities/sqlhelper.h +++ b/src/utilities/sqlhelper.h @@ -26,29 +26,29 @@ class SqlHelper { public: - template + template static QString ValueToString(const T &q, const int n); - template + template static QUrl ValueToUrl(const T &q, const int n); - template + template static int ValueToInt(const T &q, const int n); - template + template static uint ValueToUInt(const T &q, const int n); - template + template static qint64 ValueToLongLong(const T &q, const int n); - template + template static float ValueToFloat(const T &q, const int n); - template + template static bool ValueToBool(const T &q, const int n); }; -template +template QString SqlHelper::ValueToString(const T &q, const int n) { Q_ASSERT(n < q.count()); @@ -57,7 +57,7 @@ QString SqlHelper::ValueToString(const T &q, const int n) { } -template +template QUrl SqlHelper::ValueToUrl(const T &q, const int n) { Q_ASSERT(n < q.count()); @@ -66,7 +66,7 @@ QUrl SqlHelper::ValueToUrl(const T &q, const int n) { } -template +template int SqlHelper::ValueToInt(const T &q, const int n) { Q_ASSERT(n < q.count()); @@ -75,7 +75,7 @@ int SqlHelper::ValueToInt(const T &q, const int n) { } -template +template uint SqlHelper::ValueToUInt(const T &q, const int n) { Q_ASSERT(n < q.count()); @@ -84,7 +84,7 @@ uint SqlHelper::ValueToUInt(const T &q, const int n) { } -template +template qint64 SqlHelper::ValueToLongLong(const T &q, const int n) { Q_ASSERT(n < q.count()); @@ -93,7 +93,7 @@ qint64 SqlHelper::ValueToLongLong(const T &q, const int n) { } -template +template float SqlHelper::ValueToFloat(const T &q, const int n) { Q_ASSERT(n < q.count()); @@ -102,7 +102,7 @@ float SqlHelper::ValueToFloat(const T &q, const int n) { } -template +template bool SqlHelper::ValueToBool(const T &q, const int n) { Q_ASSERT(n < q.count()); diff --git a/src/widgets/autoexpandingtreeview.cpp b/src/widgets/autoexpandingtreeview.cpp index 323c332d9..96b35f967 100644 --- a/src/widgets/autoexpandingtreeview.cpp +++ b/src/widgets/autoexpandingtreeview.cpp @@ -129,7 +129,7 @@ void AutoExpandingTreeView::mousePressEvent(QMouseEvent *event) { QTreeView::mousePressEvent(event); - //enqueue to playlist with middleClick + // enqueue to playlist with middleClick if (event->button() == Qt::MiddleButton) { QMimeData *q_mimedata = model()->mimeData(selectedIndexes()); if (MimeData *mimedata = qobject_cast(q_mimedata)) { diff --git a/src/widgets/clickablelabel.cpp b/src/widgets/clickablelabel.cpp index db2dc5614..be91d9a5d 100644 --- a/src/widgets/clickablelabel.cpp +++ b/src/widgets/clickablelabel.cpp @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include "clickablelabel.h" diff --git a/src/widgets/clickablelabel.h b/src/widgets/clickablelabel.h index d06aa27c9..c229d7efc 100644 --- a/src/widgets/clickablelabel.h +++ b/src/widgets/clickablelabel.h @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef CLICKABLELABEL_H #define CLICKABLELABEL_H diff --git a/src/widgets/fancytabbar.cpp b/src/widgets/fancytabbar.cpp index 2c71cd3d4..9e70825f5 100644 --- a/src/widgets/fancytabbar.cpp +++ b/src/widgets/fancytabbar.cpp @@ -43,9 +43,9 @@ namespace { constexpr int TabSize_LargeSidebarMinWidth = 70; } // namespace -FancyTabBar::FancyTabBar(QWidget *parent) : - QTabBar(parent), - mouseHoverTabIndex(-1) { +FancyTabBar::FancyTabBar(QWidget *parent) + : QTabBar(parent), + mouseHoverTabIndex(-1) { setMouseTracking(true); @@ -180,7 +180,7 @@ void FancyTabBar::paintEvent(QPaintEvent *pe) { QLinearGradient grad(selectionRect.topLeft(), selectionRect.topRight()); grad.setColorAt(0, QColor(255, 255, 255, 140)); grad.setColorAt(1, QColor(255, 255, 255, 210)); - p.fillRect(selectionRect.adjusted(0,0,0,-1), grad); + p.fillRect(selectionRect.adjusted(0, 0, 0, -1), grad); p.restore(); // shadow lines diff --git a/src/widgets/fancytabwidget.cpp b/src/widgets/fancytabwidget.cpp index f4a861f71..4df931102 100644 --- a/src/widgets/fancytabwidget.cpp +++ b/src/widgets/fancytabwidget.cpp @@ -91,7 +91,7 @@ void FancyTabWidget::LoadSettings(const QString &settings_group) { Settings s; s.beginGroup(settings_group); - QMultiMap tabs; + QMultiMap tabs; for (FancyTabData *tab : std::as_const(tabs_)) { int idx = s.value(u"tab_"_s + tab->name(), tab->index()).toInt(); while (tabs.contains(idx)) { ++idx; } diff --git a/src/widgets/forcescrollperpixel.cpp b/src/widgets/forcescrollperpixel.cpp index 3e365318d..328a1fb6f 100644 --- a/src/widgets/forcescrollperpixel.cpp +++ b/src/widgets/forcescrollperpixel.cpp @@ -32,7 +32,7 @@ ForceScrollPerPixel::ForceScrollPerPixel(QAbstractItemView *item_view, QObject * bool ForceScrollPerPixel::eventFilter(QObject *object, QEvent *event) { if (object == item_view_ && event->type() != QEvent::Destroy && event->type() != QEvent::WinIdChange) { - //event->type() != QEvent::AccessibilityPrepare) + // event->type() != QEvent::AccessibilityPrepare) item_view_->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); item_view_->verticalScrollBar()->setSingleStep(20); } diff --git a/src/widgets/groupediconview.cpp b/src/widgets/groupediconview.cpp index 04dbf3862..42be3e03d 100644 --- a/src/widgets/groupediconview.cpp +++ b/src/widgets/groupediconview.cpp @@ -233,7 +233,7 @@ QModelIndex GroupedIconView::indexAt(const QPoint &p) const { const QPoint viewport_p = p + QPoint(horizontalOffset(), verticalOffset()); const int count = static_cast(visual_rects_.count()); - for (int i = 0; iindex(i, 0); } @@ -265,7 +265,7 @@ void GroupedIconView::paintEvent(QPaintEvent *e) { const QItemSelectionModel *selections = selectionModel(); const bool focus = (hasFocus() || viewport()->hasFocus()) && current.isValid(); const QStyle::State opt_state = option.state; - const bool enabled = (opt_state & QStyle::State_Enabled) != 0; + const bool enabled = (opt_state &QStyle::State_Enabled) != 0; int maxSize = (flow() == TopToBottom) ? viewport()->size().width() - 2 * spacing() : viewport()->size().height() - 2 * spacing(); @@ -381,10 +381,10 @@ QModelIndex GroupedIconView::moveCursor(CursorAction action, const Qt::KeyboardM switch (action) { case MoveUp: ret = IndexAboveOrBelow(ret, -1); break; case MovePrevious: - case MoveLeft: ret --; break; + case MoveLeft: ret--; break; case MoveDown: ret = IndexAboveOrBelow(ret, +1); break; case MoveNext: - case MoveRight: ret ++; break; + case MoveRight: ret++; break; case MovePageUp: case MoveHome: ret = 0; break; case MovePageDown: diff --git a/src/widgets/loginstatewidget.cpp b/src/widgets/loginstatewidget.cpp index 3f1328978..a74067f40 100644 --- a/src/widgets/loginstatewidget.cpp +++ b/src/widgets/loginstatewidget.cpp @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #include "loginstatewidget.h" #include "ui_loginstatewidget.h" diff --git a/src/widgets/loginstatewidget.h b/src/widgets/loginstatewidget.h index 4e0148ed4..f6d4d116a 100644 --- a/src/widgets/loginstatewidget.h +++ b/src/widgets/loginstatewidget.h @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with Strawberry. If not, see . -*/ + */ #ifndef LOGINSTATEWIDGET_H #define LOGINSTATEWIDGET_H diff --git a/src/widgets/playingwidget.cpp b/src/widgets/playingwidget.cpp index 1f35da57c..2945bc540 100644 --- a/src/widgets/playingwidget.cpp +++ b/src/widgets/playingwidget.cpp @@ -497,7 +497,7 @@ void PlayingWidget::FadePreviousTrack(const qreal value) { void PlayingWidget::resizeEvent(QResizeEvent *e) { - //if (visible_ && e->oldSize() != e->size()) { + // if (visible_ && e->oldSize() != e->size()) { if (e->oldSize() != e->size()) { if (mode_ == Mode::LargeSongDetails) { UpdateHeight(); diff --git a/src/widgets/prettyslider.cpp b/src/widgets/prettyslider.cpp index 0bde5e9fe..4625803bb 100644 --- a/src/widgets/prettyslider.cpp +++ b/src/widgets/prettyslider.cpp @@ -1,23 +1,23 @@ /*************************************************************************** prettyslider.cpp ------------------- - begin : Dec 15 2003 - copyright : (C) 2003 by Mark Kretschmann - email : markey@web.de - copyright : (C) 2005 by Gábor Lehel - email : illissius@gmail.com - copyright : (C) 2018-2023 by Jonas Kvinge - email : jonas@jkvinge.net - ***************************************************************************/ + begin : Dec 15 2003 + copyright : (C) 2003 by Mark Kretschmann + email : markey@web.de + copyright : (C) 2005 by Gábor Lehel + email : illissius@gmail.com + copyright : (C) 2018-2023 by Jonas Kvinge + email : jonas@jkvinge.net +***************************************************************************/ /*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ #include #include diff --git a/src/widgets/prettyslider.h b/src/widgets/prettyslider.h index 2e11114f6..f7e007ea2 100644 --- a/src/widgets/prettyslider.h +++ b/src/widgets/prettyslider.h @@ -1,23 +1,23 @@ /*************************************************************************** prettyslider.h ------------------- - begin : Dec 15 2003 - copyright : (C) 2003 by Mark Kretschmann - email : markey@web.de - copyright : (C) 2005 by Gábor Lehel - email : illissius@gmail.com - copyright : (C) 2018-2023 by Jonas Kvinge - email : jonas@jkvinge.net - ***************************************************************************/ + begin : Dec 15 2003 + copyright : (C) 2003 by Mark Kretschmann + email : markey@web.de + copyright : (C) 2005 by Gábor Lehel + email : illissius@gmail.com + copyright : (C) 2018-2023 by Jonas Kvinge + email : jonas@jkvinge.net +***************************************************************************/ /*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ #ifndef PRETTYSLIDER_H #define PRETTYSLIDER_H diff --git a/src/widgets/renametablineedit.cpp b/src/widgets/renametablineedit.cpp index 9b3730700..1fc25ebb0 100644 --- a/src/widgets/renametablineedit.cpp +++ b/src/widgets/renametablineedit.cpp @@ -44,8 +44,8 @@ void RenameTabLineEdit::focusOutEvent(QFocusEvent *e) { Q_UNUSED(e); - //if the user hasn't explicitly accepted, discard the value + // if the user hasn't explicitly accepted, discard the value Q_EMIT EditingCanceled(); - //we don't call the default event since it will trigger editingFished() + // we don't call the default event since it will trigger editingFished() } diff --git a/src/widgets/searchfield_qt_private.cpp b/src/widgets/searchfield_qt_private.cpp index 4ae0b2f8f..d18fa5977 100644 --- a/src/widgets/searchfield_qt_private.cpp +++ b/src/widgets/searchfield_qt_private.cpp @@ -29,7 +29,7 @@ THE SOFTWARE. #include "searchfield.h" SearchFieldPrivate::SearchFieldPrivate(SearchField *searchField, QLineEdit *lineedit, QPushButton *clearbutton) - : QObject(searchField), lineedit_(lineedit), clearbutton_(clearbutton) {} + : QObject(searchField), lineedit_(lineedit), clearbutton_(clearbutton) {} int SearchFieldPrivate::lineEditFrameWidth() const { return lineedit_->style()->pixelMetric(QStyle::PM_DefaultFrameWidth); diff --git a/src/widgets/sliderslider.cpp b/src/widgets/sliderslider.cpp index 6dd357683..33a7a3371 100644 --- a/src/widgets/sliderslider.cpp +++ b/src/widgets/sliderslider.cpp @@ -1,23 +1,23 @@ /*************************************************************************** sliderslider.cpp ------------------- - begin : Dec 15 2003 - copyright : (C) 2003 by Mark Kretschmann - email : markey@web.de - copyright : (C) 2005 by Gábor Lehel - email : illissius@gmail.com - copyright : (C) 2018-2023 by Jonas Kvinge - email : jonas@jkvinge.net - ***************************************************************************/ + begin : Dec 15 2003 + copyright : (C) 2003 by Mark Kretschmann + email : markey@web.de + copyright : (C) 2005 by Gábor Lehel + email : illissius@gmail.com + copyright : (C) 2018-2023 by Jonas Kvinge + email : jonas@jkvinge.net +***************************************************************************/ /*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ #include #include diff --git a/src/widgets/sliderslider.h b/src/widgets/sliderslider.h index 18e2cb0b6..60d5a27dc 100644 --- a/src/widgets/sliderslider.h +++ b/src/widgets/sliderslider.h @@ -1,23 +1,23 @@ /*************************************************************************** sliderslider.h ------------------- - begin : Dec 15 2003 - copyright : (C) 2003 by Mark Kretschmann - email : markey@web.de - copyright : (C) 2005 by Gábor Lehel - email : illissius@gmail.com - copyright : (C) 2018-2023 by Jonas Kvinge - email : jonas@jkvinge.net - ***************************************************************************/ + begin : Dec 15 2003 + copyright : (C) 2003 by Mark Kretschmann + email : markey@web.de + copyright : (C) 2005 by Gábor Lehel + email : illissius@gmail.com + copyright : (C) 2018-2023 by Jonas Kvinge + email : jonas@jkvinge.net +***************************************************************************/ /*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ #ifndef SLIDERSLIDER_H #define SLIDERSLIDER_H diff --git a/src/widgets/volumeslider.cpp b/src/widgets/volumeslider.cpp index 35f124d81..e3c44b203 100644 --- a/src/widgets/volumeslider.cpp +++ b/src/widgets/volumeslider.cpp @@ -1,23 +1,23 @@ /*************************************************************************** volumeslider.cpp ------------------- - begin : Dec 15 2003 - copyright : (C) 2003 by Mark Kretschmann - email : markey@web.de - copyright : (C) 2005 by Gábor Lehel - email : illissius@gmail.com - copyright : (C) 2018-2023 by Jonas Kvinge - email : jonas@jkvinge.net - ***************************************************************************/ + begin : Dec 15 2003 + copyright : (C) 2003 by Mark Kretschmann + email : markey@web.de + copyright : (C) 2005 by Gábor Lehel + email : illissius@gmail.com + copyright : (C) 2018-2023 by Jonas Kvinge + email : jonas@jkvinge.net +***************************************************************************/ /*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ #include #include diff --git a/src/widgets/volumeslider.h b/src/widgets/volumeslider.h index 022ccf564..8b7d9b134 100644 --- a/src/widgets/volumeslider.h +++ b/src/widgets/volumeslider.h @@ -1,23 +1,23 @@ /*************************************************************************** volumeslider.h ------------------- - begin : Dec 15 2003 - copyright : (C) 2003 by Mark Kretschmann - email : markey@web.de - copyright : (C) 2005 by Gábor Lehel - email : illissius@gmail.com - copyright : (C) 2018-2023 by Jonas Kvinge - email : jonas@jkvinge.net - ***************************************************************************/ + begin : Dec 15 2003 + copyright : (C) 2003 by Mark Kretschmann + email : markey@web.de + copyright : (C) 2005 by Gábor Lehel + email : illissius@gmail.com + copyright : (C) 2018-2023 by Jonas Kvinge + email : jonas@jkvinge.net +***************************************************************************/ /*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ #ifndef VOLUMESLIDER_H #define VOLUMESLIDER_H diff --git a/tests/src/collectionbackend_test.cpp b/tests/src/collectionbackend_test.cpp index 8a5f1d816..f6acd88a0 100644 --- a/tests/src/collectionbackend_test.cpp +++ b/tests/src/collectionbackend_test.cpp @@ -441,7 +441,7 @@ class UpdateSongsBySongID : public CollectionBackendTest { TEST_F(UpdateSongsBySongID, UpdateSongsBySongID) { - const QStringList song_ids = QStringList() << u"song1"_s + const QStringList song_ids = QStringList() << u"song1"_s << u"song2"_s << u"song3"_s << u"song4"_s diff --git a/tests/src/collectionmodel_test.cpp b/tests/src/collectionmodel_test.cpp index 71404630f..286c06b45 100644 --- a/tests/src/collectionmodel_test.cpp +++ b/tests/src/collectionmodel_test.cpp @@ -203,8 +203,8 @@ TEST_F(CollectionModelTest, UnknownAlbums) { TEST_F(CollectionModelTest, VariousArtistSongs) { SongList songs; - for (int i=0 ; i < 4 ; ++i) { - QString n = QString::number(i+1); + for (int i = 0 ; i < 4 ; ++i) { + QString n = QString::number(i + 1); Song song; song.Init(u"Title "_s + n, u"Artist "_s + n, u"Album"_s, 0); song.set_mtime(0); @@ -218,7 +218,7 @@ TEST_F(CollectionModelTest, VariousArtistSongs) { songs[2].set_compilation_on(true); songs[3].set_compilation_detected(true); songs[3].set_artist(u"Various Artists"_s); - for (int i=0 ; i < 4 ; ++i) + for (int i = 0 ; i < 4 ; ++i) AddSong(songs[i]); QModelIndex artist_index = model_->index(0, 0, QModelIndex()); diff --git a/tests/src/concurrentrun_test.cpp b/tests/src/concurrentrun_test.cpp index 9b817e7e4..e69a78345 100644 --- a/tests/src/concurrentrun_test.cpp +++ b/tests/src/concurrentrun_test.cpp @@ -87,19 +87,19 @@ TEST(ConcurrentRunTest, ConcurrentRun3StartAndWait) { } -void aFunction(int* n); -void aFunction(int* n) { +void aFunction(int *n); +void aFunction(int *n) { *n = 1337; } -void bFunction(int* n, int *m); -void bFunction(int* n, int *m) { +void bFunction(int *n, int *m); +void bFunction(int *n, int *m) { aFunction(n); *m = 1338; } -void cFunction(int* n, int *m, int *o); -void cFunction(int* n, int *m, int *o) { +void cFunction(int *n, int *m, int *o); +void cFunction(int *n, int *m, int *o) { bFunction(n, m); *o = 1339; } @@ -154,7 +154,7 @@ TEST(ConcurrentRunTest, ConcurrentRunVoidFunction3Start) { class A { public: - void f(int* i) { + void f(int *i) { *i = *i + 1; } }; diff --git a/tests/src/main.cpp b/tests/src/main.cpp index 2e856d6a7..d1d14f150 100644 --- a/tests/src/main.cpp +++ b/tests/src/main.cpp @@ -30,7 +30,7 @@ #include "metatypes_env.h" #include "resources_env.h" -int main(int argc, char** argv) { +int main(int argc, char **argv) { testing::InitGoogleMock(&argc, argv); diff --git a/tests/src/mergedproxymodel_test.cpp b/tests/src/mergedproxymodel_test.cpp index 2571ed93c..844897a58 100644 --- a/tests/src/mergedproxymodel_test.cpp +++ b/tests/src/mergedproxymodel_test.cpp @@ -60,8 +60,8 @@ TEST_F(MergedProxyModelTest, Flat) { TEST_F(MergedProxyModelTest, Tree) { - QStandardItem* one = new QStandardItem(u"one"_s); - QStandardItem* two = new QStandardItem(u"two"_s); + QStandardItem *one = new QStandardItem(u"one"_s); + QStandardItem *two = new QStandardItem(u"two"_s); source_.appendRow(one); one->appendRow(two); diff --git a/tests/src/mock_networkaccessmanager.cpp b/tests/src/mock_networkaccessmanager.cpp index b1be83c30..9594b6581 100644 --- a/tests/src/mock_networkaccessmanager.cpp +++ b/tests/src/mock_networkaccessmanager.cpp @@ -41,13 +41,13 @@ using ::testing::Return; class RequestForUrlMatcher : public MatcherInterface { public: - RequestForUrlMatcher(const QString& contains, const QMap &expected_params) + RequestForUrlMatcher(const QString &contains, const QMap &expected_params) : contains_(contains), expected_params_(expected_params) {} ~RequestForUrlMatcher() override = default; - virtual bool Matches(const QNetworkRequest& req) const { - const QUrl& url = req.url(); + virtual bool Matches(const QNetworkRequest &req) const { + const QUrl &url = req.url(); if (!url.toString().contains(contains_)) { return false; @@ -62,12 +62,12 @@ class RequestForUrlMatcher : public MatcherInterface { return true; } - bool MatchAndExplain(const QNetworkRequest& req, MatchResultListener* listener) const override { + bool MatchAndExplain(const QNetworkRequest &req, MatchResultListener *listener) const override { *listener << "which is " << req.url().toString().toUtf8().constData(); return Matches(req); } - void DescribeTo(::std::ostream* os) const override { + void DescribeTo(::std::ostream *os) const override { *os << "matches url"; } @@ -83,12 +83,12 @@ inline Matcher RequestForUrl(const QString &contains, co return MakeMatcher(new RequestForUrlMatcher(contains, params)); } -MockNetworkReply* MockNetworkAccessManager::ExpectGet(const QString &contains, const QMap &expected_params, int status, const QByteArray &data) { +MockNetworkReply *MockNetworkAccessManager::ExpectGet(const QString &contains, const QMap &expected_params, int status, const QByteArray &data) { - MockNetworkReply* reply = new MockNetworkReply(data); + MockNetworkReply *reply = new MockNetworkReply(data); reply->setAttribute(QNetworkRequest::HttpStatusCodeAttribute, status); - EXPECT_CALL(*this, createRequest(GetOperation, RequestForUrl(contains, expected_params), nullptr)). WillOnce(Return(reply)); + EXPECT_CALL(*this, createRequest(GetOperation, RequestForUrl(contains, expected_params), nullptr)).WillOnce(Return(reply)); return reply; diff --git a/tests/src/mock_networkaccessmanager.h b/tests/src/mock_networkaccessmanager.h index ed328ca4c..1baa66698 100644 --- a/tests/src/mock_networkaccessmanager.h +++ b/tests/src/mock_networkaccessmanager.h @@ -53,8 +53,8 @@ class MockNetworkReply : public QNetworkReply { protected: MOCK_METHOD0(abort, void()); // clazy:exclude=returning-void-expression,function-args-by-value - qint64 readData(char* data, qint64) override; - qint64 writeData(const char* data, qint64) override; + qint64 readData(char *data, qint64) override; + qint64 writeData(const char *data, qint64) override; QByteArray data_; qint64 pos_; @@ -68,7 +68,7 @@ class MockNetworkAccessManager : public QNetworkAccessManager { const QString& contains, // A string that should be present in the URL. const QMap& params, // Required URL parameters. int status, // Returned HTTP status code. - const QByteArray& ret_data); // Returned data. + const QByteArray &ret_data); // Returned data. protected: MOCK_METHOD3(createRequest, QNetworkReply*(Operation, const QNetworkRequest&, QIODevice*)); // clazy:exclude=function-args-by-value }; diff --git a/tests/src/organizeformat_test.cpp b/tests/src/organizeformat_test.cpp index bb65e56ab..1c4203f41 100644 --- a/tests/src/organizeformat_test.cpp +++ b/tests/src/organizeformat_test.cpp @@ -35,7 +35,7 @@ using namespace Qt::Literals::StringLiterals; // clazy:excludeall=returning-void-expression class OrganizeFormatTest : public ::testing::Test { -protected: + protected: OrganizeFormat format_; Song song_; }; diff --git a/tests/src/playlist_test.cpp b/tests/src/playlist_test.cpp index 368572609..26dd201d0 100644 --- a/tests/src/playlist_test.cpp +++ b/tests/src/playlist_test.cpp @@ -44,8 +44,8 @@ namespace { class PlaylistTest : public ::testing::Test { protected: PlaylistTest() - : playlist_(nullptr, nullptr, nullptr, nullptr, nullptr, 1), - sequence_(nullptr, new DummySettingsProvider) {} + : playlist_(nullptr, nullptr, nullptr, nullptr, nullptr, 1), + sequence_(nullptr, new DummySettingsProvider) {} void SetUp() override { playlist_.set_sequence(&sequence_); @@ -439,7 +439,7 @@ TEST_F(PlaylistTest, ShuffleThenNext) { // Add 100 items PlaylistItemPtrList items; items.reserve(100); - for (int i=0 ; i<100 ; ++i) + for (int i = 0 ; i < 100 ; ++i) items << MakeMockItemP(u"Item "_s + QString::number(i)); playlist_.InsertItems(items); @@ -448,7 +448,7 @@ TEST_F(PlaylistTest, ShuffleThenNext) { // Shuffle until the current index is not at the end Q_FOREVER { playlist_.Shuffle(); - if (playlist_.current_row() != items.count()-1) + if (playlist_.current_row() != items.count() - 1) break; } @@ -456,21 +456,21 @@ TEST_F(PlaylistTest, ShuffleThenNext) { EXPECT_EQ(u"Item 0"_s, playlist_.current_item()->EffectiveMetadata().title()); EXPECT_EQ(u"Item 0"_s, playlist_.data(playlist_.index(index, static_cast(Playlist::Column::Title)))); EXPECT_EQ(index, playlist_.last_played_row()); - //EXPECT_EQ(index + 1, playlist_.next_row()); + // EXPECT_EQ(index + 1, playlist_.next_row()); // Shuffle until the current index *is* at the end - //forever { - //playlist_.Shuffle(); - //if (playlist_.current_row() == items.count()-1) - //break; - //} + // forever { + // playlist_.Shuffle(); + // if (playlist_.current_row() == items.count()-1) + // break; + // } index = playlist_.current_row(); EXPECT_EQ(u"Item 0"_s, playlist_.current_item()->EffectiveMetadata().title()); EXPECT_EQ(u"Item 0"_s, playlist_.data(playlist_.index(index, static_cast(Playlist::Column::Title)))); EXPECT_EQ(index, playlist_.last_played_row()); - //EXPECT_EQ(-1, playlist_.next_row()); - //EXPECT_EQ(index-1, playlist_.previous_row()); + // EXPECT_EQ(-1, playlist_.next_row()); + // EXPECT_EQ(index-1, playlist_.previous_row()); } diff --git a/tests/src/songplaylistitem_test.cpp b/tests/src/songplaylistitem_test.cpp index eb6ee9e62..eeb3e52f1 100644 --- a/tests/src/songplaylistitem_test.cpp +++ b/tests/src/songplaylistitem_test.cpp @@ -70,8 +70,7 @@ INSTANTIATE_TEST_SUITE_P(RealFiles, SongPlaylistItemTest, testing::Values( // c "normalfile.flac", "file with spaces.flac", "file with # hash.flac", - "file with ? question.flac" -)); + "file with ? question.flac")); TEST_P(SongPlaylistItemTest, Url) { QUrl expected; @@ -82,5 +81,4 @@ TEST_P(SongPlaylistItemTest, Url) { } -} //namespace - +} // namespace diff --git a/tests/src/tagreader_test.cpp b/tests/src/tagreader_test.cpp index ef2a17c04..fe74fad31 100644 --- a/tests/src/tagreader_test.cpp +++ b/tests/src/tagreader_test.cpp @@ -232,7 +232,7 @@ TEST_F(TagReaderTest, TestFLACAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Write new tags @@ -281,7 +281,7 @@ TEST_F(TagReaderTest, TestFLACAudioFileTagging) { EXPECT_EQ(21, song.track()); EXPECT_EQ(4321, song.disc()); EXPECT_EQ(9102, song.year()); - //EXPECT_EQ(9102, song.originalyear()); + // EXPECT_EQ(9102, song.originalyear()); } { // Write original tags @@ -330,7 +330,7 @@ TEST_F(TagReaderTest, TestFLACAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Compare checksums @@ -344,7 +344,7 @@ TEST_F(TagReaderTest, TestFLACAudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum, sha256sum_notags); + // EXPECT_EQ(sha256sum, sha256sum_notags); } } @@ -421,7 +421,7 @@ TEST_F(TagReaderTest, TestWavPackAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Write new tags @@ -458,7 +458,7 @@ TEST_F(TagReaderTest, TestWavPackAudioFileTagging) { EXPECT_EQ(21, song.track()); EXPECT_EQ(4321, song.disc()); EXPECT_EQ(9102, song.year()); - //EXPECT_EQ(9102, song.originalyear()); + // EXPECT_EQ(9102, song.originalyear()); } { // Write original tags @@ -495,7 +495,7 @@ TEST_F(TagReaderTest, TestWavPackAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Compare checksums @@ -509,7 +509,7 @@ TEST_F(TagReaderTest, TestWavPackAudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum, sha256sum_notags); + // EXPECT_EQ(sha256sum, sha256sum_notags); } } @@ -586,7 +586,7 @@ TEST_F(TagReaderTest, TestOggFLACAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Write new tags @@ -623,7 +623,7 @@ TEST_F(TagReaderTest, TestOggFLACAudioFileTagging) { EXPECT_EQ(21, song.track()); EXPECT_EQ(4321, song.disc()); EXPECT_EQ(9102, song.year()); - //EXPECT_EQ(9102, song.originalyear()); + // EXPECT_EQ(9102, song.originalyear()); } { // Write original tags @@ -660,7 +660,7 @@ TEST_F(TagReaderTest, TestOggFLACAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Compare checksums @@ -674,7 +674,7 @@ TEST_F(TagReaderTest, TestOggFLACAudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum, sha256sum_notags); + // EXPECT_EQ(sha256sum, sha256sum_notags); } } @@ -751,7 +751,7 @@ TEST_F(TagReaderTest, TestOggVorbisAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Write new tags @@ -787,7 +787,7 @@ TEST_F(TagReaderTest, TestOggVorbisAudioFileTagging) { EXPECT_EQ(21, song.track()); EXPECT_EQ(4321, song.disc()); EXPECT_EQ(9102, song.year()); - //EXPECT_EQ(9102, song.originalyear()); + // EXPECT_EQ(9102, song.originalyear()); } { // Write original tags @@ -824,7 +824,7 @@ TEST_F(TagReaderTest, TestOggVorbisAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Compare checksums @@ -838,7 +838,7 @@ TEST_F(TagReaderTest, TestOggVorbisAudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum, sha256sum_notags); + // EXPECT_EQ(sha256sum, sha256sum_notags); } } @@ -915,7 +915,7 @@ TEST_F(TagReaderTest, TestOggOpusAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Write new tags @@ -952,7 +952,7 @@ TEST_F(TagReaderTest, TestOggOpusAudioFileTagging) { EXPECT_EQ(21, song.track()); EXPECT_EQ(4321, song.disc()); EXPECT_EQ(9102, song.year()); - //EXPECT_EQ(9102, song.originalyear()); + // EXPECT_EQ(9102, song.originalyear()); } { // Write original tags @@ -989,7 +989,7 @@ TEST_F(TagReaderTest, TestOggOpusAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Compare checksums @@ -1003,7 +1003,7 @@ TEST_F(TagReaderTest, TestOggOpusAudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum, sha256sum_notags); + // EXPECT_EQ(sha256sum, sha256sum_notags); } } @@ -1080,7 +1080,7 @@ TEST_F(TagReaderTest, TestOggSpeexAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Write new tags @@ -1117,7 +1117,7 @@ TEST_F(TagReaderTest, TestOggSpeexAudioFileTagging) { EXPECT_EQ(21, song.track()); EXPECT_EQ(4321, song.disc()); EXPECT_EQ(9102, song.year()); - //EXPECT_EQ(9102, song.originalyear()); + // EXPECT_EQ(9102, song.originalyear()); } { // Write original tags @@ -1154,7 +1154,7 @@ TEST_F(TagReaderTest, TestOggSpeexAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Compare checksums @@ -1168,7 +1168,7 @@ TEST_F(TagReaderTest, TestOggSpeexAudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum, sha256sum_notags); + // EXPECT_EQ(sha256sum, sha256sum_notags); } } @@ -1235,17 +1235,17 @@ TEST_F(TagReaderTest, TestAIFFAudioFileTagging) { EXPECT_EQ(u"strawberry title"_s, song.title()); EXPECT_EQ(u"strawberry artist"_s, song.artist()); EXPECT_EQ(u"strawberry album"_s, song.album()); - //EXPECT_EQ(u"strawberry album artist"_s, song.albumartist()); - //EXPECT_EQ(u"strawberry composer"_s, song.composer()); - //EXPECT_EQ(u"strawberry performer"_s, song.performer()); - //EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); + // EXPECT_EQ(u"strawberry album artist"_s, song.albumartist()); + // EXPECT_EQ(u"strawberry composer"_s, song.composer()); + // EXPECT_EQ(u"strawberry performer"_s, song.performer()); + // EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); EXPECT_EQ(u"strawberry genre"_s, song.genre()); EXPECT_EQ(u"strawberry comment"_s, song.comment()); - //EXPECT_EQ(u"strawberry lyrics"_s, song.lyrics()); + // EXPECT_EQ(u"strawberry lyrics"_s, song.lyrics()); EXPECT_EQ(12, song.track()); - //EXPECT_EQ(1234, song.disc()); + // EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Write new tags @@ -1272,17 +1272,17 @@ TEST_F(TagReaderTest, TestAIFFAudioFileTagging) { EXPECT_EQ(u"new title"_s, song.title()); EXPECT_EQ(u"new artist"_s, song.artist()); EXPECT_EQ(u"new album"_s, song.album()); - //EXPECT_EQ(u"new album artist"_s, song.albumartist()); - //EXPECT_EQ(u"new composer"_s, song.composer()); - //EXPECT_EQ(u"new performer"_s, song.performer()); - //EXPECT_EQ(u"new grouping"_s, song.grouping()); + // EXPECT_EQ(u"new album artist"_s, song.albumartist()); + // EXPECT_EQ(u"new composer"_s, song.composer()); + // EXPECT_EQ(u"new performer"_s, song.performer()); + // EXPECT_EQ(u"new grouping"_s, song.grouping()); EXPECT_EQ(u"new genre"_s, song.genre()); EXPECT_EQ(u"new comment"_s, song.comment()); - //EXPECT_EQ(u"new lyrics"_s, song.lyrics()); + // EXPECT_EQ(u"new lyrics"_s, song.lyrics()); EXPECT_EQ(21, song.track()); - //EXPECT_EQ(4321, song.disc()); + // EXPECT_EQ(4321, song.disc()); EXPECT_EQ(9102, song.year()); - //EXPECT_EQ(9102, song.originalyear()); + // EXPECT_EQ(9102, song.originalyear()); } { // Write original tags @@ -1309,17 +1309,17 @@ TEST_F(TagReaderTest, TestAIFFAudioFileTagging) { EXPECT_EQ(u"strawberry title"_s, song.title()); EXPECT_EQ(u"strawberry artist"_s, song.artist()); EXPECT_EQ(u"strawberry album"_s, song.album()); - //EXPECT_EQ(u"strawberry album artist"_s, song.albumartist()); - //EXPECT_EQ(u"strawberry composer"_s, song.composer()); - //EXPECT_EQ(u"strawberry performer"_s, song.performer()); - //EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); + // EXPECT_EQ(u"strawberry album artist"_s, song.albumartist()); + // EXPECT_EQ(u"strawberry composer"_s, song.composer()); + // EXPECT_EQ(u"strawberry performer"_s, song.performer()); + // EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); EXPECT_EQ(u"strawberry genre"_s, song.genre()); EXPECT_EQ(u"strawberry comment"_s, song.comment()); - //EXPECT_EQ(u"strawberry lyrics"_s, song.lyrics()); + // EXPECT_EQ(u"strawberry lyrics"_s, song.lyrics()); EXPECT_EQ(12, song.track()); - //EXPECT_EQ(1234, song.disc()); + // EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Compare checksums @@ -1402,8 +1402,8 @@ TEST_F(TagReaderTest, TestASFAudioFileTagging) { EXPECT_EQ(u"strawberry album"_s, song.album()); EXPECT_EQ(u"strawberry album artist"_s, song.albumartist()); EXPECT_EQ(u"strawberry composer"_s, song.composer()); - //EXPECT_EQ(u"strawberry performer"_s, song.performer()); - //EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); + // EXPECT_EQ(u"strawberry performer"_s, song.performer()); + // EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); EXPECT_EQ(u"strawberry genre"_s, song.genre()); EXPECT_EQ(u"strawberry comment"_s, song.comment()); EXPECT_EQ(u"strawberry lyrics"_s, song.lyrics()); @@ -1440,8 +1440,8 @@ TEST_F(TagReaderTest, TestASFAudioFileTagging) { EXPECT_EQ(u"new album"_s, song.album()); EXPECT_EQ(u"new album artist"_s, song.albumartist()); EXPECT_EQ(u"new composer"_s, song.composer()); - //EXPECT_EQ(u"new performer"_s, song.performer()); - //EXPECT_EQ(u"new grouping"_s, song.grouping()); + // EXPECT_EQ(u"new performer"_s, song.performer()); + // EXPECT_EQ(u"new grouping"_s, song.grouping()); EXPECT_EQ(u"new genre"_s, song.genre()); EXPECT_EQ(u"new comment"_s, song.comment()); EXPECT_EQ(u"new lyrics"_s, song.lyrics()); @@ -1477,8 +1477,8 @@ TEST_F(TagReaderTest, TestASFAudioFileTagging) { EXPECT_EQ(u"strawberry album"_s, song.album()); EXPECT_EQ(u"strawberry album artist"_s, song.albumartist()); EXPECT_EQ(u"strawberry composer"_s, song.composer()); - //EXPECT_EQ(u"strawberry performer"_s, song.performer()); - //EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); + // EXPECT_EQ(u"strawberry performer"_s, song.performer()); + // EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); EXPECT_EQ(u"strawberry genre"_s, song.genre()); EXPECT_EQ(u"strawberry comment"_s, song.comment()); EXPECT_EQ(u"strawberry lyrics"_s, song.lyrics()); @@ -1491,7 +1491,7 @@ TEST_F(TagReaderTest, TestASFAudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum_tags, sha256sum); + // EXPECT_EQ(sha256sum_tags, sha256sum); } WriteSongToFile(orig_song, r.fileName()); @@ -1499,7 +1499,7 @@ TEST_F(TagReaderTest, TestASFAudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum, sha256sum_notags); + // EXPECT_EQ(sha256sum, sha256sum_notags); } } @@ -1586,7 +1586,7 @@ TEST_F(TagReaderTest, TestMP3AudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Write new tags @@ -1633,7 +1633,7 @@ TEST_F(TagReaderTest, TestMP3AudioFileTagging) { EXPECT_EQ(u"new lyrics"_s, song.lyrics()); EXPECT_EQ(21, song.track()); EXPECT_EQ(9102, song.year()); - //EXPECT_EQ(9102, song.originalyear()); + // EXPECT_EQ(9102, song.originalyear()); } { // Write original tags @@ -1680,7 +1680,7 @@ TEST_F(TagReaderTest, TestMP3AudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Compare checksums @@ -1694,7 +1694,7 @@ TEST_F(TagReaderTest, TestMP3AudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum, sha256sum_notags); + // EXPECT_EQ(sha256sum, sha256sum_notags); } } @@ -1763,7 +1763,7 @@ TEST_F(TagReaderTest, TestM4AAudioFileTagging) { EXPECT_EQ(u"strawberry album"_s, song.album()); EXPECT_EQ(u"strawberry album artist"_s, song.albumartist()); EXPECT_EQ(u"strawberry composer"_s, song.composer()); - //EXPECT_EQ(u"strawberry performer"_s, song.performer()); + // EXPECT_EQ(u"strawberry performer"_s, song.performer()); EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); EXPECT_EQ(u"strawberry genre"_s, song.genre()); EXPECT_EQ(u"strawberry comment"_s, song.comment()); @@ -1771,7 +1771,7 @@ TEST_F(TagReaderTest, TestM4AAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Write new tags @@ -1800,7 +1800,7 @@ TEST_F(TagReaderTest, TestM4AAudioFileTagging) { EXPECT_EQ(u"new album"_s, song.album()); EXPECT_EQ(u"new album artist"_s, song.albumartist()); EXPECT_EQ(u"new composer"_s, song.composer()); - //EXPECT_EQ(u"new performer"_s, song.performer()); + // EXPECT_EQ(u"new performer"_s, song.performer()); EXPECT_EQ(u"new grouping"_s, song.grouping()); EXPECT_EQ(u"new genre"_s, song.genre()); EXPECT_EQ(u"new comment"_s, song.comment()); @@ -1808,7 +1808,7 @@ TEST_F(TagReaderTest, TestM4AAudioFileTagging) { EXPECT_EQ(21, song.track()); EXPECT_EQ(4321, song.disc()); EXPECT_EQ(9102, song.year()); - //EXPECT_EQ(9102, song.originalyear()); + // EXPECT_EQ(9102, song.originalyear()); } { // Write original tags @@ -1837,7 +1837,7 @@ TEST_F(TagReaderTest, TestM4AAudioFileTagging) { EXPECT_EQ(u"strawberry album"_s, song.album()); EXPECT_EQ(u"strawberry album artist"_s, song.albumartist()); EXPECT_EQ(u"strawberry composer"_s, song.composer()); - //EXPECT_EQ(u"strawberry performer"_s, song.performer()); + // EXPECT_EQ(u"strawberry performer"_s, song.performer()); EXPECT_EQ(u"strawberry grouping"_s, song.grouping()); EXPECT_EQ(u"strawberry genre"_s, song.genre()); EXPECT_EQ(u"strawberry comment"_s, song.comment()); @@ -1845,13 +1845,13 @@ TEST_F(TagReaderTest, TestM4AAudioFileTagging) { EXPECT_EQ(12, song.track()); EXPECT_EQ(1234, song.disc()); EXPECT_EQ(2019, song.year()); - //EXPECT_EQ(2019, song.originalyear()); + // EXPECT_EQ(2019, song.originalyear()); } { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum_tags, sha256sum); + // EXPECT_EQ(sha256sum_tags, sha256sum); } WriteSongToFile(orig_song, r.fileName()); @@ -1859,7 +1859,7 @@ TEST_F(TagReaderTest, TestM4AAudioFileTagging) { { // Compare checksums QString sha256sum = SHA256SUM(r.fileName()); EXPECT_FALSE(sha256sum.isEmpty()); - //EXPECT_EQ(sha256sum, sha256sum_notags); + // EXPECT_EQ(sha256sum, sha256sum_notags); } } diff --git a/tests/src/test_utils.cpp b/tests/src/test_utils.cpp index 055db979f..4fb567203 100644 --- a/tests/src/test_utils.cpp +++ b/tests/src/test_utils.cpp @@ -35,17 +35,17 @@ std::ostream &operator<<(std::ostream &stream, const QString &str) { return stream; } -std::ostream &operator <<(std::ostream &stream, const QUrl &url) { +std::ostream &operator<<(std::ostream &stream, const QUrl &url) { stream << url.toString().toStdString(); return stream; } -std::ostream &operator <<(std::ostream &stream, const QNetworkRequest &req) { +std::ostream &operator<<(std::ostream &stream, const QNetworkRequest &req) { stream << req.url().toString().toStdString(); return stream; } -std::ostream &operator <<(std::ostream &stream, const QVariant &var) { +std::ostream &operator<<(std::ostream &stream, const QVariant &var) { stream << var.toString().toStdString(); return stream; } @@ -78,8 +78,8 @@ TemporaryResource::TemporaryResource(const QString &filename, QObject *parent) : } TestQObject::TestQObject(QObject *parent) - : QObject(parent), - invoked_(0) { + : QObject(parent), + invoked_(0) { } void TestQObject::Emit() { diff --git a/tests/src/test_utils.h b/tests/src/test_utils.h index 7a78ab872..2880dabe1 100644 --- a/tests/src/test_utils.h +++ b/tests/src/test_utils.h @@ -32,24 +32,24 @@ class QString; class QUrl; class QVariant; -std::ostream& operator <<(std::ostream& stream, const QString& str); -std::ostream& operator <<(std::ostream& stream, const QVariant& var); -std::ostream& operator <<(std::ostream& stream, const QUrl& url); -std::ostream& operator <<(std::ostream& stream, const QNetworkRequest& req); +std::ostream &operator<<(std::ostream &stream, const QString &str); +std::ostream &operator<<(std::ostream &stream, const QVariant &var); +std::ostream &operator<<(std::ostream &stream, const QUrl &url); +std::ostream &operator<<(std::ostream &stream, const QNetworkRequest &req); -template -std::ostream& operator <<(std::ostream& stream, const QList& list) { +template +std::ostream &operator<<(std::ostream &stream, const QList &list) { stream << "QList("; - for (const T& item : list) { + for (const T &item : list) { stream << item << ","; } stream << ")"; return stream; } -void PrintTo(const ::QString& str, std::ostream& os); -void PrintTo(const ::QVariant& var, std::ostream& os); -void PrintTo(const ::QUrl& url, std::ostream& os); +void PrintTo(const ::QString &str, std::ostream &os); +void PrintTo(const ::QVariant &var, std::ostream &os); +void PrintTo(const ::QUrl &url, std::ostream &os); #define EXPOSE_SIGNAL0(n) \ void Emit##n() { emit n(); }