ensured compatibility with kde4.0
This commit is contained in:
parent
a494eddb92
commit
ae77b9fb99
@ -115,6 +115,13 @@ kde4_add_plugin(kio_recoll ${kio_recoll_SRCS})
|
|||||||
target_link_libraries(kio_recoll xapian ${EXTRA_LIBS} ${KDE4_KIO_LIBS})
|
target_link_libraries(kio_recoll xapian ${EXTRA_LIBS} ${KDE4_KIO_LIBS})
|
||||||
|
|
||||||
install(TARGETS kio_recoll DESTINATION ${PLUGIN_INSTALL_DIR})
|
install(TARGETS kio_recoll DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||||
install(FILES recoll.protocol DESTINATION ${SERVICES_INSTALL_DIR})
|
|
||||||
|
IF ("${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}" GREATER 4.0)
|
||||||
|
install(FILES recoll.protocol DESTINATION ${SERVICES_INSTALL_DIR})
|
||||||
|
ELSE ("${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}" GREATER 4.0)
|
||||||
|
install(FILES recollnolist.protocol DESTINATION ${SERVICES_INSTALL_DIR}
|
||||||
|
RENAME recoll.protocol)
|
||||||
|
ENDIF ("${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}" GREATER 4.0)
|
||||||
|
|
||||||
install(FILES data/welcome.html
|
install(FILES data/welcome.html
|
||||||
DESTINATION ${DATA_INSTALL_DIR}/kio_recoll)
|
DESTINATION ${DATA_INSTALL_DIR}/kio_recoll)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: dirif.cpp,v 1.2 2008-11-27 17:48:43 dockes Exp $ (C) 2008 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: dirif.cpp,v 1.3 2008-11-28 09:14:42 dockes Exp $ (C) 2008 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -27,6 +27,12 @@ static char rcsid[] = "@(#$Id: dirif.cpp,v 1.2 2008-11-27 17:48:43 dockes Exp $
|
|||||||
* Stephan Binner <binner@kde.org>
|
* Stephan Binner <binner@kde.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <kdeversion.h>
|
||||||
|
#if KDE_IS_VERSION(4,1,0)
|
||||||
|
// Couldn't get listDir() to work with kde 4.0, konqueror keeps
|
||||||
|
// crashing because of kdirmodel, couldn't find a workaround (not
|
||||||
|
// saying it's impossible)...
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <kurl.h>
|
#include <kurl.h>
|
||||||
@ -34,11 +40,27 @@ static char rcsid[] = "@(#$Id: dirif.cpp,v 1.2 2008-11-27 17:48:43 dockes Exp $
|
|||||||
|
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
|
|
||||||
|
|
||||||
#include "kio_recoll.h"
|
#include "kio_recoll.h"
|
||||||
|
|
||||||
using namespace KIO;
|
using namespace KIO;
|
||||||
|
|
||||||
|
void RecollProtocol::stat(const KUrl & url)
|
||||||
|
{
|
||||||
|
kDebug() << url << endl ;
|
||||||
|
|
||||||
|
QString path = url.path();
|
||||||
|
KIO::UDSEntry entry;
|
||||||
|
if (!path.compare("/"))
|
||||||
|
entry.insert(KIO::UDSEntry::UDS_NAME, "/welcome");
|
||||||
|
else
|
||||||
|
entry.insert(KIO::UDSEntry::UDS_NAME, url.path());
|
||||||
|
entry.insert(KIO::UDSEntry::UDS_TARGET_URL, url.url());
|
||||||
|
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG);
|
||||||
|
statEntry(entry);
|
||||||
|
finished();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const UDSEntry resultToUDSEntry(Rcl::Doc doc)
|
const UDSEntry resultToUDSEntry(Rcl::Doc doc)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -72,22 +94,6 @@ const UDSEntry resultToUDSEntry(Rcl::Doc doc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RecollProtocol::stat(const KUrl & url)
|
|
||||||
{
|
|
||||||
kDebug() << url << endl ;
|
|
||||||
|
|
||||||
QString path = url.path();
|
|
||||||
KIO::UDSEntry entry;
|
|
||||||
if (!path.compare("/"))
|
|
||||||
entry.insert(KIO::UDSEntry::UDS_NAME, "/welcome");
|
|
||||||
else
|
|
||||||
entry.insert(KIO::UDSEntry::UDS_NAME, url.path());
|
|
||||||
entry.insert(KIO::UDSEntry::UDS_TARGET_URL, url.url());
|
|
||||||
entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFREG);
|
|
||||||
statEntry(entry);
|
|
||||||
finished();
|
|
||||||
}
|
|
||||||
|
|
||||||
// From kio_beagle
|
// From kio_beagle
|
||||||
void RecollProtocol::createRootEntry(KIO::UDSEntry& entry)
|
void RecollProtocol::createRootEntry(KIO::UDSEntry& entry)
|
||||||
{
|
{
|
||||||
@ -172,3 +178,4 @@ void RecollProtocol::listDir(const KUrl& url)
|
|||||||
listEntries(entries);
|
listEntries(entries);
|
||||||
finished();
|
finished();
|
||||||
}
|
}
|
||||||
|
#endif // KDE 4.1+
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: kio_recoll.cpp,v 1.17 2008-11-27 17:48:43 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: kio_recoll.cpp,v 1.18 2008-11-28 09:14:42 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -119,11 +119,7 @@ bool RecollProtocol::maybeOpenDb(string &reason)
|
|||||||
void RecollProtocol::mimetype(const KUrl &url)
|
void RecollProtocol::mimetype(const KUrl &url)
|
||||||
{
|
{
|
||||||
kDebug() << url << endl;
|
kDebug() << url << endl;
|
||||||
#ifdef USEDIRMODEL
|
mimeType("text/html");
|
||||||
mimeType("inode/directory");
|
|
||||||
#else
|
|
||||||
mimeType("text/html");
|
|
||||||
#endif
|
|
||||||
finished();
|
finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,17 +150,14 @@ void RecollProtocol::get(const KUrl & url)
|
|||||||
error(KIO::ERR_SLAVE_DEFINED, reason.c_str());
|
error(KIO::ERR_SLAVE_DEFINED, reason.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef USEDIRMODEL
|
|
||||||
error(KIO::ERR_IS_DIRECTORY, QString::null);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QString host = url.host();
|
QString host = url.host();
|
||||||
QString path = url.path();
|
QString path = url.path();
|
||||||
|
|
||||||
kDebug() << "host:" << host << " path:" << path;
|
kDebug() << "host:" << host << " path:" << path;
|
||||||
|
|
||||||
if (host.isEmpty() && (!path.compare("/")||!path.compare("/welcome"))) {
|
if (host.isEmpty() &&
|
||||||
|
(path.isEmpty() || !path.compare("/")||!path.compare("/welcome"))) {
|
||||||
// recoll:/
|
// recoll:/
|
||||||
welcomePage();
|
welcomePage();
|
||||||
goto out;
|
goto out;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef _RECOLL_H
|
#ifndef _RECOLL_H
|
||||||
/* @(#$Id: kio_recoll.h,v 1.8 2008-11-27 17:48:43 dockes Exp $ (C) 2005 J.F.Dockes */
|
/* @(#$Id: kio_recoll.h,v 1.9 2008-11-28 09:14:42 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||||
#define _RECOLL_H
|
#define _RECOLL_H
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -32,6 +32,7 @@ using std::string;
|
|||||||
#include <kurl.h>
|
#include <kurl.h>
|
||||||
#include <kio/global.h>
|
#include <kio/global.h>
|
||||||
#include <kio/slavebase.h>
|
#include <kio/slavebase.h>
|
||||||
|
#include <kdeversion.h>
|
||||||
|
|
||||||
#include "rclconfig.h"
|
#include "rclconfig.h"
|
||||||
#include "rcldb.h"
|
#include "rcldb.h"
|
||||||
@ -62,8 +63,10 @@ class RecollProtocol : public KIO::SlaveBase {
|
|||||||
virtual ~RecollProtocol();
|
virtual ~RecollProtocol();
|
||||||
virtual void mimetype(const KUrl & url );
|
virtual void mimetype(const KUrl & url );
|
||||||
virtual void get(const KUrl & url );
|
virtual void get(const KUrl & url );
|
||||||
|
#if KDE_IS_VERSION(4,1,0)
|
||||||
virtual void stat(const KUrl & url);
|
virtual void stat(const KUrl & url);
|
||||||
virtual void listDir(const KUrl& url);
|
virtual void listDir(const KUrl& url);
|
||||||
|
#endif
|
||||||
|
|
||||||
static RclConfig *o_rclconfig;
|
static RclConfig *o_rclconfig;
|
||||||
|
|
||||||
|
|||||||
@ -26,3 +26,11 @@ Output to ~/.xession-errors par defaut controle ?
|
|||||||
|
|
||||||
Probleme quand l'url se termine par un / et qu'on edite le mot,
|
Probleme quand l'url se termine par un / et qu'on edite le mot,
|
||||||
konqueror lance une recherche a chaque lettre.
|
konqueror lance une recherche a chaque lettre.
|
||||||
|
|
||||||
|
|
||||||
|
Apparemment c'est l'entree "listing" du .protocol qui decide si le plugin
|
||||||
|
est traité plutot comme un dirlister ou comme un htmlgetter. Curieusement,
|
||||||
|
le changement ne s'opere pas toujours immediatement quand on change le
|
||||||
|
fichier .proto, y compris apres avoir tue tous les process kde (changement
|
||||||
|
à la deuxieme execution de konqueror sur kde4.0). Sur kde4.0 il faut que le
|
||||||
|
.proto soit sans entree "listing"
|
||||||
|
|||||||
@ -5,8 +5,7 @@ input=none
|
|||||||
output=filesystem
|
output=filesystem
|
||||||
listing=Name,Type, URL
|
listing=Name,Type, URL
|
||||||
reading=true
|
reading=true
|
||||||
#defaultMimeType=inode/directory
|
|
||||||
defaultMimeType=text/html
|
defaultMimeType=text/html
|
||||||
Icon=help_index
|
Icon=recoll
|
||||||
Class=:local
|
Class=:local
|
||||||
URIMode=rawuri
|
URIMode=rawuri
|
||||||
|
|||||||
11
src/kde/kioslave/recoll/recollnolist.protocol
Normal file
11
src/kde/kioslave/recoll/recollnolist.protocol
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Protocol]
|
||||||
|
exec=kio_recoll
|
||||||
|
protocol=recoll
|
||||||
|
input=none
|
||||||
|
output=filesystem
|
||||||
|
# Version for kde4.0: no "listing" entry
|
||||||
|
reading=true
|
||||||
|
defaultMimeType=text/html
|
||||||
|
Icon=recoll
|
||||||
|
Class=:local
|
||||||
|
URIMode=rawuri
|
||||||
Loading…
x
Reference in New Issue
Block a user