KDE KIO slave: modernize and get it to work with kf5 5.9x+

This commit is contained in:
Jean-Francois Dockes 2022-08-07 14:20:04 +02:00
parent e43e223ef8
commit b50bdc5cab
6 changed files with 57 additions and 58 deletions

View File

@ -49,7 +49,8 @@ Recipe:
mkdir builddir
cd builddir
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install

View File

@ -91,15 +91,12 @@ z
pthread
)
install(FILES recoll.protocol recollf.protocol
DESTINATION ${SERVICES_INSTALL_DIR})
install(FILES data/welcome.html data/help.html
DESTINATION ${DATA_INSTALL_DIR}/kio_recoll)
#install(FILES recoll.protocol recollf.protocol
# DESTINATION ${SERVICES_INSTALL_DIR})
# Tried but could not use PLUGIN_INSTALL_DIR (/usr/lib64/plugins), or
# /usr/lib64/qt5/plugins/kf5/kio/recoll.so: the module is not found by
# dolphin). Actually that's because of the protocol file. recoll has
# exec=kio_recoll, file has exec=kf5/kio/file
install(FILES data/welcome.html data/help.html
DESTINATION ${DATA_INSTALL_DIR}/kio_recoll)
set_target_properties(kio_recoll PROPERTIES OUTPUT_NAME "kio_recoll")
install(TARGETS kio_recoll DESTINATION ${LIB_INSTALL_DIR}/qt5/plugins)
install(TARGETS kio_recoll
DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/kio)

View File

@ -45,6 +45,12 @@
using namespace KIO;
using namespace std;
class KIOPluginForMetaData : public QObject
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.recoll.kio.slave.recoll" FILE "recoll.json")
};
RclConfig *RecollProtocol::o_rclconfig;
RecollProtocol::RecollProtocol(const QByteArray& pool, const QByteArray& app)
@ -356,19 +362,25 @@ bool RecollProtocol::doSearch(const QueryDesc& qd)
return true;
}
int kdemain(int argc, char **argv)
extern "C"
{
QCoreApplication::setApplicationName("kio_recoll");
qDebug() << "*** starting kio_recoll ";
Q_DECL_EXPORT int kdemain(int argc, char **argv)
{
QCoreApplication app(argc, argv);
app.setApplicationName("kio_recoll");
qDebug() << "*** starting kio_recoll ";
if (argc != 4) {
qDebug() << "Usage: kio_recoll proto dom-socket1 dom-socket2\n";
exit(-1);
if (argc != 4) {
qDebug() << "Usage: kio_recoll proto dom-socket1 dom-socket2\n";
exit(-1);
}
RecollProtocol slave(argv[2], argv[3]);
slave.dispatchLoop();
qDebug() << "kio_recoll Done";
return 0;
}
RecollProtocol slave(argv[2], argv[3]);
slave.dispatchLoop();
qDebug() << "kio_recoll Done";
return 0;
}
#include "kio_recoll.moc"

View File

@ -1,35 +0,0 @@
# kio_recoll.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5a (1.1240 2003/06/26 06:55:19)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='kio_recoll.so'
# Names of this library.
library_names='kio_recoll.so kio_recoll.so kio_recoll.so'
# The name of the static archive.
old_library=''
# Libraries that this one depends upon.
dependency_libs=' -R/usr/local/lib -R/usr/X11R6/lib -L/usr/X11R6/lib -L/usr/local/lib /usr/local/lib/libkio.la /usr/local/lib/libkdeui.la /usr/local/lib/libkdesu.la /usr/local/lib/libkwalletclient.la /usr/local/lib/libkdecore.la /usr/local/lib/libDCOP.la -lutil -lart_lgpl_2 -lidn /usr/local/lib/libkdefx.la -lqt-mt -lpng -lXext -lX11 -lSM -lICE -lXrender -lz /usr/local/lib/libfam.la -ljpeg'
# Version information for kio_recoll.
current=0
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn recoll portability when linking against -modules?
shouldnotlink=yes
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/lib/kde3'

View File

@ -0,0 +1,24 @@
{
"KDE-KIO-Protocols": {
"recoll": {
"Class": ":local",
"Icon": "recoll",
"deleting": true,
"input": "none",
"linking": false,
"listing": [
"Name",
"Type",
"Size",
"Date"
],
"makedir":false,
"moving": false,
"output": "filesystem",
"protocol": "recoll",
"reading": true,
"source": false,
"writing": false
}
}
}

View File

@ -1,5 +1,5 @@
[Protocol]
exec=kio_recoll
exec=kf5/kio/kio_recoll
protocol=recollf
input=none
output=filesystem