Switch to unified view

a/src/qtgui/idxthread.cpp b/src/qtgui/idxthread.cpp
...
...
32
#include "recoll.h"
32
#include "recoll.h"
33
33
34
static int stopindexing;
34
static int stopindexing;
35
static int startindexing;
35
static int startindexing;
36
static bool rezero;
36
static bool rezero;
37
static vector<Rcl::Doc> idxdocs; // Docs to update. Update all if empty
38
37
static IdxThreadStatus indexingstatus = IDXTS_OK;
39
static IdxThreadStatus indexingstatus = IDXTS_OK;
38
static string indexingReason;
40
static string indexingReason;
39
static int stopidxthread;
41
static int stopidxthread;
40
42
41
static QMutex curfile_mutex;
43
static QMutex curfile_mutex;
...
...
97
        indexingReason = "Indexing failed: other process active? " + 
99
        indexingReason = "Indexing failed: other process active? " + 
98
            pidfile.getreason();
100
            pidfile.getreason();
99
        } else {
101
        } else {
100
        pidfile.write_pid();
102
        pidfile.write_pid();
101
        ConfIndexer *indexer = new ConfIndexer(myconf, this);
103
        ConfIndexer *indexer = new ConfIndexer(myconf, this);
104
      bool status = idxdocs.empty() ? 
102
        if (indexer->index(rezero, ConfIndexer::IxTAll)) {
105
            indexer->index(rezero, ConfIndexer::IxTAll) :
106
          indexer->updateDocs(idxdocs);
107
          
108
      if (status) {
103
            indexingstatus = IDXTS_OK;
109
            indexingstatus = IDXTS_OK;
104
            indexingReason = "";
110
            indexingReason = "";
105
        } else {
111
        } else {
106
            indexingstatus = IDXTS_ERROR;
112
            indexingstatus = IDXTS_ERROR;
107
            indexingReason = "Indexing failed: " + indexer->getReason();
113
            indexingReason = "Indexing failed: " + indexer->getReason();
...
...
150
    stopindexing = 1;
156
    stopindexing = 1;
151
    action_mutex.unlock();
157
    action_mutex.unlock();
152
    action_wait.wakeAll();
158
    action_wait.wakeAll();
153
}
159
}
154
160
155
void start_indexing(bool raz)
161
void start_indexing(bool raz, vector<Rcl::Doc> docs)
156
{
162
{
157
    action_mutex.lock();
163
    action_mutex.lock();
158
    startindexing = 1;
164
    startindexing = 1;
159
    rezero = raz;
165
    rezero = raz;
166
    idxdocs = docs;
160
    action_mutex.unlock();
167
    action_mutex.unlock();
161
    action_wait.wakeAll();
168
    action_wait.wakeAll();
162
}
169
}
163
170
164
DbIxStatus idxthread_idxStatus()
171
DbIxStatus idxthread_idxStatus()