break;
case 3:
- result.name = rows[0];
- result.street = rows[1];
- result.city = rows[2];
+ if(isPhoneNumber(rows[1]))
+ {
+ result.name = rows[0];
+ result.number = cleanUpNumber(rows[1]);
+ result.city = rows[2];
+ }
+ else
+ {
+ result.name = rows[0];
+ result.street = rows[1];
+ result.city = rows[2];
+ }
break;
case 4:
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)
static QString& cleanUpNumber(QString& number);
static QString& stripTags(QString& string);
static QString& htmlEntityDecode(QString& string);
+ static bool isPhoneNumber(QString const& string);
void fixUrl(QUrl& url);
QHttp http_;