[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdesupport/strigi/src/daemon
From: Jos van den Oever <jos () vandenoever ! info>
Date: 2008-04-27 9:59:57
Message-ID: 1209290397.643087.8755.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 801643 by vandenoever:
Allow daemon to stop more quicly by using a special configuration class that signals \
when indexing should stop.
M +1 -1 daemon.cpp
M +21 -4 indexscheduler.h
--- trunk/kdesupport/strigi/src/daemon/daemon.cpp #801642:801643
@@ -231,7 +231,7 @@
DaemonConfigurator config (conffile);
// init filter manager
- AnalyzerConfiguration ic;
+ StoppableConfiguration ic;
config.loadFilteringRules(ic);
STRIGI_LOG_DEBUG("strigi.daemon", "filter manager initialized")
--- trunk/kdesupport/strigi/src/daemon/indexscheduler.h #801642:801643
@@ -26,21 +26,35 @@
#include <vector>
#include "strigithread.h"
#include "diranalyzer.h"
+#include "analyzerconfiguration.h"
class Event;
class EventListenerQueue;
namespace Strigi {
class IndexManager;
- class AnalyzerConfiguration;
}
+#include <iostream>
+class StoppableConfiguration : public Strigi::AnalyzerConfiguration {
+public:
+ bool stop;
+ bool indexMore() const {
+ return !stop;
+ }
+ bool addMoreText() const {
+ return !stop;
+ }
+ void setStop(bool s) { stop = s;exit(0); }
+ StoppableConfiguration() :stop(false) {}
+};
+
class IndexScheduler : public StrigiThread, private Strigi::AnalysisCaller {
private:
std::set<std::string> dirstoindex;
Strigi::IndexManager* indexmanager;
EventListenerQueue* m_listenerEventQueue;
- Strigi::AnalyzerConfiguration* m_indexerconfiguration;
+ StoppableConfiguration* m_indexerconfiguration;
void processListenerEvents(std::vector<Event*>& events);
void* run(void*);
@@ -56,7 +70,7 @@
void setEventListenerQueue (EventListenerQueue* eventQueue) {
m_listenerEventQueue = eventQueue;
}
- void setIndexerConfiguration(Strigi::AnalyzerConfiguration* ic) {
+ void setIndexerConfiguration(StoppableConfiguration* ic) {
m_indexerconfiguration = ic;
}
Strigi::AnalyzerConfiguration& getIndexerConfiguration() const {
@@ -64,7 +78,10 @@
}
int getQueueSize();
void startIndexing() { setState(Working); }
- void stopIndexing() { setState(Idling); }
+ void stopIndexing() {
+ setState(Idling);
+ m_indexerconfiguration->setStop(true);
+ }
std::string getStateString();
~IndexScheduler();
const std::set<std::string> &getIndexedDirectories() const {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic