]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/information/informationpanelcontent.cpp
dolphin: convert panels/ and filterbar to qt signal/slot syntax
[dolphin.git] / src / panels / information / informationpanelcontent.cpp
index b2dd1582ef834f8e57649355924f5273ceba90f5..74f0ae9352a271f558d24337ad8ec452c2fb157d 100644 (file)
 #include <KGlobalSettings>
 #include <KIO/JobUiDelegate>
 #include <KIO/PreviewJob>
+#include <KJobWidgets>
 #include <KIconEffect>
 #include <KIconLoader>
+#include <KIcon>
 #include <KLocale>
 #include <KMenu>
 #include <kseparator.h>
@@ -81,8 +83,8 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
     m_outdatedPreviewTimer = new QTimer(this);
     m_outdatedPreviewTimer->setInterval(300);
     m_outdatedPreviewTimer->setSingleShot(true);
-    connect(m_outdatedPreviewTimer, SIGNAL(timeout()),
-            this, SLOT(markOutdatedPreview()));
+    connect(m_outdatedPreviewTimer, &QTimer::timeout,
+            this, &InformationPanelContent::markOutdatedPreview);
 
     QVBoxLayout* layout = new QVBoxLayout(this);
     layout->setSpacing(KDialog::spacingHint());
@@ -97,8 +99,8 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
     m_phononWidget = new PhononWidget(parent);
     m_phononWidget->hide();
     m_phononWidget->setMinimumWidth(minPreviewWidth);
-    connect(m_phononWidget, SIGNAL(hasVideoChanged(bool)),
-            this, SLOT(slotHasVideoChanged(bool)));
+    connect(m_phononWidget, &PhononWidget::hasVideoChanged,
+            this, &InformationPanelContent::slotHasVideoChanged);
 
     // name
     m_nameLabel = new QLabel(parent);
@@ -119,7 +121,7 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
 #endif
     m_metaDataWidget->setFont(KGlobalSettings::smallestReadableFont());
     m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
-    connect(m_metaDataWidget, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl)));
+    connect(m_metaDataWidget, &KFileMetaDataWidget::urlActivated, this, &InformationPanelContent::urlActivated);
 
     // Encapsulate the MetaDataWidget inside a container that has a dummy widget
     // at the bottom. This prevents that the meta data widget gets vertically stretched
@@ -193,13 +195,13 @@ void InformationPanelContent::showItem(const KFileItem& item)
             m_previewJob->setScaleType(KIO::PreviewJob::Unscaled);
             m_previewJob->setIgnoreMaximumSize(item.isLocalFile());
             if (m_previewJob->ui()) {
-                m_previewJob->ui()->setWindow(this);
+                KJobWidgets::setWindow(m_previewJob, this);
             }
 
-            connect(m_previewJob, SIGNAL(gotPreview(KFileItem,QPixmap)),
-                    this, SLOT(showPreview(KFileItem,QPixmap)));
-            connect(m_previewJob, SIGNAL(failed(KFileItem)),
-                    this, SLOT(showIcon(KFileItem)));
+            connect(m_previewJob.data(), &KIO::PreviewJob::gotPreview,
+                    this, &InformationPanelContent::showPreview);
+            connect(m_previewJob.data(), &KIO::PreviewJob::failed,
+                    this, &InformationPanelContent::showIcon);
         }
     }
 
@@ -283,7 +285,7 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon
     KMenu popup(this);
 
     QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview"));
-    previewAction->setIcon(KIcon("view-preview"));
+    previewAction->setIcon(QIcon::fromTheme("view-preview"));
     previewAction->setCheckable(true);
     previewAction->setChecked(InformationPanelSettings::previewsShown());
 
@@ -315,7 +317,7 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon
         dialog->show();
         dialog->raise();
         dialog->activateWindow();
-        connect(dialog, SIGNAL(destroyed()), this, SLOT(refreshMetaData()));
+        connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData);
     }
 }