1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #3118

Also "fix" the problem with not signed sudden6's commit.

PKEv (1):
      feat(chatform): add support for non-local file and samba share links
This commit is contained in:
Zetok Zalbavar 2016-04-14 05:36:07 +01:00
commit 8fa40d5c4f
No known key found for this signature in database
GPG Key ID: C953D3880212068A
2 changed files with 24 additions and 8 deletions

View File

@ -249,7 +249,9 @@ QString ChatMessage::detectAnchors(const QString &str)
"(?:\\b)((www\\.)|(http[s]?|ftp)://)" // (protocol)://(printable - non-special character)
// http://ONEORMOREALHPA-DIGIT
"\\w+\\S+)" // any other character, lets domains and other
"|(?:\\b)(file:///)([\\S| ]*)" //link to a local file, valid until the end of the line
// ↓ link to a file, or samba share
// https://en.wikipedia.org/wiki/File_URI_scheme
"|(?:\\b)((file|smb)://)([\\S| ]*)"
"|(?:\\b)(tox:[a-zA-Z\\d]{76})" //link with full user address
"|(?:\\b)(mailto:\\S+@\\S+\\.\\S+)" //@mail link
"|(?:\\b)(tox:\\S+@\\S+)"); // starts with `tox` then : and only alpha-digits till the end

View File

@ -99,19 +99,33 @@ SystemTrayIcon::SystemTrayIcon()
SystemTrayIcon::~SystemTrayIcon()
{
delete qtIcon;
// only delete the used backend
switch(backendType)
{
case SystrayBackendType::Qt:
delete qtIcon;
break;
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
delete unityIndicator;
delete unityMenu;
case SystrayBackendType::Unity:
delete unityIndicator;
delete unityMenu;
break;
#endif
#ifdef ENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND
delete statusNotifier;
delete snMenu;
case SystrayBackendType::StatusNotifier:
delete statusNotifier;
delete snMenu;
break;
#endif
#ifdef ENABLE_SYSTRAY_GTK_BACKEND
delete gtkIcon;
delete gtkMenu;
case SystrayBackendType::GTK:
delete gtkIcon;
delete gtkMenu;
break;
#endif
default:
qWarning() << "Unknown Systray Backend Type";
}
qDebug() << "Deleting SystemTrayIcon";
}