Code review comment for lp:~azzar1/unity/fix-870143

Revision history for this message
Andrea Azzarone (azzar1) wrote :

> 52 + BamfLauncherIcon* bamf_icon =
> dynamic_cast<BamfLauncherIcon*>(_drag_icon);
>
> Ouch. Guess there's no way to work around that ?

Mmm, we can abstract it. I mean we can do something like that:

class LauncherIcon
{
...
virtual void OnDropOnTrash(); // Maybe we can choose a better name :)
}

then
class BamfLauncherIcon : public LauncherIcon
{
...
void OnDropOnTrash() { bla bla bla }
}

and
class DeviceLauncherIcon : public LauncherIcon
{
...
void OnDropOnTrash() { la la la la la la}
}

What do you think?

« Back to merge proposal