diff options
author | axis <qt-info@nokia.com> | 2009-09-03 14:43:44 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-09-03 14:43:44 (GMT) |
commit | 0adfe49f2deb1d6995753a23405317f91b487c51 (patch) | |
tree | 8bfcfca6e8a429a9690b704c4ba2456f6ac8645a /src/gui/kernel | |
parent | f360180890298618ef3284c08789c2a243e1ba9d (diff) | |
parent | c13b97f2f24d2ff2e62bedead5e3d50f8b992c1a (diff) | |
download | Qt-0adfe49f2deb1d6995753a23405317f91b487c51.zip Qt-0adfe49f2deb1d6995753a23405317f91b487c51.tar.gz Qt-0adfe49f2deb1d6995753a23405317f91b487c51.tar.bz2 |
Merge branch 'minimizeWrapperApp' into 4.6
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 34 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 4 |
3 files changed, 34 insertions, 5 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 8561045..220b222 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -63,10 +63,13 @@ #include "apgwgnam.h" // For CApaWindowGroupName #include <MdaAudioTonePlayer.h> // For CMdaAudioToneUtility -#if !defined(QT_NO_IM) && defined(Q_WS_S60) -#include "qinputcontext.h" -#include <private/qcoefepinputcontext_p.h> -#endif // !defined(QT_NO_IM) && defined(Q_WS_S60) +#if defined(Q_WS_S60) +# if !defined(QT_NO_IM) +# include "qinputcontext.h" +# include <private/qcoefepinputcontext_p.h> +# endif +# include <private/qs60mainapplication_p.h> +#endif #include "private/qstylesheetstyle_p.h" @@ -715,6 +718,22 @@ TTypeUid::Ptr QSymbianControl::MopSupplyObject(TTypeUid id) void qt_init(QApplicationPrivate * /* priv */, int) { + if (!CCoeEnv::Static()) { + // The S60 framework has not been initalized. We need to do it. + TApaApplicationFactory factory(NewApplication); + CApaCommandLine* commandLine = 0; + TInt err = CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine); + // After this construction, CEikonEnv will be available from CEikonEnv::Static(). + // (much like our qApp). + CEikonEnv* coe = new CEikonEnv; + QT_TRAP_THROWING(coe->ConstructAppFromCommandLineL(factory,*commandLine)); + delete commandLine; + + S60->qtOwnsS60Environment = true; + } else { + S60->qtOwnsS60Environment = false; + } + #ifdef QT_NO_DEBUG if (!qgetenv("QT_S60_AUTO_FLUSH_WSERV").isEmpty()) #endif @@ -766,6 +785,13 @@ void qt_cleanup() // it dies. delete QApplicationPrivate::inputContext; QApplicationPrivate::inputContext = 0; + + if (S60->qtOwnsS60Environment) { + CEikonEnv* coe = CEikonEnv::Static(); + coe->PrepareToExit(); + // The CEikonEnv itself is destroyed in here. + coe->DestroyEnvironment(); + } } void QApplicationPrivate::initializeWidgetPaletteHash() diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 78301af..ea1ca69 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -95,6 +95,7 @@ public: int screenHeightInTwips; int defaultDpiX; int defaultDpiY; + int qtOwnsS60Environment : 1; static inline void updateScreenSize(); static inline RWsSession& wsSession(); static inline RWindowGroup& windowGroup(); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 6da35d8..d630143 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -722,7 +722,9 @@ void QWidgetPrivate::setWindowIcon_sys(bool forceReset) // The API to get title_pane graphics size is not public -> assume square space based // on titlebar font height. CAknBitmap would be optimum, wihtout setting the size, since // then title pane would automatically scale the bitmap. Unfortunately it is not public API - const CFont * font = AknLayoutUtils::FontFromId(EAknLogicalFontTitleFont); + // Also this function is leaving, although it is not named as such. + const CFont * font; + QT_TRAP_THROWING(font = AknLayoutUtils::FontFromId(EAknLogicalFontTitleFont)); TSize iconSize(font->HeightInPixels(), font->HeightInPixels()); QIcon icon = q->windowIcon(); |