Commit e48b9815 authored by Méven Car's avatar Méven Car Committed by Méven Car
Browse files

Add Dimensions field, hiding width and height by default

parent edec1652
Pipeline #132096 passed with stage
in 43 seconds
......@@ -126,6 +126,12 @@ void FileMetaDataProvider::slotFileFetchFinished(KJob *job)
insertCommonData(files);
} else {
m_data = unite(m_data, files.first());
const auto width = m_data.value(QStringLiteral("width"));
const auto height = m_data.value(QStringLiteral("height"));
if (width.type() == QVariant::Double && height.type() == QVariant::Double) {
m_data.insert(QStringLiteral("dimensions"), i18nc("width × height", "%1 × %2", width.toInt(), height.toInt()));
}
}
m_readOnly = !fetchJob->canEditAll();
......@@ -442,6 +448,7 @@ QString FileMetaDataProvider::label(const QString &metaDataLabel) const
{QStringLiteral("rating"), i18nc("@label", "Rating")},
{QStringLiteral("userComment"), i18nc("@label", "Comment")},
{QStringLiteral("originUrl"), i18nc("@label", "Downloaded From")},
{QStringLiteral("dimensions"), i18nc("@label", "Dimensions")},
};
QString value = hash.value(metaDataLabel);
......@@ -514,6 +521,7 @@ QString FileMetaDataProvider::group(const QString &label) const
{QStringLiteral("photoGpsAltitude"), QStringLiteral("2ImageM")},
{QStringLiteral("manufacturer"), QStringLiteral("2ImageN")},
{QStringLiteral("model"), QStringLiteral("2ImageO")},
{QStringLiteral("dimensions"), QStringLiteral("2ImageP")},
// Media Data
{QStringLiteral("title"), QStringLiteral("3MediaA")},
......
......@@ -27,7 +27,7 @@ MetadataFilter::~MetadataFilter()
void MetadataFilter::initMetaInformationSettings()
{
const int currentVersion = 11; // increase version, if the blacklist of disabled
const int currentVersion = 12; // increase version, if the blacklist of disabled
// properties should be updated
KConfig config(QStringLiteral("baloofileinformationrc"), KConfig::NoGlobals);
......@@ -40,6 +40,8 @@ void MetadataFilter::initMetaInformationSettings()
KConfigGroup settings = config.group("Show");
static const char *const disabledProperties[] = {
"width",
"height", // replaced by dimensions
"comment",
"contentSize",
"depends",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment