diff options
-rw-r--r-- | src/library/dao/cuedao.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/library/dao/cuedao.cpp b/src/library/dao/cuedao.cpp index 30ba885082..fb76e915c6 100644 --- a/src/library/dao/cuedao.cpp +++ b/src/library/dao/cuedao.cpp @@ -19,18 +19,17 @@ namespace { const mixxx::Logger kLogger = mixxx::Logger("CueDAO"); -// The label column is not nullable! -const QVariant kEmptyLabel = QVariant(QLatin1String("")); - +/// Wrap a `QString` label in a `QVariant`. The label column is not nullable, +/// so this function also makes sure that the label an empty string, not null. inline const QVariant labelToQVariant(const QString& label) { if (label.isNull()) { - return kEmptyLabel; // null -> empty + return QLatin1String(""); // null -> empty } else { return label; } } -// Empty labels are read as null strings +/// Empty labels are read as null strings inline QString labelFromQVariant(const QVariant& value) { const auto label = value.toString(); if (label.isEmpty()) { |