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:
@@ -170,13 +170,14 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) : parent(nullptr)
|
||||
show_all ();
|
||||
|
||||
if (batchQueue->loadBatchQueue()) {
|
||||
const auto func = [](gpointer data) -> gboolean {
|
||||
static_cast<BatchQueue*>(data)->resizeLoadedQueue();
|
||||
const auto func =
|
||||
[](BatchQueue* bq) -> bool
|
||||
{
|
||||
bq->resizeLoadedQueue();
|
||||
return false;
|
||||
};
|
||||
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
idle_register.add(func, batchQueue, G_PRIORITY_LOW);
|
||||
idle_register.add<BatchQueue>(func, batchQueue, false, G_PRIORITY_LOW);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user