videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/xqpluginloader.cpp
changeset 44 518105d52e45
parent 36 8aed59de29f9
child 58 d2b028fd1f7d
equal deleted inserted replaced
42:17f382c040b1 44:518105d52e45
    13 *
    13 *
    14 * Description:   XQPluginLoader stub
    14 * Description:   XQPluginLoader stub
    15 *
    15 *
    16 */
    16 */
    17 
    17 
       
    18 // Version : %version: %
       
    19 
    18 #include "stub/inc/xqpluginloader.h"
    20 #include "stub/inc/xqpluginloader.h"
    19 #include "stub/inc/xqplugininfo.h"
    21 #include "stub/inc/xqplugininfo.h"
    20 #include "testviewplugin.h"
    22 #include "testviewplugin.h"
    21 #include "mpxvideo_debug.h"
    23 #include "mpxvideo_debug.h"
    22 
    24 
    23 QHash<int, MpxViewPlugin*> XQPluginLoader::mPluginList;
    25 QHash<int, MpxViewPlugin*> XQPluginLoader::mPluginList;
    24 int XQPluginLoader::mFailToLoadPluginUid = -1;
    26 int XQPluginLoader::mFailToLoadPluginUid = -1;
    25 
    27 
       
    28 // -------------------------------------------------------------------------------------------------
       
    29 // XQPluginLoader::XQPluginLoader()
       
    30 // -------------------------------------------------------------------------------------------------
       
    31 //
    26 XQPluginLoader::XQPluginLoader( int uid, QObject* parent )
    32 XQPluginLoader::XQPluginLoader( int uid, QObject* parent )
    27 {
    33 {
    28     MPX_DEBUG(_L("XQPluginLoader::XQPluginLoader()"));  
    34     MPX_DEBUG(_L("XQPluginLoader::XQPluginLoader()"));  
    29     
    35     
    30     Q_UNUSED( parent );    
    36     Q_UNUSED( parent );    
       
    37     
    31     mUid = uid;
    38     mUid = uid;
    32 }
    39 }
    33 
    40 
       
    41 // -------------------------------------------------------------------------------------------------
       
    42 // XQPluginLoader::~XQPluginLoader()
       
    43 // -------------------------------------------------------------------------------------------------
       
    44 //
    34 XQPluginLoader::~XQPluginLoader()
    45 XQPluginLoader::~XQPluginLoader()
    35 {
    46 {
    36     MPX_DEBUG(_L("XQPluginLoader::~XQPluginLoader()"));      
    47     MPX_DEBUG(_L("XQPluginLoader::~XQPluginLoader()"));      
    37 }
    48 }
    38 
    49 
       
    50 // -------------------------------------------------------------------------------------------------
       
    51 // XQPluginLoader::listImplementations()
       
    52 // -------------------------------------------------------------------------------------------------
       
    53 //
    39 bool XQPluginLoader::listImplementations( const QString &interfaceName, 
    54 bool XQPluginLoader::listImplementations( const QString &interfaceName, 
    40                                           QList<XQPluginInfo > &impls )
    55                                           QList<XQPluginInfo > &impls )
    41 {
    56 {
    42     MPX_DEBUG(_L("XQPluginLoader::listImplementations()"));  
    57     MPX_DEBUG(_L("XQPluginLoader::listImplementations()"));  
       
    58     
       
    59     Q_UNUSED( interfaceName );
       
    60     Q_UNUSED( impls );
       
    61     
    43     return true;
    62     return true;
    44 }
    63 }
    45 
    64 
       
    65 // -------------------------------------------------------------------------------------------------
       
    66 // XQPluginLoader::instance()
       
    67 // -------------------------------------------------------------------------------------------------
       
    68 //
    46 QObject* XQPluginLoader::instance()
    69 QObject* XQPluginLoader::instance()
    47 {
    70 {
    48     MPX_ENTER_EXIT(_L("XQPluginLoader::instance()"));
    71     MPX_ENTER_EXIT(_L("XQPluginLoader::instance()"));
    49     
    72     
    50     if ( mUid == mFailToLoadPluginUid )
    73     if ( mUid == mFailToLoadPluginUid )
    58     }
    81     }
    59 
    82 
    60     return mPluginList[mUid];
    83     return mPluginList[mUid];
    61 }
    84 }
    62 
    85 
       
    86 // -------------------------------------------------------------------------------------------------
       
    87 // XQPluginLoader::cleanup()
       
    88 // -------------------------------------------------------------------------------------------------
       
    89 //
    63 void XQPluginLoader::cleanup()
    90 void XQPluginLoader::cleanup()
    64 {
    91 {
    65     MPX_ENTER_EXIT(_L("XQPluginLoader::cleanup()"));
    92     MPX_ENTER_EXIT(_L("XQPluginLoader::cleanup()"));
    66     
    93     
    67     QHash<int, MpxViewPlugin*>::const_iterator i = mPluginList.constBegin();
    94     QHash<int, MpxViewPlugin*>::const_iterator i = mPluginList.constBegin();
    73         delete i.value();
   100         delete i.value();
    74          ++i;
   101          ++i;
    75     }
   102     }
    76 }
   103 }
    77 
   104 
    78 /**
   105 // -------------------------------------------------------------------------------------------------
    79  * Sets plugin load to fail.
   106 // XQPluginLoader::setPluginLoadFailure()
    80  */
   107 // -------------------------------------------------------------------------------------------------
       
   108 //
    81 void XQPluginLoader::setPluginLoadFailure( int uid )
   109 void XQPluginLoader::setPluginLoadFailure( int uid )
    82 {
   110 {
    83     MPX_DEBUG(_L("XQPluginLoader::setPluginLoadFailure()"));
   111     MPX_DEBUG(_L("XQPluginLoader::setPluginLoadFailure()"));
       
   112     
    84     mFailToLoadPluginUid = uid;
   113     mFailToLoadPluginUid = uid;
    85 }
   114 }