summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-11-23 17:10:25 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-11-23 17:10:25 (GMT)
commit47727e76d44302bd870b8fc2bbae71052dcdc27a (patch)
treec1a8ac669796ad9237bd55d8c1e243ac740bbc8e
parent3fa2a510aae1e0c5e18f3b6962c54fae92f3d176 (diff)
parent0022a5cbf4deb2fd552e4ae954b363914a0e0652 (diff)
downloadQt-47727e76d44302bd870b8fc2bbae71052dcdc27a.zip
Qt-47727e76d44302bd870b8fc2bbae71052dcdc27a.tar.gz
Qt-47727e76d44302bd870b8fc2bbae71052dcdc27a.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: qt_reg_winclass(): use RegisterClassEx() to load the small IDI_ICON1 icon correctly QHash is a bit faster than QMap and thus preferable if sorting by the key is unneeded
-rw-r--r--src/corelib/io/qfilesystemwatcher_inotify.cpp4
-rw-r--r--src/gui/kernel/qapplication_win.cpp20
2 files changed, 21 insertions, 3 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<int, inotify_event *> eventForId;
+ QHash<int, inotify_event *> eventForId;
while (at < end) {
inotify_event *event = reinterpret_cast<inotify_event *>(at);
@@ -368,7 +368,7 @@ void QInotifyFileSystemWatcherEngine::readFromInotify()
at += sizeof(inotify_event) + event->len;
}
- QMap<int, inotify_event *>::const_iterator it = eventForId.constBegin();
+ QHash<int, inotify_event *>::const_iterator it = eventForId.constBegin();
while (it != eventForId.constEnd()) {
const inotify_event &event = **it;
++it;
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)