|
a/src/qtgui/idxthread.cpp |
|
b/src/qtgui/idxthread.cpp |
|
... |
|
... |
27 |
#include "debuglog.h"
|
27 |
#include "debuglog.h"
|
28 |
#include "idxthread.h"
|
28 |
#include "idxthread.h"
|
29 |
#include "smallut.h"
|
29 |
#include "smallut.h"
|
30 |
#include "rclinit.h"
|
30 |
#include "rclinit.h"
|
31 |
#include "pathut.h"
|
31 |
#include "pathut.h"
|
|
|
32 |
#include "recoll.h"
|
32 |
|
33 |
|
33 |
static int stopindexing;
|
34 |
static int stopindexing;
|
34 |
static int startindexing;
|
35 |
static int startindexing;
|
35 |
static bool rezero;
|
36 |
static bool rezero;
|
36 |
static IdxThreadStatus indexingstatus = IDXTS_OK;
|
37 |
static IdxThreadStatus indexingstatus = IDXTS_OK;
|
|
... |
|
... |
58 |
return true;
|
59 |
return true;
|
59 |
}
|
60 |
}
|
60 |
// Maintain a copy/snapshot of idx status
|
61 |
// Maintain a copy/snapshot of idx status
|
61 |
DbIxStatus m_statusSnap;
|
62 |
DbIxStatus m_statusSnap;
|
62 |
bool m_interrupted;
|
63 |
bool m_interrupted;
|
63 |
const RclConfig *cnf;
|
|
|
64 |
};
|
64 |
};
|
65 |
|
65 |
|
66 |
void IdxThread::run()
|
66 |
void IdxThread::run()
|
67 |
{
|
67 |
{
|
68 |
recoll_threadinit();
|
68 |
recoll_threadinit();
|
|
... |
|
... |
74 |
|
74 |
|
75 |
m_interrupted = false;
|
75 |
m_interrupted = false;
|
76 |
indexingstatus = IDXTS_NULL;
|
76 |
indexingstatus = IDXTS_NULL;
|
77 |
// We make a private snapshot of the config: setKeydir changes
|
77 |
// We make a private snapshot of the config: setKeydir changes
|
78 |
// it during indexing and it may be updated by the main thread.
|
78 |
// it during indexing and it may be updated by the main thread.
|
79 |
RclConfig *myconf = new RclConfig(*cnf);
|
79 |
RclConfig *myconf;
|
|
|
80 |
{
|
|
|
81 |
PTMutexLocker locker(thestableconfiglock);
|
|
|
82 |
myconf = new RclConfig(*thestableconfig);
|
|
|
83 |
}
|
80 |
int loglevel;
|
84 |
int loglevel;
|
81 |
myconf->setKeyDir("");
|
85 |
myconf->setKeyDir("");
|
82 |
myconf->getConfParam("loglevel", &loglevel);
|
86 |
myconf->getConfParam("loglevel", &loglevel);
|
83 |
DebugLog::getdbl()->setloglevel(loglevel);
|
87 |
DebugLog::getdbl()->setloglevel(loglevel);
|
84 |
|
88 |
|
|
... |
|
... |
115 |
|
119 |
|
116 |
static IdxThread idxthread;
|
120 |
static IdxThread idxthread;
|
117 |
|
121 |
|
118 |
// Functions called by the main thread
|
122 |
// Functions called by the main thread
|
119 |
|
123 |
|
120 |
void start_idxthread(const RclConfig& cnf)
|
124 |
void start_idxthread()
|
121 |
{
|
125 |
{
|
122 |
idxthread.cnf = &cnf;
|
|
|
123 |
idxthread.start();
|
126 |
idxthread.start();
|
124 |
}
|
127 |
}
|
125 |
|
128 |
|
126 |
void stop_idxthread()
|
129 |
void stop_idxthread()
|
127 |
{
|
130 |
{
|