summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_s60.cpp
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-09-03 14:43:44 (GMT)
committeraxis <qt-info@nokia.com>2009-09-03 14:43:44 (GMT)
commit0adfe49f2deb1d6995753a23405317f91b487c51 (patch)
tree8bfcfca6e8a429a9690b704c4ba2456f6ac8645a /src/gui/kernel/qapplication_s60.cpp
parentf360180890298618ef3284c08789c2a243e1ba9d (diff)
parentc13b97f2f24d2ff2e62bedead5e3d50f8b992c1a (diff)
downloadQt-0adfe49f2deb1d6995753a23405317f91b487c51.zip
Qt-0adfe49f2deb1d6995753a23405317f91b487c51.tar.gz
Qt-0adfe49f2deb1d6995753a23405317f91b487c51.tar.bz2
Merge branch 'minimizeWrapperApp' into 4.6
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp34
1 files changed, 30 insertions, 4 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()