From df965c3e3fbde6fc6b300a4ede603eb6271f11a4 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 23 Nov 2010 15:43:06 +0100 Subject: QHash is a bit faster than QMap and thus preferable if sorting by the key is unneeded Merge-request: 2501 Reviewed-by: Denis Dzyubenko --- src/corelib/io/qfilesystemwatcher_inotify.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index dc18ae7..25ff2b6 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -356,7 +356,7 @@ void QInotifyFileSystemWatcherEngine::readFromInotify() char *at = buffer.data(); char * const end = at + buffSize; - QMap eventForId; + QHash eventForId; while (at < end) { inotify_event *event = reinterpret_cast(at); @@ -368,7 +368,7 @@ void QInotifyFileSystemWatcherEngine::readFromInotify() at += sizeof(inotify_event) + event->len; } - QMap::const_iterator it = eventForId.constBegin(); + QHash::const_iterator it = eventForId.constBegin(); while (it != eventForId.constEnd()) { const inotify_event &event = **it; ++it; -- cgit v0.12 From 0022a5cbf4deb2fd552e4ae954b363914a0e0652 Mon Sep 17 00:00:00 2001 From: miniak Date: Tue, 23 Nov 2010 17:47:28 +0100 Subject: qt_reg_winclass(): use RegisterClassEx() to load the small IDI_ICON1 icon correctly Merge-request: 769 Reviewed-by: Joerg Bornemann --- src/gui/kernel/qapplication_win.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 1dab738..67e2cbb 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1053,7 +1053,12 @@ const QString qt_reg_winclass(QWidget *w) // register window class if (winclassNames()->contains(cname)) // already registered in our list return cname; +#ifndef Q_WS_WINCE + WNDCLASSEX wc; + wc.cbSize = sizeof(WNDCLASSEX); +#else WNDCLASS wc; +#endif wc.style = style; wc.lpfnWndProc = (WNDPROC)QtWndProc; wc.cbClsExtra = 0; @@ -1062,11 +1067,20 @@ const QString qt_reg_winclass(QWidget *w) // register window class if (icon) { wc.hIcon = (HICON)LoadImage(qWinAppInst(), L"IDI_ICON1", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); #ifndef Q_WS_WINCE - if (!wc.hIcon) + if (wc.hIcon) { + int sw = GetSystemMetrics(SM_CXSMICON); + int sh = GetSystemMetrics(SM_CYSMICON); + wc.hIconSm = (HICON)LoadImage(qWinAppInst(), L"IDI_ICON1", IMAGE_ICON, sw, sh, 0); + } else { wc.hIcon = (HICON)LoadImage(0, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED); + wc.hIconSm = 0; + } #endif } else { wc.hIcon = 0; +#ifndef Q_WS_WINCE + wc.hIconSm = 0; +#endif } wc.hCursor = 0; #ifndef Q_WS_WINCE @@ -1080,7 +1094,11 @@ const QString qt_reg_winclass(QWidget *w) // register window class wc.lpszMenuName = 0; wc.lpszClassName = (wchar_t*)cname.utf16(); +#ifndef Q_WS_WINCE + ATOM atom = RegisterClassEx(&wc); +#else ATOM atom = RegisterClass(&wc); +#endif #ifndef QT_NO_DEBUG if (!atom) -- cgit v0.12