diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-05-08 17:27:44 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-06-13 07:04:32 +0000 |
commit | 4b63565bbce6306465cc17284f488932cac13f95 (patch) | |
tree | 9fe8e92956e8736ff8e6e53dbac09247f4807c4f /src/plugins/platforms/windows/qwindowssystemtrayicon.cpp | |
parent | b05d1c2ebfebf0f427a92668c0a7b177d0952012 (diff) |
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 <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowssystemtrayicon.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowssystemtrayicon.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
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<unsigned char *>(&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 |