From 4b63565bbce6306465cc17284f488932cac13f95 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 8 May 2017 17:27:44 +0200 Subject: Native Windows file dialog: Observe Windows Explorer "Show hidden files" setting Extract a helper function to read the setting and use that in file dialogs and tray icon. Task-number: QTBUG-60593 Change-Id: I03cf1e45611690a128bf2cc17eba5dff23b86969 Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowssystemtrayicon.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowssystemtrayicon.cpp') diff --git a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp index 049989e9e6..3ee591de8c 100644 --- a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp +++ b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp @@ -288,21 +288,8 @@ void QWindowsSystemTrayIcon::showMessage(const QString &title, const QString &me bool QWindowsSystemTrayIcon::supportsMessages() const { - bool result = true; // The key does typically not exist on Windows 10, default to true. - static const wchar_t regKey[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"; - HKEY handle; - if (RegOpenKeyEx(HKEY_CURRENT_USER, regKey, 0, KEY_READ, &handle) == ERROR_SUCCESS) { - DWORD type; - static const wchar_t subKey[] = L"EnableBalloonTips"; - if (RegQueryValueEx(handle, subKey, 0, &type, 0, 0) == ERROR_SUCCESS && type == REG_DWORD) { - DWORD value; - DWORD size = sizeof(value); - if (RegQueryValueEx(handle, subKey, 0, 0, reinterpret_cast(&value), &size) == ERROR_SUCCESS) - result = value != 0; - } - RegCloseKey(handle); - } - return result; + // The key does typically not exist on Windows 10, default to true. + return QWindowsContext::readAdvancedExplorerSettings(L"EnableBalloonTips", 1) != 0; } QPlatformMenu *QWindowsSystemTrayIcon::createMenu() const -- cgit v1.2.3