Improved URL recognizer for the good'ole ChatWidget. Thanks seezer for the patch!
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 1 Apr 2008 20:22:00 +0000 (20:22 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 1 Apr 2008 20:22:00 +0000 (20:22 +0000)
src/qtui/chatwidget.cpp
version.inc

index 131caa4..85d8cad 100644 (file)
@@ -384,7 +384,8 @@ void ChatWidget::mouseDoubleClickEvent(QMouseEvent *event) {
     len = end - start;
   }
   QString word = text.mid(start, len);
     len = end - start;
   }
   QString word = text.mid(start, len);
-  if(word.startsWith("http://")) {
+  QRegExp regex("^(h|f)t{1,2}ps?:\\/\\/");
+  if(regex.indexIn(word) != -1) {
     QDesktopServices::openUrl(QUrl(word));
   }
   
     QDesktopServices::openUrl(QUrl(word));
   }
   
index 780883f..62f569f 100644 (file)
@@ -5,7 +5,7 @@
 
   quasselVersion = "0.2.0-alpha5-pre";
   quasselDate = "2008-04-01";
 
   quasselVersion = "0.2.0-alpha5-pre";
   quasselDate = "2008-04-01";
-  quasselBuild = 682;
+  quasselBuild = 684;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 642;
 
   //! Minimum client build number the core needs
   clientBuildNeeded = 642;