┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2017-07-27 16:05:18 +0200
committerElvis Angelaccio <[email protected]>2017-07-27 16:05:18 +0200
commit82b2dbd3ec568a6e6fe01a8e75739b25cae25f15 (patch)
tree56d635f989c3f260b8e0539cb6a98506ce84acfc /src
parent9a957c3b5cec8cb369acc8388240ce718299bcd9 (diff)
parentc3de867622afc7e0eaf787bf371873387a6b4451 (diff)
Merge branch 'Applications/17.08'
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/dolphin.qrc5
-rw-r--r--src/dolphinpart.qrc5
-rw-r--r--src/dolphintabwidget.cpp2
-rw-r--r--src/dolphinviewcontainer.cpp11
-rw-r--r--src/views/dolphinview.cpp6
-rw-r--r--src/views/dolphinview.h4
-rw-r--r--src/views/draganddrophelper.h2
8 files changed, 30 insertions, 11 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bc6f75d62..13b94f73b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -180,6 +180,8 @@ set(dolphinpart_SRCS
dolphindebug.cpp
)
+qt5_add_resources(dolphinpart_SRCS dolphinpart.qrc)
+
add_library(dolphinpart MODULE ${dolphinpart_SRCS})
target_link_libraries(dolphinpart
@@ -188,7 +190,6 @@ target_link_libraries(dolphinpart
install(TARGETS dolphinpart DESTINATION ${KDE_INSTALL_PLUGINDIR})
-install(FILES dolphinpart.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/dolphinpart)
install(FILES dolphinpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
##########################################
@@ -267,6 +268,8 @@ if(NOT WIN32)
set(dolphinstatic_SRCS ${dolphinstatic_SRCS} panels/terminal/terminalpanel.cpp)
endif()
+qt5_add_resources(dolphinstatic_SRCS dolphin.qrc)
+
add_library(dolphinstatic STATIC ${dolphinstatic_SRCS})
target_include_directories(dolphinstatic PRIVATE ${PHONON_INCLUDES})
@@ -389,7 +392,6 @@ install( FILES settings/dolphin_directoryviewpropertysettings.kcfg
settings/dolphin_detailsmodesettings.kcfg
settings/dolphin_versioncontrolsettings.kcfg
DESTINATION ${KDE_INSTALL_KCFGDIR} )
-install( FILES dolphinui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/dolphin )
install( FILES org.kde.dolphin.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
install( FILES settings/kcm/kcmdolphinviewmodes.desktop DESTINATION
${KDE_INSTALL_KSERVICES5DIR} )
diff --git a/src/dolphin.qrc b/src/dolphin.qrc
new file mode 100644
index 000000000..55cae54b9
--- /dev/null
+++ b/src/dolphin.qrc
@@ -0,0 +1,5 @@
+<RCC>
+<qresource prefix="/kxmlgui5/dolphin">
+<file>dolphinui.rc</file>
+</qresource>
+</RCC>
diff --git a/src/dolphinpart.qrc b/src/dolphinpart.qrc
new file mode 100644
index 000000000..b525da13a
--- /dev/null
+++ b/src/dolphinpart.qrc
@@ -0,0 +1,5 @@
+<RCC>
+<qresource prefix="/kxmlgui5/dolphinpart">
+<file>dolphinpart.rc</file>
+</qresource>
+</RCC>
diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp
index 94b7a0144..d9b7d7e13 100644
--- a/src/dolphintabwidget.cpp
+++ b/src/dolphintabwidget.cpp
@@ -284,7 +284,7 @@ void DolphinTabWidget::tabDropEvent(int index, QDropEvent* event)
{
if (index >= 0) {
DolphinView* view = tabPageAt(index)->activeViewContainer()->view();
- view->dropUrls(view->url(), event);
+ view->dropUrls(view->url(), event, view);
}
}
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index 72ced931b..198879f37 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -29,6 +29,7 @@
#include <KFilePlacesModel>
#include <KLocalizedString>
#include <KIO/PreviewJob>
+#include <kio_version.h>
#include <KMessageWidget>
#include <KShell>
#include <QUrl>
@@ -135,8 +136,14 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
this, &DolphinViewContainer::slotUrlNavigatorLocationChanged);
connect(m_urlNavigator, &KUrlNavigator::returnPressed,
this, &DolphinViewContainer::slotReturnPressed);
- connect(m_urlNavigator, &KUrlNavigator::urlsDropped,
- m_view, &DolphinView::dropUrls);
+ connect(m_urlNavigator, &KUrlNavigator::urlsDropped, this, [=](const QUrl &destination, QDropEvent *event) {
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 37, 0)
+ m_view->dropUrls(destination, event, m_urlNavigator->dropWidget());
+#else
+ // TODO: remove as soon as we can hard-depend of KF5 >= 5.37
+ m_view->dropUrls(destination, event, m_view);
+#endif
+ });
// Initialize status bar
m_statusBar = new DolphinStatusBar(this);
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index bef6a8b73..5fcec9241 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -1051,14 +1051,14 @@ void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even
event->mimeData(),
event->buttons(),
event->modifiers());
- dropUrls(destUrl, &dropEvent);
+ dropUrls(destUrl, &dropEvent, this);
setActive(true);
}
-void DolphinView::dropUrls(const QUrl &destUrl, QDropEvent *dropEvent)
+void DolphinView::dropUrls(const QUrl &destUrl, QDropEvent *dropEvent, QWidget *dropWidget)
{
- KIO::DropJob* job = DragAndDropHelper::dropUrls(destUrl, dropEvent, this);
+ KIO::DropJob* job = DragAndDropHelper::dropUrls(destUrl, dropEvent, dropWidget);
if (job) {
connect(job, &KIO::DropJob::result, this, &DolphinView::slotPasteJobResult);
diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h
index 6b62b5da6..5c832efd1 100644
--- a/src/views/dolphinview.h
+++ b/src/views/dolphinview.h
@@ -363,9 +363,9 @@ public slots:
void pasteIntoFolder();
/**
- * Handles a drop of @p dropEvent onto @p destUrl
+ * Handles a drop of @p dropEvent onto widget @p dropWidget and destination @p destUrl
*/
- void dropUrls(const QUrl &destUrl, QDropEvent *dropEvent);
+ void dropUrls(const QUrl &destUrl, QDropEvent *dropEvent, QWidget *dropWidget);
void stopLoading();
diff --git a/src/views/draganddrophelper.h b/src/views/draganddrophelper.h
index fe77b1e6e..3153f06ef 100644
--- a/src/views/draganddrophelper.h
+++ b/src/views/draganddrophelper.h
@@ -41,7 +41,7 @@ public:
* @param destUrl URL of the item destination. Is used only if destItem::isNull()
* is true.
* @param event Drop event.
- * @param window Associated widget.
+ * @param window Widget where the drop happened, will be used as parent of the drop menu.
* @return KIO::DropJob pointer
*/
static KIO::DropJob* dropUrls(const QUrl& destUrl,