main/glxapplication.cpp
branchGCC_SURGE
changeset 51 525c140ec8db
parent 48 d0b4e67b3a60
child 58 383b67fbdb11
equal deleted inserted replaced
38:c9962d0368d9 51:525c140ec8db
       
     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>
       
    21 #include <w32std.h>
       
    22 
       
    23 //userinclude
       
    24 #include "glxapplication.h"
       
    25 #include "mglxcache.h"
       
    26 
       
    27 GlxApplication::GlxApplication( int &argc, char *argv[ ], Hb::ApplicationFlags flags )
       
    28     : HbApplication( argc, argv, flags )
       
    29 {
       
    30 }
       
    31 
       
    32 GlxApplication::GlxApplication( QApplication::QS60MainApplicationFactory factory, int &argc, char *argv[], Hb::ApplicationFlags flags  )
       
    33     : HbApplication( factory, argc, argv, flags )
       
    34 {
       
    35 }
       
    36 
       
    37 bool GlxApplication::symbianEventFilter(const QSymbianEvent *aQSEvent)
       
    38 {
       
    39     if ( aQSEvent->type( ) == QSymbianEvent::WindowServerEvent ) {
       
    40         const TWsEvent *aEvent = aQSEvent->windowServerEvent();
       
    41         if ( aEvent && aEvent->Type() == KAppOomMonitor_FreeRam ) {
       
    42             cleanUpCache();
       
    43         }
       
    44     }
       
    45     return HbApplication::symbianEventFilter( aQSEvent );
       
    46 }
       
    47 
       
    48 void GlxApplication::cleanUpCache()
       
    49 {
       
    50     qDebug("GlxApplication::cleanUpCache()");
       
    51     MGlxCache* cacheManager = MGlxCache::InstanceL();
       
    52     cacheManager->ReleaseRAML(true);
       
    53     cacheManager->Close();
       
    54 }
       
    55