File indexing completed on 2025-01-05 03:56:44

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2006-04-19
0007  * Description : A tab to display general item information
0008  *
0009  * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2013      by Michael G. Hansen <mike at mghansen dot de>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #include "itempropertiestab_p.h"
0017 
0018 namespace Digikam
0019 {
0020 
0021 ItemPropertiesTab::ItemPropertiesTab(QWidget* const parent)
0022     : DExpanderBox(parent),
0023       d           (new Private)
0024 {
0025     setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
0026     setLineWidth(style()->pixelMetric(QStyle::PM_DefaultFrameWidth));
0027 
0028     // --------------------------------------------------
0029 
0030     const int spacing = qMin(QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing),
0031                              QApplication::style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing));
0032 
0033     QWidget* const w1                  = new QWidget(this);
0034     QGridLayout* const glay1           = new QGridLayout(w1);
0035 
0036     DTextLabelName* const folder       = new DTextLabelName(i18nc("@label: item properties", "Folder: "),      w1);
0037     DTextLabelName* const symlink      = new DTextLabelName(i18nc("@label: item properties", "Symlink: "),     w1);
0038     DTextLabelName* const modifiedDate = new DTextLabelName(i18nc("@label: item properties", "Date: "),        w1);
0039     DTextLabelName* const size         = new DTextLabelName(i18nc("@label: item properties", "Size: "),        w1);
0040     DTextLabelName* const owner        = new DTextLabelName(i18nc("@label: item properties", "Owner: "),       w1);
0041     DTextLabelName* const permissions  = new DTextLabelName(i18nc("@label: item properties", "Permissions: "), w1);
0042 
0043     d->labelFile                       = new DTextLabelValue(QString(), w1);
0044     QFont fnt = d->labelFile->font();
0045     fnt.setBold(true);
0046     fnt.setPointSize(fnt.pointSize() + 4);
0047     d->labelFile->setFont(fnt);
0048     d->labelFile->setAlignment(Qt::AlignCenter);
0049 
0050     d->labelFolder                     = new DTextLabelValue(QString(), w1);
0051     d->labelSymlink                    = new DTextLabelValue(QString(), w1);
0052     d->labelFileModifiedDate           = new DTextLabelValue(QString(), w1);
0053     d->labelFileSize                   = new DTextLabelValue(QString(), w1);
0054     d->labelFileOwner                  = new DTextLabelValue(QString(), w1);
0055     d->labelFilePermissions            = new DTextLabelValue(QString(), w1);
0056 
0057     d->labelFile->setTextInteractionFlags(Qt::TextSelectableByMouse);
0058     d->labelFolder->setTextInteractionFlags(Qt::TextSelectableByMouse);
0059 
0060     glay1->addWidget(d->labelFile,             0, 0, 1, 2);
0061     glay1->addWidget(folder,                   1, 0, 1, 1);
0062     glay1->addWidget(d->labelFolder,           1, 1, 1, 1);
0063     glay1->addWidget(symlink,                  2, 0, 1, 1);
0064     glay1->addWidget(d->labelSymlink,          2, 1, 1, 1);
0065     glay1->addWidget(modifiedDate,             3, 0, 1, 1);
0066     glay1->addWidget(d->labelFileModifiedDate, 3, 1, 1, 1);
0067     glay1->addWidget(size,                     4, 0, 1, 1);
0068     glay1->addWidget(d->labelFileSize,         4, 1, 1, 1);
0069     glay1->addWidget(owner,                    5, 0, 1, 1);
0070     glay1->addWidget(d->labelFileOwner,        5, 1, 1, 1);
0071     glay1->addWidget(permissions,              6, 0, 1, 1);
0072     glay1->addWidget(d->labelFilePermissions,  6, 1, 1, 1);
0073     glay1->setContentsMargins(spacing, spacing, spacing, spacing);
0074     glay1->setColumnStretch(0, 10);
0075     glay1->setColumnStretch(1, 25);
0076     glay1->setSpacing(0);
0077 
0078     insertItem(ItemPropertiesTab::FileProperties,
0079                w1, QIcon::fromTheme(QLatin1String("dialog-information")),
0080                i18nc("@title: item properties", "File Properties"), QLatin1String("FileProperties"), true);
0081 
0082     // --------------------------------------------------
0083 
0084     QWidget* const w2                       = new QWidget(this);
0085     QGridLayout* const glay2                = new QGridLayout(w2);
0086 
0087     DTextLabelName* const mime              = new DTextLabelName(i18nc("@label: item properties", "Type: "),         w2);
0088     DTextLabelName* const dimensions        = new DTextLabelName(i18nc("@label: item properties", "Dimensions: "),   w2);
0089     DTextLabelName* const ratio             = new DTextLabelName(i18nc("@label: item properties", "Aspect Ratio: "), w2);
0090     DTextLabelName* const bitDepth          = new DTextLabelName(i18nc("@label: item properties", "Bit depth: "),    w2);
0091     DTextLabelName* const colorMode         = new DTextLabelName(i18nc("@label: item properties", "Color mode: "),   w2);
0092     DTextLabelName* const hasSidecar        = new DTextLabelName(i18nc("@label: item properties", "Sidecar: "),      w2);
0093     DTextLabelName* const hasGPSInfo        = new DTextLabelName(i18nc("@label: item properties", "GPS: "),          w2);
0094 
0095     d->labelImageMime                       = new DTextLabelValue(QString(), w2);
0096     d->labelImageDimensions                 = new DTextLabelValue(QString(), w2);
0097     d->labelImageRatio                      = new DTextLabelValue(QString(), w2);
0098     d->labelImageBitDepth                   = new DTextLabelValue(QString(), w2);
0099     d->labelImageColorMode                  = new DTextLabelValue(QString(), w2);
0100     d->labelHasSidecar                      = new DTextLabelValue(QString(), w2);
0101     d->labelHasGPSInfo                      = new DTextLabelValue(QString(), w2);
0102 
0103     glay2->addWidget(mime,                      0, 0, 1, 1);
0104     glay2->addWidget(d->labelImageMime,         0, 1, 1, 1);
0105     glay2->addWidget(dimensions,                1, 0, 1, 1);
0106     glay2->addWidget(d->labelImageDimensions,   1, 1, 1, 1);
0107     glay2->addWidget(ratio,                     2, 0, 1, 1);
0108     glay2->addWidget(d->labelImageRatio,        2, 1, 1, 1);
0109     glay2->addWidget(bitDepth,                  3, 0, 1, 1);
0110     glay2->addWidget(d->labelImageBitDepth,     3, 1, 1, 1);
0111     glay2->addWidget(colorMode,                 4, 0, 1, 1);
0112     glay2->addWidget(d->labelImageColorMode,    4, 1, 1, 1);
0113     glay2->addWidget(hasSidecar,                5, 0, 1, 1);
0114     glay2->addWidget(d->labelHasSidecar,        5, 1, 1, 1);
0115     glay2->addWidget(hasGPSInfo,                6, 0, 1, 1);
0116     glay2->addWidget(d->labelHasGPSInfo,        6, 1, 1, 1);
0117     glay2->setContentsMargins(spacing, spacing, spacing, spacing);
0118     glay2->setColumnStretch(0, 10);
0119     glay2->setColumnStretch(1, 25);
0120     glay2->setSpacing(0);
0121 
0122     insertItem(ItemPropertiesTab::ImageProperties,
0123                w2, QIcon::fromTheme(QLatin1String("view-preview")),
0124                i18nc("@title: item properties", "Item Properties"), QLatin1String("ItemProperties"), true);
0125 
0126     // --------------------------------------------------
0127 
0128     QWidget* const w3                  = new QWidget(this);
0129     QGridLayout* const glay3           = new QGridLayout(w3);
0130 
0131     DTextLabelName* const make         = new DTextLabelName(i18nc("@label: item properties", "Make: "),          w3);
0132     DTextLabelName* const model        = new DTextLabelName(i18nc("@label: item properties", "Model: "),         w3);
0133     DTextLabelName* const lens         = new DTextLabelName(i18nc("@label: item properties", "Lens: "),          w3);
0134     DTextLabelName* const aperture     = new DTextLabelName(i18nc("@label: item properties", "Aperture: "),      w3);
0135     DTextLabelName* const focalLength  = new DTextLabelName(i18nc("@label: item properties", "Focal: "),         w3);
0136     DTextLabelName* const exposureTime = new DTextLabelName(i18nc("@label: item properties", "Exposure: "),      w3);
0137     DTextLabelName* const sensitivity  = new DTextLabelName(i18nc("@label: item properties", "Sensitivity: "),   w3);
0138     DTextLabelName* const exposureMode = new DTextLabelName(i18nc("@label: item properties", "Mode/Program: "),  w3);
0139     DTextLabelName* const flash        = new DTextLabelName(i18nc("@label: item properties", "Flash: "),         w3);
0140     DTextLabelName* const whiteBalance = new DTextLabelName(i18nc("@label: item properties", "White balance: "), w3);
0141 
0142     d->labelPhotoMake                  = new DTextLabelValue(QString(), w3);
0143     d->labelPhotoModel                 = new DTextLabelValue(QString(), w3);
0144     d->labelPhotoLens                  = new DTextLabelValue(QString(), w3);
0145     d->labelPhotoAperture              = new DTextLabelValue(QString(), w3);
0146     d->labelPhotoFocalLength           = new DTextLabelValue(QString(), w3);
0147     d->labelPhotoExposureTime          = new DTextLabelValue(QString(), w3);
0148     d->labelPhotoSensitivity           = new DTextLabelValue(QString(), w3);
0149     d->labelPhotoExposureMode          = new DTextLabelValue(QString(), w3);
0150     d->labelPhotoFlash                 = new DTextLabelValue(QString(), w3);
0151     d->labelPhotoWhiteBalance          = new DTextLabelValue(QString(), w3);
0152 
0153     glay3->addWidget(make,                      0, 0, 1, 1);
0154     glay3->addWidget(d->labelPhotoMake,         0, 1, 1, 1);
0155     glay3->addWidget(model,                     1, 0, 1, 1);
0156     glay3->addWidget(d->labelPhotoModel,        1, 1, 1, 1);
0157     glay3->addWidget(lens,                      2, 0, 1, 1);
0158     glay3->addWidget(d->labelPhotoLens,         2, 1, 1, 1);
0159     glay3->addWidget(aperture,                  3, 0, 1, 1);
0160     glay3->addWidget(d->labelPhotoAperture,     3, 1, 1, 1);
0161     glay3->addWidget(focalLength,               4, 0, 1, 1);
0162     glay3->addWidget(d->labelPhotoFocalLength,  4, 1, 1, 1);
0163     glay3->addWidget(exposureTime,              5, 0, 1, 1);
0164     glay3->addWidget(d->labelPhotoExposureTime, 5, 1, 1, 1);
0165     glay3->addWidget(sensitivity,               6, 0, 1, 1);
0166     glay3->addWidget(d->labelPhotoSensitivity,  6, 1, 1, 1);
0167     glay3->addWidget(exposureMode,              7, 0, 1, 1);
0168     glay3->addWidget(d->labelPhotoExposureMode, 7, 1, 1, 1);
0169     glay3->addWidget(flash,                     8, 0, 1, 1);
0170     glay3->addWidget(d->labelPhotoFlash,        8, 1, 1, 1);
0171     glay3->addWidget(whiteBalance,              9, 0, 1, 1);
0172     glay3->addWidget(d->labelPhotoWhiteBalance, 9, 1, 1, 1);
0173     glay3->setContentsMargins(spacing, spacing, spacing, spacing);
0174     glay3->setColumnStretch(0, 10);
0175     glay3->setColumnStretch(1, 25);
0176     glay3->setSpacing(0);
0177 
0178     insertItem(ItemPropertiesTab::PhotoProperties,
0179                w3, QIcon::fromTheme(QLatin1String("camera-photo")),
0180                i18nc("@title: item properties", "Photograph Properties"), QLatin1String("PhotographProperties"), true);
0181 
0182     // --------------------------------------------------
0183 
0184     QWidget* const w4                      = new QWidget(this);
0185     QGridLayout* const glay4               = new QGridLayout(w4);
0186 
0187     DTextLabelName* const aspectRatio      = new DTextLabelName(i18nc("@label: item properties", "Aspect Ratio: "),       w4);
0188     DTextLabelName* const duration         = new DTextLabelName(i18nc("@label: item properties", "Duration: "),           w4);
0189     DTextLabelName* const frameRate        = new DTextLabelName(i18nc("@label: item properties", "Frame Rate: "),         w4);
0190     DTextLabelName* const videoCodec       = new DTextLabelName(i18nc("@label: item properties", "Video Codec: "),        w4);
0191     DTextLabelName* const audioBitRate     = new DTextLabelName(i18nc("@label: item properties", "Audio Bit Rate: "),     w4);
0192     DTextLabelName* const audioChannelType = new DTextLabelName(i18nc("@label: item properties", "Audio Channel Type: "), w4);
0193     DTextLabelName* const audioCodec       = new DTextLabelName(i18nc("@label: item properties", "Audio Codec: "),        w4);
0194 
0195     d->labelVideoAspectRatio               = new DTextLabelValue(QString(), w4);
0196     d->labelVideoDuration                  = new DTextLabelValue(QString(), w4);
0197     d->labelVideoFrameRate                 = new DTextLabelValue(QString(), w4);
0198     d->labelVideoVideoCodec                = new DTextLabelValue(QString(), w4);
0199     d->labelVideoAudioBitRate              = new DTextLabelValue(QString(), w4);
0200     d->labelVideoAudioChannelType          = new DTextLabelValue(QString(), w4);
0201     d->labelVideoAudioCodec                = new DTextLabelValue(QString(), w4);
0202 
0203     glay4->addWidget(aspectRatio,                   0, 0, 1, 1);
0204     glay4->addWidget(d->labelVideoAspectRatio,      0, 1, 1, 1);
0205     glay4->addWidget(duration,                      1, 0, 1, 1);
0206     glay4->addWidget(d->labelVideoDuration,         1, 1, 1, 1);
0207     glay4->addWidget(frameRate,                     2, 0, 1, 1);
0208     glay4->addWidget(d->labelVideoFrameRate,        2, 1, 1, 1);
0209     glay4->addWidget(videoCodec,                    3, 0, 1, 1);
0210     glay4->addWidget(d->labelVideoVideoCodec,       3, 1, 1, 1);
0211     glay4->addWidget(audioBitRate,                  4, 0, 1, 1);
0212     glay4->addWidget(d->labelVideoAudioBitRate,     4, 1, 1, 1);
0213     glay4->addWidget(audioChannelType,              5, 0, 1, 1);
0214     glay4->addWidget(d->labelVideoAudioChannelType, 5, 1, 1, 1);
0215     glay4->addWidget(audioCodec,                    6, 0, 1, 1);
0216     glay4->addWidget(d->labelVideoAudioCodec,       6, 1, 1, 1);
0217     glay4->setContentsMargins(spacing, spacing, spacing, spacing);
0218     glay4->setColumnStretch(0, 10);
0219     glay4->setColumnStretch(1, 25);
0220     glay4->setSpacing(0);
0221 
0222     insertItem(ItemPropertiesTab::VideoProperties,
0223                w4, QIcon::fromTheme(QLatin1String("video-x-generic")),
0224                i18nc("@title: item properties", "Audio/Video Properties"), QLatin1String("VideoProperties"), true);
0225 
0226     // --------------------------------------------------
0227 
0228     QWidget* const w5        = new QWidget(this);
0229     QGridLayout* const glay5 = new QGridLayout(w5);
0230 
0231     d->labelPhotoDateTime    = new DTextLabelValue(QString(), w5);
0232     fnt                      = d->labelPhotoDateTime->font();
0233     fnt.setPointSize(fnt.pointSize() + 4);
0234     fnt.setUnderline(true);
0235     d->labelPhotoDateTime->setFont(fnt);
0236     d->labelPhotoDateTime->setAlignment(Qt::AlignCenter);
0237 
0238     d->title                 = new DTextLabelName(i18nc("@label: item properties", "Title: "),       w5);
0239     d->caption               = new DTextLabelName(i18nc("@label: item properties", "Caption: "),     w5);
0240     d->pickLabel             = new DTextLabelName(i18nc("@label: item properties", "Pick label: "),  w5);
0241     d->colorLabel            = new DTextLabelName(i18nc("@label: item properties", "Color label: "), w5);
0242     d->rating                = new DTextLabelName(i18nc("@label: item properties", "Rating: "),      w5);
0243     d->versionned            = new DTextLabelName(i18nc("@label: item properties", "Versionned: "),  w5);
0244     d->grouped               = new DTextLabelName(i18nc("@label: item properties", "Grouped: "),     w5);
0245 
0246     d->labelTitle            = new QLabel(QString(), w5);
0247     d->labelTitle->setWordWrap(true);
0248     d->labelCaption          = new QLabel(QString(), w5);
0249     d->labelCaption->setWordWrap(true);
0250 
0251     d->labelPickLabel        = new DTextLabelValue(QString(), w5);
0252     d->labelColorLabel       = new DTextLabelValue(QString(), w5);
0253     d->labelRating           = new DTextLabelValue(QString(), w5);
0254     d->labelVersionnedInfo   = new DTextLabelValue(QString(), w5);
0255     d->labelGroupedInfo      = new DTextLabelValue(QString(), w5);
0256 
0257     glay5->addWidget(d->labelPhotoDateTime,  0, 0, 1, 2);
0258     glay5->addWidget(d->title,               1, 0, 1, 1);
0259     glay5->addWidget(d->labelTitle,          1, 1, 1, 1);
0260     glay5->addWidget(d->caption,             2, 0, 1, 1);
0261     glay5->addWidget(d->labelCaption,        2, 1, 1, 1);
0262     glay5->addWidget(d->pickLabel,           3, 0, 1, 1);
0263     glay5->addWidget(d->labelPickLabel,      3, 1, 1, 1);
0264     glay5->addWidget(d->colorLabel,          4, 0, 1, 1);
0265     glay5->addWidget(d->labelColorLabel,     4, 1, 1, 1);
0266     glay5->addWidget(d->rating,              5, 0, 1, 1);
0267     glay5->addWidget(d->labelRating,         5, 1, 1, 1);
0268     glay5->addWidget(d->versionned,          6, 0, 1, 1);
0269     glay5->addWidget(d->labelVersionnedInfo, 6, 1, 1, 1);
0270     glay5->addWidget(d->grouped,             7, 0, 1, 1);
0271     glay5->addWidget(d->labelGroupedInfo,    7, 1, 1, 1);
0272     glay5->setContentsMargins(spacing, spacing, spacing, spacing);
0273     glay5->setColumnStretch(0, 10);
0274     glay5->setColumnStretch(1, 25);
0275     glay5->setSpacing(0);
0276 
0277     insertItem(ItemPropertiesTab::digiKamProperties,
0278                w5, QIcon::fromTheme(QLatin1String("edit-text-frame-update")),
0279                i18nc("@title: item properties", "digiKam Properties"), QLatin1String("DigikamProperties"), true);
0280 
0281     // --------------------------------------------------
0282 
0283     QWidget* const w6        = new QWidget(this);
0284     QGridLayout* const glay6 = new QGridLayout(w6);
0285 
0286     d->tags                  = new DTextLabelName(i18nc("@label: item properties", "Keywords: "),      w6);
0287     d->labelTags             = new QLabel(QString(), w6);
0288     d->labelTags->setWordWrap(true);
0289 
0290     d->peoples               = new DTextLabelName(i18nc("@label: item properties", "Peoples: "),      w6);
0291     d->labelPeoples          = new QLabel(QString(), w6);
0292     d->labelPeoples->setWordWrap(true);
0293 
0294     glay6->addWidget(d->tags,         0, 0, 1, 1);
0295     glay6->addWidget(d->labelTags,    0, 1, 1, 1);
0296     glay6->addWidget(d->peoples,      1, 0, 1, 1);
0297     glay6->addWidget(d->labelPeoples, 1, 1, 1, 1);
0298     glay6->setContentsMargins(spacing, spacing, spacing, spacing);
0299     glay6->setColumnStretch(0, 10);
0300     glay6->setColumnStretch(1, 25);
0301     glay6->setSpacing(0);
0302 
0303     insertItem(ItemPropertiesTab::TagsProperties,
0304                w6, QIcon::fromTheme(QLatin1String("tag")),
0305                i18nc("@title: item properties", "Tags"), QLatin1String("TagsProperties"), true);
0306 
0307     // --------------------------------------------------
0308 
0309     QWidget* const w7        = new QWidget(this);
0310     QGridLayout* const glay7 = new QGridLayout(w7);
0311 
0312     d->labelLocation         = new QLabel(QString(), w7);
0313     d->labelLocation->setWordWrap(true);
0314 
0315     glay7->addWidget(d->labelLocation, 0, 0, 1, 2);
0316     glay7->setContentsMargins(spacing, spacing, spacing, spacing);
0317     glay7->setColumnStretch(0, 10);
0318     glay7->setColumnStretch(1, 25);
0319     glay7->setSpacing(0);
0320 
0321     insertItem(ItemPropertiesTab::LocationProperties,
0322                w7, QIcon::fromTheme(QLatin1String("globe")),
0323                i18nc("@title: item properties", "Location"), QLatin1String("LocationProperties"), true);
0324 
0325     // --------------------------------------------------
0326 
0327     QWidget* const w8        = new QWidget(this);
0328     QGridLayout* const glay8 = new QGridLayout(w8);
0329 
0330     d->labelRights           = new QLabel(QString(), w8);
0331     d->labelRights->setWordWrap(true);
0332     d->labelRights->setOpenExternalLinks(true);
0333     d->labelRights->setTextFormat(Qt::RichText);
0334     d->labelRights->setTextInteractionFlags(Qt::LinksAccessibleByMouse);
0335 
0336     glay8->addWidget(d->labelRights, 0, 0, 1, 2);
0337     glay8->setContentsMargins(spacing, spacing, spacing, spacing);
0338     glay8->setColumnStretch(0, 10);
0339     glay8->setColumnStretch(1, 25);
0340     glay8->setSpacing(0);
0341 
0342     insertItem(ItemPropertiesTab::RightProperties,
0343                w8, QIcon::fromTheme(QLatin1String("flag")),
0344                i18nc("@title: item properties", "Rights"), QLatin1String("RightsProperties"), true);
0345 
0346     // --------------------------------------------------
0347 
0348     addStretch();
0349 }
0350 
0351 ItemPropertiesTab::~ItemPropertiesTab()
0352 {
0353     delete d;
0354 }
0355 
0356 void ItemPropertiesTab::showOrHideCachedProperties()
0357 {
0358     bool hasTitle      = !d->labelTitle->text().isEmpty();
0359     bool hasCaption    = !d->labelCaption->text().isEmpty();
0360     bool hasPickLabel  = !d->labelPickLabel->adjustedText().isEmpty();
0361     bool hasColorLabel = !d->labelColorLabel->adjustedText().isEmpty();
0362     bool hasRating     = !d->labelRating->adjustedText().isEmpty();
0363     bool hasDate       = !d->labelPhotoDateTime->adjustedText().isEmpty();
0364     bool hasVersionned = !d->labelVersionnedInfo->adjustedText().isEmpty();
0365     bool hasGrouped    = !d->labelGroupedInfo->adjustedText().isEmpty();
0366 
0367     d->labelPhotoDateTime->setVisible(hasDate);
0368 
0369     d->labelTitle->setVisible(hasTitle);
0370     d->title->setVisible(hasTitle);
0371     d->labelCaption->setVisible(hasCaption);
0372     d->caption->setVisible(hasCaption);
0373     d->pickLabel->setVisible(hasPickLabel);
0374     d->labelPickLabel->setVisible(hasPickLabel);
0375     d->colorLabel->setVisible(hasColorLabel);
0376     d->labelColorLabel->setVisible(hasColorLabel);
0377     d->rating->setVisible(hasRating);
0378     d->labelRating->setVisible(hasRating);
0379     d->versionned->setVisible(hasVersionned);
0380     d->labelVersionnedInfo->setVisible(hasVersionned);
0381     d->grouped->setVisible(hasGrouped);
0382     d->labelGroupedInfo->setVisible(hasGrouped);
0383 
0384     widget(ItemPropertiesTab::digiKamProperties)->setVisible(hasTitle      ||
0385                                                              hasCaption    ||
0386                                                              hasRating     ||
0387                                                              hasPickLabel  ||
0388                                                              hasDate       ||
0389                                                              hasColorLabel ||
0390                                                              hasVersionned ||
0391                                                              hasGrouped);
0392 
0393     bool hasTags       = !d->labelTags->text().isEmpty();
0394     bool hasPeoples    = !d->labelPeoples->text().isEmpty();
0395 
0396     d->tags->setVisible(hasTags);
0397     d->labelTags->setVisible(hasTags);
0398     d->peoples->setVisible(hasPeoples);
0399     d->labelPeoples->setVisible(hasPeoples);
0400 
0401     widget(ItemPropertiesTab::TagsProperties)->setVisible(hasTags || hasPeoples);
0402 
0403     bool hasLocation = !d->labelLocation->text().isEmpty();
0404 
0405     widget(ItemPropertiesTab::LocationProperties)->setVisible(hasLocation);
0406 
0407     bool hasRights = !d->labelRights->text().isEmpty();
0408 
0409     widget(ItemPropertiesTab::RightProperties)->setVisible(hasRights);
0410 }
0411 
0412 } // namespace Digikam
0413 
0414 #include "moc_itempropertiestab.cpp"