summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-01-03 09:40:40 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-03-22 10:27:01 +0000
commitb07a06745eb79057ccc08bc908b2df866bc38ac0 (patch)
tree360775ba2b6de042a728ebd3dc12834a34f46292
parent1ebd23a6703567f6ce9adbee420cb8208872392b (diff)
Windows QPA/Services: Do not invoke MailToProtocolHandler of url.dll
As of Windows 10, MailToProtocolHandler is set as handler for mailto URLs if there is no mail client installed. As it silently fails or brings up a broken dialog after a long time, exclude it and fall back to ShellExecute() which brings up the URL assocation dialog. Task-number: QTBUG-57816 Change-Id: Ia8c09676bc44848e0549c06c3a82c9b5cce79279 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/plugins/platforms/windows/qwindowsservices.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp
index 7f9c9bd205..48332b35f8 100644
--- a/src/plugins/platforms/windows/qwindowsservices.cpp
+++ b/src/plugins/platforms/windows/qwindowsservices.cpp
@@ -98,7 +98,11 @@ static inline QString mailCommand()
RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(command), &bufferSize);
RegCloseKey(handle);
}
- if (!command[0])
+ // QTBUG-57816: As of Windows 10, if there is no mail client installed, an entry like
+ // "rundll32.exe .. url.dll,MailToProtocolHandler %l" is returned. Launching it
+ // silently fails or brings up a broken dialog after a long time, so exclude it and
+ // fall back to ShellExecute() which brings up the URL assocation dialog.
+ if (!command[0] || wcsstr(command, L",MailToProtocolHandler") != nullptr)
return QString();
wchar_t expandedCommand[MAX_PATH] = {0};
return ExpandEnvironmentStrings(command, expandedCommand, MAX_PATH) ?