src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogpluginmanager.cpp
changeset 30 80e4d18b72f5
parent 28 b7da29130b0e
equal deleted inserted replaced
28:b7da29130b0e 30:80e4d18b72f5
    52 
    52 
    53     Plugins may also specify a keep loaded flag. These are kept loaded in memory after they
    53     Plugins may also specify a keep loaded flag. These are kept loaded in memory after they
    54     have been loaded first time.
    54     have been loaded first time.
    55 */
    55 */
    56 
    56 
    57 // Created widget gets a property added containing the device dialog type.
       
    58 
       
    59 // declared but never referenced:
       
    60 //static const char deviceDialogTypePropertyName[] = "HbDevDlgPlugManXX";
       
    61 
       
    62 // Constructor
    57 // Constructor
    63 HbDeviceDialogPluginManager::HbDeviceDialogPluginManager(Flags flags, QObject *parent) :
    58 HbDeviceDialogPluginManager::HbDeviceDialogPluginManager(Flags flags, QObject *parent) :
    64     QObject(parent), mNameCache(pluginKeys)
    59     QObject(parent), mNameCache(pluginKeys)
    65 {
    60 {
    66     TRACE_ENTRY
    61     TRACE_ENTRY
   132         // Create widget
   127         // Create widget
   133         QObject *pluginInstance = pluginInfo.mLoader->instance();
   128         QObject *pluginInstance = pluginInfo.mLoader->instance();
   134         if (pluginInstance) {
   129         if (pluginInstance) {
   135             HbDeviceDialogPluginInterface *pluginIf =
   130             HbDeviceDialogPluginInterface *pluginIf =
   136                 qobject_cast<HbDeviceDialogPluginInterface*>(pluginInstance);
   131                 qobject_cast<HbDeviceDialogPluginInterface*>(pluginInstance);
   137             widgetIf = pluginIf->createDeviceDialog(deviceDialogType, parameters);
   132             try {
       
   133                 widgetIf = pluginIf->createDeviceDialog(deviceDialogType, parameters);
       
   134             } catch (const std::bad_alloc &) {
       
   135             }
   138             if (widgetIf) {
   136             if (widgetIf) {
   139                 pluginInfo.mWidgets.append(widgetIf);
   137                 pluginInfo.mWidgets.append(widgetIf);
   140                 pluginInfo.mRefCount++;
   138                 pluginInfo.mRefCount++;
   141             } else {
   139             } else {
   142                 error = static_cast<HbDeviceDialogPlugin *>(pluginInstance)->error();
   140                 error = static_cast<HbDeviceDialogPlugin *>(pluginInstance)->error();