]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placespanel.cpp
Merge branch 'master' into kf6
[dolphin.git] / src / panels / places / placespanel.cpp
index de713774763b598cbe38fe3d83e1790ef48d514f..8b245f0e72a2c16ab5caa8fa6e75fa2b1de90af4 100644 (file)
 
 #include "placespanel.h"
 
-#include "dolphinplacesmodelsingleton.h"
 #include "dolphin_generalsettings.h"
 #include "dolphin_placespanelsettings.h"
-#include "global.h"
-#include "views/draganddrophelper.h"
+#include "dolphinplacesmodelsingleton.h"
 #include "settings/dolphinsettingsdialog.h"
+#include "views/draganddrophelper.h"
 
 #include <KFilePlacesModel>
 #include <KIO/DropJob>
 
 #include <Solid/StorageAccess>
 
-PlacesPanel::PlacesPanel(QWidgetparent)
+PlacesPanel::PlacesPanel(QWidget *parent)
     : KFilePlacesView(parent)
 {
     setDropOnPlaceEnabled(true);
-    connect(this, &PlacesPanel::urlsDropped,
-            this, &PlacesPanel::slotUrlsDropped);
+    connect(this, &PlacesPanel::urlsDropped, this, &PlacesPanel::slotUrlsDropped);
 
     setAutoResizeItemsEnabled(false);
 
@@ -51,13 +49,13 @@ PlacesPanel::PlacesPanel(QWidget* parent)
 
     connect(this, &PlacesPanel::contextMenuAboutToShow, this, &PlacesPanel::slotContextMenuAboutToShow);
 
-    connect(this, &PlacesPanel::iconSizeChanged, this, [this](const QSize &newSize) {
+    connect(this, &PlacesPanel::iconSizeChanged, this, [](const QSize &newSize) {
         int iconSize = qMin(newSize.width(), newSize.height());
         if (iconSize == 0) {
             // Don't store 0 size, let's keep -1 for default/small/automatic
             iconSize = -1;
         }
-        PlacesPanelSettingssettings = PlacesPanelSettings::self();
+        PlacesPanelSettings *settings = PlacesPanelSettings::self();
         settings->setIconSize(iconSize);
         settings->save();
     });
@@ -73,7 +71,7 @@ void PlacesPanel::setUrl(const QUrl &url)
     KFilePlacesView::setUrl(url);
 }
 
-QList<QAction*> PlacesPanel::customContextMenuActions() const
+QList<QAction *> PlacesPanel::customContextMenuActions() const
 {
     return m_customContextMenuActions;
 }
@@ -105,7 +103,7 @@ void PlacesPanel::readSettings()
     setIconSize(QSize(iconSize, iconSize));
 }
 
-void PlacesPanel::showEvent(QShowEventevent)
+void PlacesPanel::showEvent(QShowEvent *event)
 {
     if (!event->spontaneous() && !model()) {
         readSettings();
@@ -143,7 +141,7 @@ static bool isInternalDrag(const QMimeData *mimeData)
 
 void PlacesPanel::dragMoveEvent(QDragMoveEvent *event)
 {
-    const QModelIndex index = indexAt(event->pos());
+    const QModelIndex index = indexAt(event->position().toPoint());
     if (index.isValid()) {
         auto *placesModel = static_cast<KFilePlacesModel *>(model());
 
@@ -163,13 +161,13 @@ void PlacesPanel::slotConfigureTrash()
 {
     const QUrl url = currentIndex().data(KFilePlacesModel::UrlRole).toUrl();
 
-    DolphinSettingsDialogsettingsDialog = new DolphinSettingsDialog(url, this);
+    DolphinSettingsDialog *settingsDialog = new DolphinSettingsDialog(url, this);
     settingsDialog->setCurrentPage(settingsDialog->trashSettings);
     settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
     settingsDialog->show();
 }
 
-void PlacesPanel::slotUrlsDropped(const QUrl& dest, QDropEvent* event, QWidget* parent)
+void PlacesPanel::slotUrlsDropped(const QUrl &dest, QDropEvent *event, QWidget *parent)
 {
     KIO::DropJob *job = DragAndDropHelper::dropUrls(dest, event, parent);
     if (job) {
@@ -225,7 +223,7 @@ void PlacesPanel::slotTearDownRequested(const QModelIndex &index)
 void PlacesPanel::slotTearDownRequestedExternally(const QString &udi)
 {
     Q_UNUSED(udi);
-    auto *storageAccess = static_cast<Solid::StorageAccess*>(sender());
+    auto *storageAccess = static_cast<Solid::StorageAccess *>(sender());
 
     Q_EMIT storageTearDownExternallyRequested(storageAccess->filePath());
 }
@@ -277,3 +275,5 @@ void PlacesPanel::connectDeviceSignals(const QModelIndex &index)
 
     connect(storageAccess, &Solid::StorageAccess::teardownRequested, this, &PlacesPanel::slotTearDownRequestedExternally);
 }
+
+#include "moc_placespanel.cpp"