diff -r b7da29130b0e -r 80e4d18b72f5 src/hbcore/devicedialogbase/hbdevicedialogplugin.cpp --- a/src/hbcore/devicedialogbase/hbdevicedialogplugin.cpp Fri Sep 17 08:32:10 2010 +0300 +++ b/src/hbcore/devicedialogbase/hbdevicedialogplugin.cpp Mon Oct 04 00:38:12 2010 +0300 @@ -93,8 +93,25 @@ function returns false. In addition, HbDeviceDialogPlugin constructor has a check which allows only device dialog service to load plugins derived from it. + \section _exceptions Exception handling + + Device dialog service uses two strategies in exception handling: Avoidance and trapping. + Memory allocation exceptions while a dialog is running are avoided by ensuring there is + sufficient heap space available before allowing new dialogs. Trapping is used while + a dialog is created. A call to createDeviceDialog() is enclosed in try/catch block. + Memory allocation exception causes dialog creation to fail and an error is returned + to a client. Plugin should take care there are no memory leaks if exception is thrown + inside createDeviceDialog(). All calls to HbDeviceDialogInterface functions are trapped + and thrown allocation exceptions are ignored. Plugins can provide more fine grained + exception handling by trapping exceptions themselves. + \section _checklist Checklist for well behaving device dialogs + Well behaving plugin should observe following rules: + - Delay plugin initializations until HbDeviceDialogPluginInterface::createDeviceDialog() is + called. Plugin may be loaded/unloaded several times by different threads during plugin search. + The search is slowed down by unnessary initializations by plugins. + Well behaving dialog widget should observe following rules: - Should not create and show other dialogs - No calls to show(), hide() or setVisible() @@ -663,7 +680,9 @@ #include #endif // Q_OS_SYMBIAN -// Constructor +/*! + Constructs HbDeviceDialogPlugin. +*/ HbDeviceDialogPlugin::HbDeviceDialogPlugin() { #ifdef Q_OS_SYMBIAN @@ -677,7 +696,9 @@ #endif // Q_OS_SYMBIAN } -// Destructor +/*! + Destructs HbDeviceDialogPlugin. +*/ HbDeviceDialogPlugin::~HbDeviceDialogPlugin() { }