forked from blue/squawk
highlight in directory now is optional runtime plugin to KIO, several more file managers to fallback, refactor, 2 new icons
This commit is contained in:
parent
d514db9c4a
commit
ebf0c64ffb
23 changed files with 289 additions and 51 deletions
26
plugins/CMakeLists.txt
Normal file
26
plugins/CMakeLists.txt
Normal file
|
@ -0,0 +1,26 @@
|
|||
cmake_minimum_required(VERSION 3.3)
|
||||
project(plugins)
|
||||
|
||||
if (WITH_KIO)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
find_package(Qt5Core CONFIG REQUIRED)
|
||||
|
||||
set(openFileManagerWindowJob_SRC
|
||||
openfilemanagerwindowjob.cpp
|
||||
)
|
||||
|
||||
add_library(openFileManagerWindowJob SHARED ${openFileManagerWindowJob_SRC})
|
||||
|
||||
get_target_property(Qt5CORE_INTERFACE_INCLUDE_DIRECTORIES Qt5::Core INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(KIO_WIDGETS_INTERFACE_INCLUDE_DIRECTORIES KF5::KIOWidgets INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(CORE_ADDONS_INTERFACE_INCLUDE_DIRECTORIES KF5::CoreAddons INTERFACE_INCLUDE_DIRECTORIES)
|
||||
target_include_directories(openFileManagerWindowJob PUBLIC ${KIO_WIDGETS_INTERFACE_INCLUDE_DIRECTORIES})
|
||||
target_include_directories(openFileManagerWindowJob PUBLIC ${CORE_ADDONS_INTERFACE_INCLUDE_DIRECTORIES})
|
||||
target_include_directories(openFileManagerWindowJob PUBLIC ${Qt5CORE_INTERFACE_INCLUDE_DIRECTORIES})
|
||||
|
||||
target_link_libraries(openFileManagerWindowJob KF5::KIOWidgets)
|
||||
target_link_libraries(openFileManagerWindowJob Qt5::Core)
|
||||
|
||||
install(TARGETS openFileManagerWindowJob DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
8
plugins/openfilemanagerwindowjob.cpp
Normal file
8
plugins/openfilemanagerwindowjob.cpp
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include <QUrl>
|
||||
#include <QObject>
|
||||
#include <KIO/OpenFileManagerWindowJob>
|
||||
|
||||
extern "C" void highlightInFileManager(const QUrl& url) {
|
||||
KIO::OpenFileManagerWindowJob* job = KIO::highlightInFileManager({url});
|
||||
QObject::connect(job, &KIO::OpenFileManagerWindowJob::result, job, &KIO::OpenFileManagerWindowJob::deleteLater);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue