}
Source::Source(QObject* parent): QObject(parent),
-maxResults_(DEFAULT_MAX_RESULTS), timeout_(0), timerId_(0), findNumber_(false),
+maxResults_(DEFAULT_MAX_RESULTS), timeout_(0), timerId_(0), findNumber_(true),
error_(NO_ERROR), loggedIn_(false)
{
connect(&http_, SIGNAL(requestFinished(int, bool)), this, SLOT(httpReady(int, bool)));
string = string.replace("&" + entities[i] + ";", QChar(entityValues[i]));
}
+ static QRegExp entityCleaner("&#([0-9]{1,3});");
+ entityCleaner.setMinimal(true);
+
+ int pos = 0;
+
+ while((pos = entityCleaner.indexIn(string, pos)) != -1)
+ {
+ QString match = entityCleaner.cap(1);
+
+ int value = match.toInt();
+
+ if(value >= 1 && value <= 255)
+ {
+ string = string.replace(pos, match.length() + 3, QChar(value));
+ }
+
+ pos += entityCleaner.matchedLength();
+ }
+
+
return string;
}
url.setEncodedQuery(path);
}
+bool Source::isPhoneNumber(QString const& string)
+{
+ static QRegExp check("^([0-9 -]{7,25})$");
+ return check.exactMatch(string);
+}
+
Source::SearchDetails::SearchDetails(QString const& q,
QString const& loc,
SearchType t)