Remove legacy IdleRegister::add<>()

This commit is contained in:
Flössie
2019-01-01 20:58:26 +01:00
parent 732bbf1a55
commit b21d910573
11 changed files with 128 additions and 267 deletions

View File

@@ -217,45 +217,27 @@ void FileBrowserEntry::updateImage(rtengine::IImage8* img, double scale, const r
redrawRequests++;
feih->pending++;
struct tiupdate {
FileBrowserEntryIdleHelper* feih;
rtengine::IImage8* img;
double scale;
rtengine::procparams::CropParams cropParams;
};
tiupdate* param = new tiupdate{
feih,
img,
scale,
cropParams
};
const gint priority = G_PRIORITY_LOW;
const auto func =
[](tiupdate* params) -> bool
idle_register.add(
[this, img, scale, cropParams]() -> bool
{
FileBrowserEntryIdleHelper* const feih = params->feih;
if (feih->destroyed) {
if (feih->pending == 1) {
delete feih;
} else {
feih->pending--;
--feih->pending;
}
params->img->free ();
img->free();
return false;
}
feih->fbentry->_updateImage (params->img, params->scale, params->cropParams);
feih->pending--;
feih->fbentry->_updateImage(img, scale, cropParams);
--feih->pending;
return false;
};
idle_register.add<tiupdate>(func, param, true, priority);
},
G_PRIORITY_LOW
);
}
void FileBrowserEntry::_updateImage(rtengine::IImage8* img, double s, const rtengine::procparams::CropParams& cropParams)