Review IdleRegister
(#4892)
This turns `IdleRegister::add()` into a template function to make the provided function pointers type safe. It also adds a `delete_data` parameter to manage the provided data pointer even in `destroy()`.
This commit is contained in:
@@ -139,12 +139,14 @@ FilePanel::FilePanel () : parent(nullptr), error(0)
|
||||
|
||||
fileCatalog->setFileSelectionListener (this);
|
||||
|
||||
const auto func = [](gpointer data) -> gboolean {
|
||||
static_cast<FilePanel*>(data)->init();
|
||||
return FALSE;
|
||||
};
|
||||
const auto func =
|
||||
[](FilePanel* self) -> bool
|
||||
{
|
||||
self->init();
|
||||
return false;
|
||||
};
|
||||
|
||||
idle_register.add(func, this);
|
||||
idle_register.add<FilePanel>(func, this, false);
|
||||
|
||||
show_all ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user