diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ project(Dolphin VERSION ${KDE_APPLICATIONS_VERSION}) set(QT_MIN_VERSION "5.8.0") -set(KF5_MIN_VERSION "5.53.0") +set(KF5_MIN_VERSION "5.56.0") # ECM setup find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED) diff --git a/src/kitemviews/private/kbaloorolesprovider.h b/src/kitemviews/private/kbaloorolesprovider.h --- a/src/kitemviews/private/kbaloorolesprovider.h +++ b/src/kitemviews/private/kbaloorolesprovider.h @@ -67,25 +67,6 @@ */ QString tagsFromValues(const QStringList& values) const; - /** - * @return User visible string for the EXIF-orientation property - * which can have the values 0 to 8. - * (see http://sylvana.net/jpegcrop/exif_orientation.html) - */ - QString orientationFromValue(int value) const; - - /** - * @return Duration in the format HH::MM::SS for the value given - * in seconds. - */ - QString durationFromValue(int value) const; - - /** - * @return Bitrate in the format N kB/s for the value given - * in b/s. - */ - QString bitrateFromValue(int value) const; - private: QSet m_roles; QHash m_roleForProperty; diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp --- a/src/kitemviews/private/kbaloorolesprovider.cpp +++ b/src/kitemviews/private/kbaloorolesprovider.cpp @@ -67,22 +67,7 @@ continue; } - const QVariant value = it.value(); - - if (role == "orientation") { - const QString orientation = orientationFromValue(value.toInt()); - values.insert(role, orientation); - } else if (role == "duration") { - const QString duration = durationFromValue(value.toInt()); - values.insert(role, duration); - } else if (role == "bitrate") { - const QString bitrate = bitrateFromValue(value.toInt()); - values.insert(role, bitrate); - } else if (pi.valueType() == QVariant::StringList) { - values.insert(role, value.toStringList().join(QStringLiteral(", "))); - } else { - values.insert(role, value.toString()); - } + values.insert(role, pi.formatAsDisplayString(it.value())); } KFileMetaData::UserMetaData md(file.path()); @@ -154,37 +139,3 @@ std::sort(alphabeticalOrderTags.begin(), alphabeticalOrderTags.end(), [&](const QString& s1, const QString& s2){ return coll.compare(s1, s2) < 0; }); return alphabeticalOrderTags.join(QStringLiteral(", ")); } - -QString KBalooRolesProvider::orientationFromValue(int value) const -{ - QString string; - switch (value) { - case 1: string = i18nc("@item:intable Image orientation", "Unchanged"); break; - case 2: string = i18nc("@item:intable Image orientation", "Horizontally flipped"); break; - case 3: string = i18nc("@item:intable image orientation", "180° rotated"); break; - case 4: string = i18nc("@item:intable image orientation", "Vertically flipped"); break; - case 5: string = i18nc("@item:intable image orientation", "Transposed"); break; - case 6: string = i18nc("@item:intable image orientation", "90° rotated"); break; - case 7: string = i18nc("@item:intable image orientation", "Transversed"); break; - case 8: string = i18nc("@item:intable image orientation", "270° rotated"); break; - default: - break; - } - return string; -} - -QString KBalooRolesProvider::durationFromValue(int value) const -{ - QTime duration(0, 0, 0); - duration = duration.addSecs(value); - return duration.toString(QStringLiteral("hh:mm:ss")); -} - - -QString KBalooRolesProvider::bitrateFromValue(int value) const -{ - KFormat form; - QString bitrate = i18nc("@label bitrate (per second)", "%1/s", form.formatByteSize(value, 1, KFormat::MetricBinaryDialect)); - return bitrate; -} -