ethumb: fix wrong dirty detection.
Patch by SANS Mikael <sans.mikael@gmail.com>. SVN revision: 63021
This commit is contained in:
parent
b8e42ad9cd
commit
8385a7dec0
|
@ -1 +1,3 @@
|
||||||
Rafael Antognolli <antognolli@profusion.mobi>
|
Rafael Antognolli <antognolli@profusion.mobi>
|
||||||
|
Cedric Bail <cedric.bail@free.fr>
|
||||||
|
Mikael SANS <sans.mikael@gmail.com>
|
||||||
|
|
|
@ -100,6 +100,7 @@ struct _Ethumb_Client
|
||||||
Ethumb *ethumb;
|
Ethumb *ethumb;
|
||||||
int id_count;
|
int id_count;
|
||||||
|
|
||||||
|
Ethumb *old_ethumb_conf;
|
||||||
E_DBus_Connection *conn;
|
E_DBus_Connection *conn;
|
||||||
E_DBus_Signal_Handler *name_owner_changed_handler;
|
E_DBus_Signal_Handler *name_owner_changed_handler;
|
||||||
E_DBus_Signal_Handler *generated_signal;
|
E_DBus_Signal_Handler *generated_signal;
|
||||||
|
@ -126,7 +127,6 @@ struct _Ethumb_Client
|
||||||
|
|
||||||
EINA_REFCOUNT;
|
EINA_REFCOUNT;
|
||||||
|
|
||||||
Eina_Bool ethumb_dirty : 1;
|
|
||||||
Eina_Bool connected : 1;
|
Eina_Bool connected : 1;
|
||||||
Eina_Bool server_started : 1;
|
Eina_Bool server_started : 1;
|
||||||
};
|
};
|
||||||
|
@ -324,6 +324,9 @@ end_connection:
|
||||||
if (client->pending_start_service_by_name)
|
if (client->pending_start_service_by_name)
|
||||||
dbus_pending_call_cancel(client->pending_start_service_by_name);
|
dbus_pending_call_cancel(client->pending_start_service_by_name);
|
||||||
|
|
||||||
|
if (client->old_ethumb_conf)
|
||||||
|
ethumb_free(client->old_ethumb_conf);
|
||||||
|
|
||||||
ethumb_free(client->ethumb);
|
ethumb_free(client->ethumb);
|
||||||
|
|
||||||
e_dbus_signal_handler_del(client->conn, client->name_owner_changed_handler);
|
e_dbus_signal_handler_del(client->conn, client->name_owner_changed_handler);
|
||||||
|
@ -607,7 +610,6 @@ _ethumb_client_exists_end(void *data, Ecore_Thread *thread __UNUSED__)
|
||||||
Ethumb *tmp = async->source->ethumb;
|
Ethumb *tmp = async->source->ethumb;
|
||||||
|
|
||||||
async->source->ethumb = async->dup;
|
async->source->ethumb = async->dup;
|
||||||
async->source->ethumb_dirty = ethumb_cmp(tmp, async->dup);
|
|
||||||
|
|
||||||
EINA_LIST_FREE(async->callbacks, cb)
|
EINA_LIST_FREE(async->callbacks, cb)
|
||||||
{
|
{
|
||||||
|
@ -758,6 +760,7 @@ ethumb_client_connect(Ethumb_Client_Connect_Cb connect_cb, const void *data, Ein
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eclient->old_ethumb_conf = NULL;
|
||||||
eclient->connect.cb = connect_cb;
|
eclient->connect.cb = connect_cb;
|
||||||
eclient->connect.data = (void *)data;
|
eclient->connect.data = (void *)data;
|
||||||
eclient->connect.free_data = free_data;
|
eclient->connect.free_data = free_data;
|
||||||
|
@ -948,7 +951,6 @@ ethumb_client_ethumb_setup(Ethumb_Client *client)
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
EINA_SAFETY_ON_FALSE_RETURN(client->connected);
|
EINA_SAFETY_ON_FALSE_RETURN(client->connected);
|
||||||
client->ethumb_dirty = 0;
|
|
||||||
|
|
||||||
msg = dbus_message_new_method_call(_ethumb_dbus_bus_name,
|
msg = dbus_message_new_method_call(_ethumb_dbus_bus_name,
|
||||||
client->object_path,
|
client->object_path,
|
||||||
|
@ -1455,7 +1457,8 @@ ethumb_client_fdo_set(Ethumb_Client *client, Ethumb_Thumb_FDO_Size s)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_thumb_fdo_set(client->ethumb, s);
|
ethumb_thumb_fdo_set(client->ethumb, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1473,7 +1476,8 @@ ethumb_client_size_set(Ethumb_Client *client, int tw, int th)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_thumb_size_set(client->ethumb, tw, th);
|
ethumb_thumb_size_set(client->ethumb, tw, th);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1510,7 +1514,8 @@ ethumb_client_format_set(Ethumb_Client *client, Ethumb_Thumb_Format f)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_thumb_format_set(client->ethumb, f);
|
ethumb_thumb_format_set(client->ethumb, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1566,7 +1571,8 @@ ethumb_client_aspect_set(Ethumb_Client *client, Ethumb_Thumb_Aspect a)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_thumb_aspect_set(client->ethumb, a);
|
ethumb_thumb_aspect_set(client->ethumb, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1608,7 +1614,8 @@ ethumb_client_orientation_set(Ethumb_Client *client, Ethumb_Thumb_Orientation o)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_thumb_orientation_set(client->ethumb, o);
|
ethumb_thumb_orientation_set(client->ethumb, o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1647,7 +1654,8 @@ ethumb_client_crop_align_set(Ethumb_Client *client, float x, float y)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_thumb_crop_align_set(client->ethumb, x, y);
|
ethumb_thumb_crop_align_set(client->ethumb, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1761,7 +1769,8 @@ ethumb_client_frame_set(Ethumb_Client *client, const char *file, const char *gro
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(client, 0);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(client, 0);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
return ethumb_frame_set(client->ethumb, file, group, swallow);
|
return ethumb_frame_set(client->ethumb, file, group, swallow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1793,7 +1802,8 @@ ethumb_client_dir_path_set(Ethumb_Client *client, const char *path)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_thumb_dir_path_set(client->ethumb, path);
|
ethumb_thumb_dir_path_set(client->ethumb, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1846,7 +1856,8 @@ ethumb_client_category_set(Ethumb_Client *client, const char *category)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_thumb_category_set(client->ethumb, category);
|
ethumb_thumb_category_set(client->ethumb, category);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1883,7 +1894,8 @@ ethumb_client_video_time_set(Ethumb_Client *client, float t)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_video_time_set(client->ethumb, t);
|
ethumb_video_time_set(client->ethumb, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1906,7 +1918,8 @@ ethumb_client_video_start_set(Ethumb_Client *client, float start)
|
||||||
EINA_SAFETY_ON_FALSE_RETURN(start >= 0.0);
|
EINA_SAFETY_ON_FALSE_RETURN(start >= 0.0);
|
||||||
EINA_SAFETY_ON_FALSE_RETURN(start <= 1.0);
|
EINA_SAFETY_ON_FALSE_RETURN(start <= 1.0);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_video_start_set(client->ethumb, start);
|
ethumb_video_start_set(client->ethumb, start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1934,7 +1947,8 @@ ethumb_client_video_interval_set(Ethumb_Client *client, float interval)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_video_interval_set(client->ethumb, interval);
|
ethumb_video_interval_set(client->ethumb, interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1956,7 +1970,8 @@ ethumb_client_video_ntimes_set(Ethumb_Client *client, unsigned int ntimes)
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
EINA_SAFETY_ON_FALSE_RETURN(ntimes > 0);
|
EINA_SAFETY_ON_FALSE_RETURN(ntimes > 0);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_video_ntimes_set(client->ethumb, ntimes);
|
ethumb_video_ntimes_set(client->ethumb, ntimes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1982,7 +1997,8 @@ ethumb_client_video_fps_set(Ethumb_Client *client, unsigned int fps)
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
EINA_SAFETY_ON_FALSE_RETURN(fps > 0);
|
EINA_SAFETY_ON_FALSE_RETURN(fps > 0);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_video_fps_set(client->ethumb, fps);
|
ethumb_video_fps_set(client->ethumb, fps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1999,7 +2015,8 @@ ethumb_client_document_page_set(Ethumb_Client *client, unsigned int page)
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN(client);
|
EINA_SAFETY_ON_NULL_RETURN(client);
|
||||||
|
|
||||||
client->ethumb_dirty = 1;
|
if (!client->old_ethumb_conf)
|
||||||
|
client->old_ethumb_conf = ethumb_dup(client->ethumb);
|
||||||
ethumb_document_page_set(client->ethumb, page);
|
ethumb_document_page_set(client->ethumb, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2291,8 +2308,13 @@ ethumb_client_generate(Ethumb_Client *client, Ethumb_Client_Generate_Cb generate
|
||||||
|
|
||||||
ethumb_thumb_path_get(client->ethumb, &thumb, &thumb_key);
|
ethumb_thumb_path_get(client->ethumb, &thumb, &thumb_key);
|
||||||
|
|
||||||
if (client->ethumb_dirty)
|
if (client->old_ethumb_conf &&
|
||||||
ethumb_client_ethumb_setup(client);
|
ethumb_cmp(client->old_ethumb_conf, client->ethumb))
|
||||||
|
{
|
||||||
|
ethumb_client_ethumb_setup(client);
|
||||||
|
ethumb_free(client->old_ethumb_conf);
|
||||||
|
client->old_ethumb_conf = NULL;
|
||||||
|
}
|
||||||
id = _ethumb_client_queue_add(client, file, key, thumb, thumb_key,
|
id = _ethumb_client_queue_add(client, file, key, thumb, thumb_key,
|
||||||
generated_cb, data, free_data);
|
generated_cb, data, free_data);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue