[vbox-dev] Help me understanding the following code segment (VBoxGlobal::trayIconInstall())

Huihong Luo huisinro at yahoo.com
Fri Jul 30 17:09:50 GMT 2010


I am having trouble understanding the following code about mVBox.SetExtraData  to "0". How does this check whether tray icon died? shouldn't if (mVBox.isOk()) be if ( ! mVBox.isOk()) ? 
 
This cleans up the tray winid, and will make TrayIcon not singleton.
 
bool VBoxGlobal::trayIconInstall()
{
int rc = 0;
QString strTrayWinID = mVBox.GetExtraData (VBoxDefs::GUI_TrayIconWinID);
if (false == strTrayWinID.isEmpty())
{
/* Check if current tray icon is alive by writing some bogus value. */
mVBox.SetExtraData (VBoxDefs::GUI_TrayIconWinID, "0");
if (mVBox.isOk())
{
/* Current tray icon died - clean up. */
mVBox.SetExtraData (VBoxDefs::GUI_TrayIconWinID, NULL);
strTrayWinID.clear();
}
}
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100730/0757d2b1/attachment.html>


More information about the vbox-dev mailing list