Skip to content

Commit

Permalink
Merge pull request #4368 from ninomp/fix-blank-duration
Browse files Browse the repository at this point in the history
Fix blank duration in LateNight and Tango skins
  • Loading branch information
daschuer committed Oct 8, 2021
2 parents 7618abf + c7fb757 commit 1d9c394
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
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

0 comments on commit 1d9c394

Please sign in to comment.