Use C++11 enum class

This commit is contained in:
Jonas Kvinge
2023-02-18 14:09:27 +01:00
parent e6c5f76872
commit dd72fb4ca5
237 changed files with 2915 additions and 2840 deletions

View File

@@ -94,13 +94,13 @@ QStringList MoodbarLoader::MoodFilenames(const QString &song_filename) {
MoodbarLoader::Result MoodbarLoader::Load(const QUrl &url, const bool has_cue, QByteArray *data, MoodbarPipeline **async_pipeline) {
if (!url.isLocalFile() || has_cue) {
return CannotLoad;
return Result::CannotLoad;
}
// Are we in the middle of loading this moodbar already?
if (requests_.contains(url)) {
*async_pipeline = requests_[url];
return WillLoadAsync;
return Result::WillLoadAsync;
}
// Check if a mood file exists for this file already
@@ -113,7 +113,7 @@ MoodbarLoader::Result MoodbarLoader::Load(const QUrl &url, const bool has_cue, Q
qLog(Info) << "Loading moodbar data from" << possible_mood_file;
*data = f.readAll();
f.close();
return Loaded;
return Result::Loaded;
}
else {
qLog(Error) << "Failed to load moodbar data from" << possible_mood_file << f.errorString();
@@ -127,7 +127,7 @@ MoodbarLoader::Result MoodbarLoader::Load(const QUrl &url, const bool has_cue, Q
qLog(Info) << "Loading cached moodbar data for" << filename;
*data = cache_device->readAll();
if (!data->isEmpty()) {
return Loaded;
return Result::Loaded;
}
}
@@ -144,7 +144,7 @@ MoodbarLoader::Result MoodbarLoader::Load(const QUrl &url, const bool has_cue, Q
MaybeTakeNextRequest();
*async_pipeline = pipeline;
return WillLoadAsync;
return Result::WillLoadAsync;
}