summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2015-08-17 09:39:46 +0200
committerSamuel Gaist <samuel.gaist@edeltech.ch>2015-09-22 21:40:21 +0000
commit847d5d1309a4365af7d0f4fa1bff5754b8286e34 (patch)
treeea1f490de65049405f50785bf58e62a8f63420c9 /src
parent9c71f55ef9575c0168bf8d0b305ec9591a61999d (diff)
Implement sessionId/key generation on Windows
sessionId and sessionKey generation on Windows was lost in the transition of Qt 4 to Qt 5. During the reimplementation of the QSessionManagement feature, that part has been missed. This patch fixes that. Based on Qt 4 [ChangeLog][QtGui][Windows] Fixed a regression where both sessionId/sessionKey were empty Task-number: QTBUG-47690 Change-Id: I17b5fbee9d0979d292d30b94b3a2cc3107fc54fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qguiapplication.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 736580f547..710aa714b7 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -99,6 +99,9 @@
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
# include <QtCore/qt_windows.h>
# include <QtCore/QLibraryInfo>
+# if defined(Q_OS_WINPHONE)
+# include <Objbase.h>
+# endif
#endif // Q_OS_WIN && !Q_OS_WINCE
#include <ctype.h>
@@ -1232,6 +1235,16 @@ void QGuiApplicationPrivate::init()
#ifndef QT_NO_SESSIONMANAGER
QString session_id;
QString session_key;
+# if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+ wchar_t guidstr[40];
+ GUID guid;
+ CoCreateGuid(&guid);
+ StringFromGUID2(guid, guidstr, 40);
+ session_id = QString::fromWCharArray(guidstr);
+ CoCreateGuid(&guid);
+ StringFromGUID2(guid, guidstr, 40);
+ session_key = QString::fromWCharArray(guidstr);
+# endif
#endif
int j = argc ? 1 : 0;
for (int i=1; i<argc; i++) {