2009-07-31 19:01:33 +00:00
|
|
|
#include "urlcheck.h"
|
|
|
|
|
|
|
|
|
|
#include <QtCore>
|
|
|
|
|
|
|
|
|
|
UrlCheck::UrlCheck()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
bool UrlCheck::run(QString msg)
|
2009-07-31 19:01:33 +00:00
|
|
|
{
|
|
|
|
|
msg = msg.toLower();
|
2011-02-11 20:02:08 +00:00
|
|
|
|
2009-07-31 19:01:33 +00:00
|
|
|
QStringListIterator it1(urlStrings);
|
2011-02-11 20:02:08 +00:00
|
|
|
|
2009-07-31 19:01:33 +00:00
|
|
|
while (it1.hasNext()) {
|
|
|
|
|
if(msg.contains(it1.next())) {
|
|
|
|
|
QStringListIterator it2(urlExceptionStrings);
|
|
|
|
|
bool exception = false;
|
|
|
|
|
while (it2.hasNext()) {
|
2011-02-11 20:02:08 +00:00
|
|
|
if(msg.contains(it2.next())) {
|
|
|
|
|
exception = true;
|
2009-07-31 19:01:33 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-02-11 20:02:08 +00:00
|
|
|
if(!exception) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2009-07-31 19:01:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|