Skip to content
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

Fix blank duration in LateNight and Tango skins #4368

Merged
merged 3 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion res/skins/LateNight/decks/row_2_3_TitleArtistTime.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<TooltipId>track_duration</TooltipId>
<Size>0min,25f</Size>
<Alignment>right</Alignment>
<Property>durationFormatted</Property>
<Property>durationTextSeconds</Property>
<Channel>
<Variable name="ChanNum"/>
</Channel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<ObjectName>DurationText</ObjectName>
<TooltipId>track_duration</TooltipId>
<Size>0min,22f</Size>
<Property>durationFormatted</Property>
<Property>durationTextSeconds</Property>
<Channel>
<Variable name="ChanNum"/>
</Channel>
Expand Down
2 changes: 1 addition & 1 deletion res/skins/Tango/decks/row_text_left.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Variables:
<ObjectName>Duration</ObjectName>
<Size>60min,21f</Size>
<TooltipId>track_duration</TooltipId>
<Property>durationFormatted</Property>
<Property>durationTextSeconds</Property>
<Alignment>right</Alignment>
<Channel><Variable name="chanNum"/></Channel>
</TrackProperty>
Expand Down
2 changes: 1 addition & 1 deletion res/skins/Tango/decks/row_text_right.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Variables:
<ObjectName>Duration</ObjectName>
<Size>80me,21f</Size>
<TooltipId>track_duration</TooltipId>
<Property>durationFormatted</Property>
<Property>durationTextSeconds</Property>
<Alignment>left</Alignment>
<Channel><Variable name="chanNum"/></Channel>
</TrackProperty>
Expand Down
2 changes: 1 addition & 1 deletion res/skins/Tango/mic_aux_sampler/sampler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Variables:
<TooltipId>text</TooltipId>
<Size>1me,1min</Size>
<Group><Variable name="group"/></Group>
<Property>durationFormatted</Property>
<Property>durationTextSeconds</Property>
</TrackProperty>

<Template src="skin:../Tango/controls/button_3state.xml">
Expand Down
3 changes: 2 additions & 1 deletion src/track/track.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class Track : public QObject {
Q_PROPERTY(QString bpmText READ getBpmText STORED false NOTIFY bpmChanged)
Q_PROPERTY(QString keyText READ getKeyText WRITE setKeyText NOTIFY keyChanged)
Q_PROPERTY(double duration READ getDuration NOTIFY durationChanged)
Q_PROPERTY(QString durationText READ getDurationTextSeconds STORED false NOTIFY durationChanged)
Q_PROPERTY(QString durationTextSeconds READ getDurationTextSeconds
STORED false NOTIFY durationChanged)
Q_PROPERTY(QString durationTextCentiseconds READ getDurationTextCentiseconds
STORED false NOTIFY durationChanged)
Q_PROPERTY(QString durationTextMilliseconds READ getDurationTextMilliseconds
Expand Down
5 changes: 5 additions & 0 deletions src/widget/wtrackproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ void WTrackProperty::setup(const QDomNode& node, const SkinContext& context) {
WLabel::setup(node, context);

m_property = context.selectString(node, "Property");

// Check if property with that name exists in Track class
if (Track::staticMetaObject.indexOfProperty(m_property.toUtf8().constData()) == -1) {
qWarning() << "WTrackProperty: Unknown track property:" << m_property;
}
}

void WTrackProperty::slotTrackLoaded(TrackPointer pTrack) {
Expand Down