Browse Source

fix uri detection, puts dots between toxcore versions

pull/2137/head
agilob 10 years ago
parent
commit
582db9cb5b
No known key found for this signature in database
GPG Key ID: 296F0B764741106C
  1. 9
      src/chatlog/chatmessage.cpp
  2. 6
      src/widget/form/settings/aboutform.cpp

9
src/chatlog/chatmessage.cpp

@ -179,8 +179,13 @@ QString ChatMessage::detectAnchors(const QString &str)
{ {
QString out = str; QString out = str;
// detect urls // detect URIs
QRegExp exp("(?:\\b)(www\\.|http[s]?:\\/\\/|ftp:\\/\\/|tox:\\/\\/|tox:)\\S+"); QRegExp exp("("
"(?:\\b)(www\\.|http[s]?|ftp)://" // (protocol)://(printable - non-special character)
// http://ONEORMOREALHPA-DIGIT
"\\w+\\S+)" // any other character, lets domains and other
"|(^tox:[@\\w]+$)"); // starts with `tox` then : and only alpha-digits till the end
// also accepts tox:agilob@net as simplified TOX ID
int offset = 0; int offset = 0;
while ((offset = exp.indexIn(out, offset)) != -1) while ((offset = exp.indexIn(out, offset)) != -1)
{ {

6
src/widget/form/settings/aboutform.cpp

@ -43,11 +43,11 @@ void AboutForm::replaceVersions()
bodyUI->gitVersion->setText(bodyUI->gitVersion->text().replace("$GIT_VERSION", QString(GIT_VERSION))); bodyUI->gitVersion->setText(bodyUI->gitVersion->text().replace("$GIT_VERSION", QString(GIT_VERSION)));
bodyUI->toxCoreVersion->setText( bodyUI->toxCoreVersion->setText(
bodyUI->toxCoreVersion->text().replace("$TOXCOREVERSION", bodyUI->toxCoreVersion->text().replace("$TOXCOREVERSION",
QString::number(TOX_VERSION_MAJOR) + QString::number(TOX_VERSION_MAJOR) + "." +
QString::number(TOX_VERSION_MINOR) + QString::number(TOX_VERSION_MINOR) + "." +
QString::number(TOX_VERSION_PATCH))); QString::number(TOX_VERSION_PATCH)));
//TODO show when toxcore supports versioning #2086 //TODO show when toxcore supports versioning #2086
//bodyUI->toxCoreVersion->hide(); bodyUI->toxCoreVersion->hide();
} }
AboutForm::~AboutForm() AboutForm::~AboutForm()

Loading…
Cancel
Save