44
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
//include
|
|
19 |
#include <qsymbianevent.h>
|
|
20 |
#include <oommonitorplugin.h>
|
58
|
21 |
#include <hbinstance.h>
|
44
|
22 |
#include <w32std.h>
|
|
23 |
|
|
24 |
//userinclude
|
|
25 |
#include "glxapplication.h"
|
|
26 |
#include "mglxcache.h"
|
|
27 |
|
|
28 |
GlxApplication::GlxApplication( int &argc, char *argv[ ], Hb::ApplicationFlags flags )
|
|
29 |
: HbApplication( argc, argv, flags )
|
|
30 |
{
|
|
31 |
}
|
|
32 |
|
|
33 |
GlxApplication::GlxApplication( QApplication::QS60MainApplicationFactory factory, int &argc, char *argv[], Hb::ApplicationFlags flags )
|
|
34 |
: HbApplication( factory, argc, argv, flags )
|
|
35 |
{
|
|
36 |
}
|
|
37 |
|
|
38 |
bool GlxApplication::symbianEventFilter(const QSymbianEvent *aQSEvent)
|
|
39 |
{
|
|
40 |
if ( aQSEvent->type( ) == QSymbianEvent::WindowServerEvent ) {
|
|
41 |
const TWsEvent *aEvent = aQSEvent->windowServerEvent();
|
|
42 |
if ( aEvent && aEvent->Type() == KAppOomMonitor_FreeRam ) {
|
|
43 |
cleanUpCache();
|
|
44 |
}
|
|
45 |
}
|
|
46 |
return HbApplication::symbianEventFilter( aQSEvent );
|
|
47 |
}
|
|
48 |
|
58
|
49 |
void GlxApplication::initMattiAutomation()
|
|
50 |
{
|
|
51 |
//For Matti Automation
|
|
52 |
//Monitor the first view ready signal to emit the application ready signal.
|
|
53 |
HbMainWindow *window = hbInstance->allMainWindows().first();
|
|
54 |
connect( window, SIGNAL( viewReady() ), this, SLOT( handleAppReady() ) );
|
|
55 |
}
|
|
56 |
|
|
57 |
void GlxApplication::handleAppReady()
|
|
58 |
{
|
|
59 |
emit applicationReady();
|
|
60 |
HbMainWindow *window = hbInstance->allMainWindows().first();
|
|
61 |
disconnect( window, SIGNAL( viewReady() ), this, SLOT( handleAppReady() ) );
|
|
62 |
}
|
|
63 |
|
44
|
64 |
void GlxApplication::cleanUpCache()
|
|
65 |
{
|
|
66 |
qDebug("GlxApplication::cleanUpCache()");
|
|
67 |
MGlxCache* cacheManager = MGlxCache::InstanceL();
|
|
68 |
cacheManager->ReleaseRAML(true);
|
|
69 |
cacheManager->Close();
|
|
70 |
}
|
|
71 |
|