Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
Baloo Widgets
Commits
e48b9815
Commit
e48b9815
authored
Feb 02, 2022
by
Méven Car
Committed by
Méven Car
Feb 02, 2022
Browse files
Add Dimensions field, hiding width and height by default
parent
edec1652
Pipeline
#132096
passed with stage
in 43 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/filemetadataprovider.cpp
View file @
e48b9815
...
...
@@ -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"
)},
...
...
src/metadatafilter.cpp
View file @
e48b9815
...
...
@@ -27,7 +27,7 @@ MetadataFilter::~MetadataFilter()
void
MetadataFilter
::
initMetaInformationSettings
()
{
const
int
currentVersion
=
1
1
;
// increase version, if the blacklist of disabled
const
int
currentVersion
=
1
2
;
// 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"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment