diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-14 08:38:42 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-14 08:38:42 (GMT) |
commit | b371999d3e9c207047be6afda89d008b6cf04763 (patch) | |
tree | 7e2da63139dfc732edcfac73f13ee2b4d998d540 /src/corelib/kernel | |
parent | 4af9cc043370846c52ec21cf874696ee650394c1 (diff) | |
parent | 0711bb704ef5cdd20d5079418c256e3502258613 (diff) | |
download | Qt-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/kernel')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 7 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication_win.cpp | 51 |
2 files changed, 17 insertions, 41 deletions
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); } /*! |