|
a/src/qtgui/advshist.cpp |
|
b/src/qtgui/advshist.cpp |
|
... |
|
... |
75 |
const QString & /* localName */,
|
75 |
const QString & /* localName */,
|
76 |
const QString &qName,
|
76 |
const QString &qName,
|
77 |
const QXmlAttributes &)
|
77 |
const QXmlAttributes &)
|
78 |
{
|
78 |
{
|
79 |
LOGDEB2(("SDHXMLHandler::startElement: name [%s]\n",
|
79 |
LOGDEB2(("SDHXMLHandler::startElement: name [%s]\n",
|
80 |
(const char *)qName.toAscii()));
|
80 |
(const char *)qName.toUtf8()));
|
81 |
if (qName == "SD") {
|
81 |
if (qName == "SD") {
|
82 |
resetTemps();
|
82 |
resetTemps();
|
83 |
// A new search descriptor. Allocate data structure
|
83 |
// A new search descriptor. Allocate data structure
|
84 |
sd = RefCntr<SearchData>(new SearchData);
|
84 |
sd = RefCntr<SearchData>(new SearchData);
|
85 |
if (sd.isNull()) {
|
85 |
if (sd.isNull()) {
|
|
... |
|
... |
93 |
bool SDHXMLHandler::endElement(const QString & /* namespaceURI */,
|
93 |
bool SDHXMLHandler::endElement(const QString & /* namespaceURI */,
|
94 |
const QString & /* localName */,
|
94 |
const QString & /* localName */,
|
95 |
const QString &qName)
|
95 |
const QString &qName)
|
96 |
{
|
96 |
{
|
97 |
LOGDEB2(("SDHXMLHandler::endElement: name [%s]\n",
|
97 |
LOGDEB2(("SDHXMLHandler::endElement: name [%s]\n",
|
98 |
(const char *)qName.toAscii()));
|
98 |
(const char *)qName.toUtf8()));
|
99 |
|
99 |
|
100 |
if (qName == "CLT") {
|
100 |
if (qName == "CLT") {
|
101 |
if (currentText == "OR") {
|
101 |
if (currentText == "OR") {
|
102 |
sd->setTp(SCLT_OR);
|
102 |
sd->setTp(SCLT_OR);
|
103 |
}
|
103 |
}
|
|
... |
|
... |
108 |
} else if (qName == "F") {
|
108 |
} else if (qName == "F") {
|
109 |
field = base64_decode(qs2utf8s(currentText.trimmed()));
|
109 |
field = base64_decode(qs2utf8s(currentText.trimmed()));
|
110 |
} else if (qName == "T") {
|
110 |
} else if (qName == "T") {
|
111 |
text = base64_decode(qs2utf8s(currentText.trimmed()));
|
111 |
text = base64_decode(qs2utf8s(currentText.trimmed()));
|
112 |
} else if (qName == "S") {
|
112 |
} else if (qName == "S") {
|
113 |
slack = atoi((const char *)currentText.toAscii());
|
113 |
slack = atoi((const char *)currentText.toUtf8());
|
114 |
} else if (qName == "C") {
|
114 |
} else if (qName == "C") {
|
115 |
SearchDataClause *c;
|
115 |
SearchDataClause *c;
|
116 |
if (whatclause == "AND" || whatclause.isEmpty()) {
|
116 |
if (whatclause == "AND" || whatclause.isEmpty()) {
|
117 |
c = new SearchDataClauseSimple(SCLT_AND, text, field);
|
117 |
c = new SearchDataClauseSimple(SCLT_AND, text, field);
|
118 |
c->setexclude(exclude);
|
118 |
c->setexclude(exclude);
|
|
... |
|
... |
142 |
text.clear();
|
142 |
text.clear();
|
143 |
field.clear();
|
143 |
field.clear();
|
144 |
slack = 0;
|
144 |
slack = 0;
|
145 |
exclude = false;
|
145 |
exclude = false;
|
146 |
} else if (qName == "D") {
|
146 |
} else if (qName == "D") {
|
147 |
d = atoi((const char *)currentText.toAscii());
|
147 |
d = atoi((const char *)currentText.toUtf8());
|
148 |
} else if (qName == "M") {
|
148 |
} else if (qName == "M") {
|
149 |
m = atoi((const char *)currentText.toAscii());
|
149 |
m = atoi((const char *)currentText.toUtf8());
|
150 |
} else if (qName == "Y") {
|
150 |
} else if (qName == "Y") {
|
151 |
y = atoi((const char *)currentText.toAscii());
|
151 |
y = atoi((const char *)currentText.toUtf8());
|
152 |
} else if (qName == "DMI") {
|
152 |
} else if (qName == "DMI") {
|
153 |
di.d1 = d;
|
153 |
di.d1 = d;
|
154 |
di.m1 = m;
|
154 |
di.m1 = m;
|
155 |
di.y1 = y;
|
155 |
di.y1 = y;
|
156 |
hasdates = true;
|
156 |
hasdates = true;
|
|
... |
|
... |
158 |
di.d2 = d;
|
158 |
di.d2 = d;
|
159 |
di.m2 = m;
|
159 |
di.m2 = m;
|
160 |
di.y2 = y;
|
160 |
di.y2 = y;
|
161 |
hasdates = true;
|
161 |
hasdates = true;
|
162 |
} else if (qName == "MIS") {
|
162 |
} else if (qName == "MIS") {
|
163 |
sd->setMinSize(atoll((const char *)currentText.toAscii()));
|
163 |
sd->setMinSize(atoll((const char *)currentText.toUtf8()));
|
164 |
} else if (qName == "MAS") {
|
164 |
} else if (qName == "MAS") {
|
165 |
sd->setMaxSize(atoll((const char *)currentText.toAscii()));
|
165 |
sd->setMaxSize(atoll((const char *)currentText.toUtf8()));
|
166 |
} else if (qName == "ST") {
|
166 |
} else if (qName == "ST") {
|
167 |
string types = (const char *)currentText.toAscii();
|
167 |
string types = (const char *)currentText.toUtf8();
|
168 |
vector<string> vt;
|
168 |
vector<string> vt;
|
169 |
stringToTokens(types, vt);
|
169 |
stringToTokens(types, vt);
|
170 |
for (unsigned int i = 0; i < vt.size(); i++)
|
170 |
for (unsigned int i = 0; i < vt.size(); i++)
|
171 |
sd->addFiletype(vt[i]);
|
171 |
sd->addFiletype(vt[i]);
|
172 |
} else if (qName == "IT") {
|
172 |
} else if (qName == "IT") {
|
173 |
string types = (const char *)currentText.toAscii();
|
173 |
string types(qs2utf8s(currentText));
|
174 |
vector<string> vt;
|
174 |
vector<string> vt;
|
175 |
stringToTokens(types, vt);
|
175 |
stringToTokens(types, vt);
|
176 |
for (unsigned int i = 0; i < vt.size(); i++)
|
176 |
for (unsigned int i = 0; i < vt.size(); i++)
|
177 |
sd->remFiletype(vt[i]);
|
177 |
sd->remFiletype(vt[i]);
|
178 |
} else if (qName == "YD") {
|
178 |
} else if (qName == "YD") {
|
179 |
string d;
|
179 |
string d;
|
180 |
base64_decode((const char*)currentText.trimmed().toAscii(), d);
|
180 |
base64_decode(qs2utf8s(currentText.trimmed()), d);
|
181 |
sd->addClause(new SearchDataClausePath(d));
|
181 |
sd->addClause(new SearchDataClausePath(d));
|
182 |
} else if (qName == "ND") {
|
182 |
} else if (qName == "ND") {
|
183 |
string d;
|
183 |
string d;
|
184 |
base64_decode((const char*)currentText.trimmed().toAscii(), d);
|
184 |
base64_decode(qs2utf8s(currentText.trimmed()), d);
|
185 |
sd->addClause(new SearchDataClausePath(d, true));
|
185 |
sd->addClause(new SearchDataClausePath(d, true));
|
186 |
} else if (qName == "SD") {
|
186 |
} else if (qName == "SD") {
|
187 |
// Closing current search descriptor. Finishing touches...
|
187 |
// Closing current search descriptor. Finishing touches...
|
188 |
if (hasdates)
|
188 |
if (hasdates)
|
189 |
sd->setDateSpan(&di);
|
189 |
sd->setDateSpan(&di);
|