Use anonymous namespace for constants

This commit is contained in:
Jonas Kvinge
2024-08-07 00:52:58 +02:00
parent c69777ca39
commit 819463a865
67 changed files with 186 additions and 240 deletions

View File

@@ -35,7 +35,9 @@
using namespace std::chrono_literals;
const int LyricsFetcher::kMaxConcurrentRequests = 5;
namespace {
constexpr int kMaxConcurrentRequests = 5;
}
LyricsFetcher::LyricsFetcher(SharedPtr<LyricsProviders> lyrics_providers, QObject *parent)
: QObject(parent),

View File

@@ -69,8 +69,6 @@ class LyricsFetcher : public QObject {
void StartRequests();
private:
static const int kMaxConcurrentRequests;
SharedPtr<LyricsProviders> lyrics_providers_;
quint64 next_id_;

View File

@@ -34,9 +34,11 @@
#include "lyricsprovider.h"
#include "lyricsproviders.h"
const int LyricsFetcherSearch::kSearchTimeoutMs = 3000;
const int LyricsFetcherSearch::kGoodLyricsLength = 60;
const float LyricsFetcherSearch::kHighScore = 2.5;
namespace {
constexpr int kSearchTimeoutMs = 3000;
constexpr int kGoodLyricsLength = 60;
constexpr float kHighScore = 2.5;
} // namespace
LyricsFetcherSearch::LyricsFetcherSearch(const quint64 id, const LyricsSearchRequest &request, QObject *parent)
: QObject(parent),

View File

@@ -57,10 +57,6 @@ class LyricsFetcherSearch : public QObject {
static bool LyricsSearchResultCompareScore(const LyricsSearchResult &a, const LyricsSearchResult &b);
private:
static const int kSearchTimeoutMs;
static const int kGoodLyricsLength;
static const float kHighScore;
quint64 id_;
LyricsSearchRequest request_;
LyricsSearchResults results_;