-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepare multi-valued genre and mood tags #4101
Conversation
Pull Request Test Coverage Report for Build 1132945886
💛 - Coveralls |
src/track/track.h
Outdated
/// making it private. | ||
void setGenreTextInternal( | ||
const QString& genreText); | ||
bool updateGenreText( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method is the replacement for setGenreText
? Can you elaborate why it's named differently and not exposed as a setter in QmlPlayerProxy
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...because we will need TrackCollectionManager
for the custom tag mapping config. This context is not available in individual track objects.
src/library/basetracktablemodel.cpp
Outdated
@@ -1041,3 +1041,17 @@ TrackId BaseTrackTableModel::doGetTrackId( | |||
const TrackPointer& pTrack) const { | |||
return pTrack ? pTrack->getId() : TrackId(); | |||
} | |||
|
|||
bool BaseTrackTableModel::updateTrackGenreText( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is duplicated multiple times, but I guess we can't add it to trackmodel.h
because it don't have a reference to the track collection manager?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TrackCollectionManager
stores the custom tag mapping config and is only available in implementations.
The singular genre (and mood) track properties will become derived text fields that are split by a separator into tags when set and that are joined with a separator from multiple tags when read. The configuration including the separator will be stored in and managed by TrackCollection.
I have reverted the renaming by removing the "Text" suffix from genre and mood properties. TODO: We need to find a way to submit new genre/mood property values from QML after editing tracks. These properties cannot be set directly on a single That's a typical use case that demonstrates why bidirectional data bindings only work for trivial use cases. |
src/track/track.h
Outdated
/// !!!DO NOT USE!!! | ||
/// Set the genre text WITHOUT updating the corresponding custom tags. | ||
/// | ||
/// Only allowed to be used by TrackDAO!!! Unfortunately, the | ||
/// design of TrackDAO does not allow to hide this method by | ||
/// making it private. | ||
void setGenreInternal( | ||
const QString& genre); | ||
bool updateGenre( | ||
const QString& genre); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment doesn't make it clear to me if it only applies to setGenreInternal
or to updateGenre
as well. Maybe add a blank line between them and a separate doc comment.
Should we make the interal method private/protected and make TrackDAO a friend class to prevent wrong usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you.
The singular genre (and mood) track properties will become derived text fields that are split by a separator into tags when set and that are joined with a separator from multiple tags when read.
The configuration including the separator will be stored in and managed by
TrackCollectionManager
.