Replace all g_idle_add
s with IdleRegister
(#3767)
This commit is contained in:
@@ -45,7 +45,7 @@ LensGeometry::LensGeometry () : FoldableToolPanel(this, "lensgeom", M("TP_LENSGE
|
||||
|
||||
LensGeometry::~LensGeometry ()
|
||||
{
|
||||
g_idle_remove_by_data(this);
|
||||
idle_register.destroy();
|
||||
}
|
||||
|
||||
void LensGeometry::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||
@@ -121,27 +121,26 @@ void LensGeometry::setBatchMode (bool batchMode)
|
||||
|
||||
void LensGeometry::disableAutoFillIfActive ()
|
||||
{
|
||||
g_idle_add(doDisableAutoFillIfActive, this);
|
||||
}
|
||||
const auto func = [](gpointer data) -> gboolean {
|
||||
GThreadLock lock; // Is this really needed?
|
||||
|
||||
int LensGeometry::doDisableAutoFillIfActive (void* data)
|
||||
{
|
||||
GThreadLock lock; // Is this really needed?
|
||||
LensGeometry* const instance = static_cast<LensGeometry*>(data);
|
||||
|
||||
LensGeometry* const instance = static_cast<LensGeometry*>(data);
|
||||
if (!instance->batchMode) {
|
||||
if (instance->fill->get_active()) {
|
||||
instance->fillConn.block(true);
|
||||
instance->fill->set_active(false);
|
||||
|
||||
if (!instance->batchMode) {
|
||||
if (instance->fill->get_active()) {
|
||||
instance->fillConn.block (true);
|
||||
instance->fill->set_active(false);
|
||||
if (instance->listener) {
|
||||
instance->listener->panelChanged (EvTransAutoFill, M("GENERAL_DISABLED"));
|
||||
}
|
||||
|
||||
if (instance->listener) {
|
||||
instance->listener->panelChanged (EvTransAutoFill, M("GENERAL_DISABLED"));
|
||||
instance->fillConn.block(false);
|
||||
}
|
||||
|
||||
instance->fillConn.block (false);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
idle_register.add(func, this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user