Changeset 15d41d9


Ignore:
Timestamp:
09/27/17 23:36:30 (5 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master
Children:
81c642b
Parents:
01d1452
git-author:
Philipp Spitzer <philipp@…> (09/27/17 23:33:33)
git-committer:
Philipp Spitzer <philipp@…> (09/27/17 23:36:30)
Message:

Now the links in the description are clickable. Fixes #49.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/eventdialog.cpp

    r01d1452 r15d41d9  
    6868        info += event.description();
    6969    } else {
    70         info += Qt::convertFromPlainText(event.description(), Qt::WhiteSpaceNormal);
     70        QString description = Qt::convertFromPlainText(event.description(), Qt::WhiteSpaceNormal);
     71        // make links clickable
     72        QRegExp rx("<?(((s?ftp|https?|svn|svn\\+ssh|git|git\\+ssh)://|(file|news):|www\\.)[-a-z0-9_.:%]*[a-z0-9](/[^][{}\\s\"<>()]*[^][{}\\s\"<>().,:!])?/?)>?");
     73        info += description.replace(rx, "<a href=\"\\1\">\\1</a>");
    7174    }
    7275
Note: See TracChangeset for help on using the changeset viewer.