Replace all g_idle_adds with IdleRegister (#3767)

This commit is contained in:
Flössie
2017-03-26 22:03:33 +02:00
parent 39ca290ca9
commit 91b44dbd08
25 changed files with 419 additions and 403 deletions

View File

@@ -100,6 +100,11 @@ DirBrowser::DirBrowser () : dirTreeModel(),
scrolledwindow4->show ();
}
DirBrowser::~DirBrowser()
{
idle_register.destroy();
}
void DirBrowser::fillDirTree ()
{
@@ -227,16 +232,16 @@ int updateVolumesUI (void* br)
(static_cast<DirBrowser*>(br))->updateVolumes ();
return 1;
}
int updateDirTreeUI (void* br)
{
(static_cast<DirBrowser*>(br))->updateDirTreeRoot ();
return 0;
}
void DirBrowser::winDirChanged ()
{
const auto func = [](gpointer data) -> gboolean {
static_cast<DirBrowser*>(data)->updateDirTreeRoot();
g_idle_add (updateDirTreeUI, this);
return FALSE;
};
idle_register.add(func, this);
}
#endif