]> cloud.milkyroute.net Git - dolphin.git/commitdiff
[Information Panel] Remove nullptr checks for MetaDataWidget member
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Sun, 14 Apr 2019 12:44:02 +0000 (14:44 +0200)
committerStefan Brüns <stefan.bruens@rwth-aachen.de>
Sun, 14 Apr 2019 12:45:00 +0000 (14:45 +0200)
Summary:
The widget has the same livetime as the containing widget, no need to
do any extra checks.

Reviewers: #dolphin, elvisangelaccio

Reviewed By: #dolphin, elvisangelaccio

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D20514

src/panels/information/informationpanelcontent.cpp

index e2b90dcc894da300810b0b6c250e3afe61c4765f..e694dd8a00d89a41f1bfc49344b54f7a851c6261 100644 (file)
@@ -210,11 +210,9 @@ void InformationPanelContent::refreshPreview() {
 }
 
 void InformationPanelContent::refreshMetaData() {
-    if (m_metaDataWidget) {
-        m_metaDataWidget->setDateFormat(static_cast<Baloo::DateFormats>(InformationPanelSettings::dateFormat()));
-        m_metaDataWidget->show();
-        m_metaDataWidget->setItems(KFileItemList() << m_item);
-    }
+    m_metaDataWidget->setDateFormat(static_cast<Baloo::DateFormats>(InformationPanelSettings::dateFormat()));
+    m_metaDataWidget->show();
+    m_metaDataWidget->setItems(KFileItemList() << m_item);
 }
 
 void InformationPanelContent::showItems(const KFileItemList& items)
@@ -230,9 +228,7 @@ void InformationPanelContent::showItems(const KFileItemList& items)
     );
     setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count()));
 
-    if (m_metaDataWidget) {
-        m_metaDataWidget->setItems(items);
-    }
+    m_metaDataWidget->setItems(items);
 
     m_phononWidget->hide();
 
@@ -349,9 +345,7 @@ void InformationPanelContent::adjustWidgetSizes(int width)
 
     // The metadata widget also contains a text widget which may return
     // a large preferred width.
-    if (m_metaDataWidget) {
-        m_metaDataWidget->setMaximumWidth(maxWidth);
-    }
+    m_metaDataWidget->setMaximumWidth(maxWidth);
 
     // try to increase the preview as large as possible
     m_preview->setSizeHint(QSize(maxWidth, maxWidth));