Use null coalescing.

This commit is contained in:
Black
2020-06-03 22:02:46 -07:00
parent 1f95e8888a
commit 9fc316757e
10 changed files with 18 additions and 20 deletions

View File

@@ -96,7 +96,7 @@ RowLayout {
}
Label {
readonly property int duration: content.info.duration || audio.duration || 0
readonly property int duration: content.info.duration ?? audio.duration ?? 0
Layout.fillWidth: true
@@ -193,14 +193,12 @@ RowLayout {
}
}
function openSavedFile()
{
function openSavedFile() {
if (Qt.openUrlExternally(progressInfo.localPath)) return;
if (Qt.openUrlExternally(progressInfo.localDir)) return;
}
function humanSize(duration)
{
function humanSize(duration) {
if (!duration)
return qsTr("Unknown", "Unknown duration")
if (duration < 1000)