summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-14 08:38:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-14 08:38:42 (GMT)
commitb371999d3e9c207047be6afda89d008b6cf04763 (patch)
tree7e2da63139dfc732edcfac73f13ee2b4d998d540 /src/corelib
parent4af9cc043370846c52ec21cf874696ee650394c1 (diff)
parent0711bb704ef5cdd20d5079418c256e3502258613 (diff)
downloadQt-b371999d3e9c207047be6afda89d008b6cf04763.zip
Qt-b371999d3e9c207047be6afda89d008b6cf04763.tar.gz
Qt-b371999d3e9c207047be6afda89d008b6cf04763.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (55 commits) Revert "Removed double setting of _WIN32_WINNT" Revert "removed a few warnings on wince builds" removed a few warnings on wince builds Removed double setting of _WIN32_WINNT QTreeView: remove dead code. doc: Clarify effect of QFont::NoFontMerging Revert "Implement heightForWidth support for QTabWidget and QStackedLayout." build fix for S60 Improve handling of QAction in soft key manager Remove useless assert qdrawhelper: fix optim in 2245641ba QSlider and StyleSheet: fix one pixel error while drawing the SliderAddPage accelerate QWindowsPipeWriter for bigger chunks of data Fix antialiasing with transformed text in OpenGL2 paint engine Fix flattening of largely scaled, thin, dashed beziers. Increased the precision used to flatten beziers Fix QT_NO_MOVIE Fix compile error with QT_NO_ACTION in QtGui Fix QT_NO_COMPLETER Fix QT_NO_FSCOMPLETER ...
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp6
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp7
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp51
-rw-r--r--src/corelib/tools/qsimd_p.h3
4 files changed, 22 insertions, 45 deletions
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index 417439f..2fe4424 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -128,11 +128,9 @@ void QWindowsPipeWriter::run()
overl.OffsetHigh = 0;
while ((!quitNow) && totalWritten < maxlen) {
DWORD written = 0;
- // Write 2k at a time to prevent flooding the pipe. If you
- // write too much (4k-8k), the pipe can close
- // unexpectedly.
if (!WriteFile(writePipe, ptrData + totalWritten,
- qMin<int>(2048, maxlen - totalWritten), &written, &overl)) {
+ maxlen - totalWritten, &written, &overl)) {
+
if (GetLastError() == 0xE8/*NT_STATUS_INVALID_USER_BUFFER*/) {
// give the os a rest
msleep(100);
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 1a1f978..bf2e2e4 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -523,8 +523,6 @@ QCoreApplication::QCoreApplication(int &argc, char **argv)
}
-extern void set_winapp_name();
-
// ### move to QCoreApplicationPrivate constructor?
void QCoreApplication::init()
{
@@ -535,11 +533,6 @@ void QCoreApplication::init()
qt_locale_initialized = true;
#endif
-#ifdef Q_WS_WIN
- // Get the application name/instance if qWinMain() was not invoked
- set_winapp_name();
-#endif
-
Q_ASSERT_X(!self, "QCoreApplication", "there should be only one application object");
QCoreApplication::self = this;
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index c1925e7..320f801 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -52,26 +52,31 @@
QT_BEGIN_NAMESPACE
-char appFileName[MAX_PATH]; // application file name
-char theAppName[MAX_PATH]; // application name
-HINSTANCE appInst = 0; // handle to app instance
-HINSTANCE appPrevInst = 0; // handle to prev app instance
-int appCmdShow = 0;
bool usingWinMain = false; // whether the qWinMain() is used or not
+int appCmdShow = 0;
Q_CORE_EXPORT HINSTANCE qWinAppInst() // get Windows app handle
{
- return appInst;
+ return GetModuleHandle(0);
}
Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app handle
{
- return appPrevInst;
+ return 0;
}
Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command
{
+#if defined(Q_OS_WINCE)
return appCmdShow;
+#else
+ STARTUPINFO startupInfo;
+ GetStartupInfo(&startupInfo);
+
+ return (startupInfo.dwFlags & STARTF_USESHOWWINDOW)
+ ? startupInfo.wShowWindow
+ : SW_SHOWDEFAULT;
+#endif
}
Q_CORE_EXPORT QString qAppFileName() // get application file name
@@ -115,25 +120,6 @@ Q_CORE_EXPORT QString qAppFileName() // get application file name
return res;
}
-void set_winapp_name()
-{
- static bool already_set = false;
- if (!already_set) {
- already_set = true;
-
- QString moduleName = qAppFileName();
-
- QByteArray filePath = moduleName.toLocal8Bit();
- QByteArray fileName = QFileInfo(moduleName).baseName().toLocal8Bit();
-
- memcpy(appFileName, filePath.constData(), filePath.length());
- memcpy(theAppName, fileName.constData(), fileName.length());
-
- if (appInst == 0)
- appInst = GetModuleHandle(0);
- }
-}
-
QString QCoreApplicationPrivate::appName() const
{
return QFileInfo(qAppFileName()).baseName();
@@ -198,20 +184,17 @@ void qWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam,
already_called = true;
usingWinMain = true;
- // Install default debug handler
-
+ // Install default debug handler
qInstallMsgHandler(qWinMsgHandler);
- // Create command line
-
+ // Create command line
argv = qWinCmdLine<char>(cmdParam, int(strlen(cmdParam)), argc);
- // Get Windows parameters
- appInst = instance;
- appPrevInst = prevInstance;
appCmdShow = cmdShow;
- set_winapp_name();
+ // Ignore Windows parameters
+ Q_UNUSED(instance);
+ Q_UNUSED(prevInstance);
}
/*!
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index c69dd09..cbe6146 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -66,6 +66,9 @@ QT_BEGIN_HEADER
# include <emmintrin.h>
# undef posix_memalign
#else
+# ifdef Q_CC_MINGW
+# include <windows.h>
+# endif
# include <emmintrin.h>
#endif