|
a/src/qtgui/webcache.cpp |
|
b/src/qtgui/webcache.cpp |
|
... |
|
... |
19 |
#include <sstream>
|
19 |
#include <sstream>
|
20 |
#include <iostream>
|
20 |
#include <iostream>
|
21 |
#include MEMORY_INCLUDE
|
21 |
#include MEMORY_INCLUDE
|
22 |
#include UNORDERED_MAP_INCLUDE
|
22 |
#include UNORDERED_MAP_INCLUDE
|
23 |
|
23 |
|
|
|
24 |
#ifdef _WIN32
|
|
|
25 |
#define USING_STD_REGEX
|
|
|
26 |
#endif
|
|
|
27 |
|
24 |
#ifndef USING_STD_REGEX
|
28 |
#ifndef USING_STD_REGEX
|
25 |
#include <sys/types.h>
|
29 |
#include <sys/types.h>
|
26 |
#include <regex.h>
|
30 |
#include <regex.h>
|
27 |
#else
|
31 |
#else
|
28 |
#include <regex>
|
32 |
#include <regex>
|
|
... |
|
... |
97 |
}
|
101 |
}
|
98 |
if (!m->cache->cc()->next(eof))
|
102 |
if (!m->cache->cc()->next(eof))
|
99 |
break;
|
103 |
break;
|
100 |
}
|
104 |
}
|
101 |
}
|
105 |
}
|
102 |
emit dataChanged(createIndex(0,0,0), createIndex(1, m->all.size(),0));
|
106 |
emit dataChanged(createIndex(0,0), createIndex(1, m->all.size()));
|
103 |
}
|
107 |
}
|
104 |
|
108 |
|
105 |
bool WebcacheModel::deleteIdx(unsigned int idx)
|
109 |
bool WebcacheModel::deleteIdx(unsigned int idx)
|
106 |
{
|
110 |
{
|
107 |
if (idx > m->disp.size() || !m->cache)
|
111 |
if (idx > m->disp.size() || !m->cache)
|
|
... |
|
... |
192 |
if (regcomp(&exp, txt.c_str(), REG_NOSUB|REG_EXTENDED)) {
|
196 |
if (regcomp(&exp, txt.c_str(), REG_NOSUB|REG_EXTENDED)) {
|
193 |
//qDebug() << "regcomp failed for " << _txt;
|
197 |
//qDebug() << "regcomp failed for " << _txt;
|
194 |
return;
|
198 |
return;
|
195 |
}
|
199 |
}
|
196 |
#else
|
200 |
#else
|
197 |
basic_regex exp;
|
201 |
basic_regex<char> exp;
|
198 |
try {
|
202 |
try {
|
199 |
exp = basic_regexp(txt, std::regex_constants::nosubs |
|
203 |
exp = basic_regex<char>(txt, std::regex_constants::nosubs |
|
200 |
std::regex_constants::extended);
|
204 |
std::regex_constants::extended);
|
201 |
} catch(...) {
|
205 |
} catch(...) {
|
202 |
return;
|
206 |
return;
|
203 |
}
|
207 |
}
|
204 |
#endif
|
208 |
#endif
|
|
... |
|
... |
210 |
} else {
|
214 |
} else {
|
211 |
//qDebug() << "match failed. exp" << _txt << "data" <<
|
215 |
//qDebug() << "match failed. exp" << _txt << "data" <<
|
212 |
// m->all[i].url.c_str();
|
216 |
// m->all[i].url.c_str();
|
213 |
}
|
217 |
}
|
214 |
}
|
218 |
}
|
215 |
emit dataChanged(createIndex(0,0,0), createIndex(1, m->all.size(),0));
|
219 |
emit dataChanged(createIndex(0,0), createIndex(1, m->all.size()));
|
216 |
}
|
220 |
}
|
217 |
|
221 |
|
218 |
static const int ROWHEIGHTPAD = 2;
|
222 |
static const int ROWHEIGHTPAD = 2;
|
219 |
static const char *cwnm = "/Recoll/prefs/webcachecolw";
|
223 |
static const char *cwnm = "/Recoll/prefs/webcachecolw";
|
220 |
static const char *wwnm = "/Recoll/prefs/webcachew";
|
224 |
static const char *wwnm = "/Recoll/prefs/webcachew";
|