summaryrefslogtreecommitdiff
path: root/legacy/ethumb
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-08-31 09:28:54 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-08-31 09:28:54 +0000
commit8385a7dec02f43d698f004d4151d57e41ef8e4ed (patch)
tree4a5fd3acbdaf73e66a9efb44f30a0fe04afc7145 /legacy/ethumb
parentb8e42ad9cd9c505809234f3457cc37c2c0c437d5 (diff)
ethumb: fix wrong dirty detection.
Patch by SANS Mikael <sans.mikael@gmail.com>. SVN revision: 63021
Diffstat (limited to 'legacy/ethumb')
-rw-r--r--legacy/ethumb/AUTHORS2
-rw-r--r--legacy/ethumb/src/lib/client/Ethumb_Client.c62
2 files changed, 44 insertions, 20 deletions
diff --git a/legacy/ethumb/AUTHORS b/legacy/ethumb/AUTHORS
index cfc62b6fb3..373577216d 100644
--- a/legacy/ethumb/AUTHORS
+++ b/legacy/ethumb/AUTHORS
@@ -1 +1,3 @@
1Rafael Antognolli <antognolli@profusion.mobi> 1Rafael Antognolli <antognolli@profusion.mobi>
2Cedric Bail <cedric.bail@free.fr>
3Mikael SANS <sans.mikael@gmail.com>
diff --git a/legacy/ethumb/src/lib/client/Ethumb_Client.c b/legacy/ethumb/src/lib/client/Ethumb_Client.c
index c9edebae14..a5c01c9397 100644
--- a/legacy/ethumb/src/lib/client/Ethumb_Client.c
+++ b/legacy/ethumb/src/lib/client/Ethumb_Client.c
@@ -100,6 +100,7 @@ struct _Ethumb_Client
100 Ethumb *ethumb; 100 Ethumb *ethumb;
101 int id_count; 101 int id_count;
102 102
103 Ethumb *old_ethumb_conf;
103 E_DBus_Connection *conn; 104 E_DBus_Connection *conn;
104 E_DBus_Signal_Handler *name_owner_changed_handler; 105 E_DBus_Signal_Handler *name_owner_changed_handler;
105 E_DBus_Signal_Handler *generated_signal; 106 E_DBus_Signal_Handler *generated_signal;
@@ -126,7 +127,6 @@ struct _Ethumb_Client
126 127
127 EINA_REFCOUNT; 128 EINA_REFCOUNT;
128 129
129 Eina_Bool ethumb_dirty : 1;
130 Eina_Bool connected : 1; 130 Eina_Bool connected : 1;
131 Eina_Bool server_started : 1; 131 Eina_Bool server_started : 1;
132}; 132};
@@ -324,6 +324,9 @@ end_connection:
324 if (client->pending_start_service_by_name) 324 if (client->pending_start_service_by_name)
325 dbus_pending_call_cancel(client->pending_start_service_by_name); 325 dbus_pending_call_cancel(client->pending_start_service_by_name);
326 326
327 if (client->old_ethumb_conf)
328 ethumb_free(client->old_ethumb_conf);
329
327 ethumb_free(client->ethumb); 330 ethumb_free(client->ethumb);
328 331
329 e_dbus_signal_handler_del(client->conn, client->name_owner_changed_handler); 332 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__)
607 Ethumb *tmp = async->source->ethumb; 610 Ethumb *tmp = async->source->ethumb;
608 611
609 async->source->ethumb = async->dup; 612 async->source->ethumb = async->dup;
610 async->source->ethumb_dirty = ethumb_cmp(tmp, async->dup);
611 613
612 EINA_LIST_FREE(async->callbacks, cb) 614 EINA_LIST_FREE(async->callbacks, cb)
613 { 615 {
@@ -758,6 +760,7 @@ ethumb_client_connect(Ethumb_Client_Connect_Cb connect_cb, const void *data, Ein
758 goto err; 760 goto err;
759 } 761 }
760 762
763 eclient->old_ethumb_conf = NULL;
761 eclient->connect.cb = connect_cb; 764 eclient->connect.cb = connect_cb;
762 eclient->connect.data = (void *)data; 765 eclient->connect.data = (void *)data;
763 eclient->connect.free_data = free_data; 766 eclient->connect.free_data = free_data;
@@ -948,7 +951,6 @@ ethumb_client_ethumb_setup(Ethumb_Client *client)
948 951
949 EINA_SAFETY_ON_NULL_RETURN(client); 952 EINA_SAFETY_ON_NULL_RETURN(client);
950 EINA_SAFETY_ON_FALSE_RETURN(client->connected); 953 EINA_SAFETY_ON_FALSE_RETURN(client->connected);
951 client->ethumb_dirty = 0;
952 954
953 msg = dbus_message_new_method_call(_ethumb_dbus_bus_name, 955 msg = dbus_message_new_method_call(_ethumb_dbus_bus_name,
954 client->object_path, 956 client->object_path,
@@ -1455,7 +1457,8 @@ ethumb_client_fdo_set(Ethumb_Client *client, Ethumb_Thumb_FDO_Size s)
1455{ 1457{
1456 EINA_SAFETY_ON_NULL_RETURN(client); 1458 EINA_SAFETY_ON_NULL_RETURN(client);
1457 1459
1458 client->ethumb_dirty = 1; 1460 if (!client->old_ethumb_conf)
1461 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1459 ethumb_thumb_fdo_set(client->ethumb, s); 1462 ethumb_thumb_fdo_set(client->ethumb, s);
1460} 1463}
1461 1464
@@ -1473,7 +1476,8 @@ ethumb_client_size_set(Ethumb_Client *client, int tw, int th)
1473{ 1476{
1474 EINA_SAFETY_ON_NULL_RETURN(client); 1477 EINA_SAFETY_ON_NULL_RETURN(client);
1475 1478
1476 client->ethumb_dirty = 1; 1479 if (!client->old_ethumb_conf)
1480 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1477 ethumb_thumb_size_set(client->ethumb, tw, th); 1481 ethumb_thumb_size_set(client->ethumb, tw, th);
1478} 1482}
1479 1483
@@ -1510,7 +1514,8 @@ ethumb_client_format_set(Ethumb_Client *client, Ethumb_Thumb_Format f)
1510{ 1514{
1511 EINA_SAFETY_ON_NULL_RETURN(client); 1515 EINA_SAFETY_ON_NULL_RETURN(client);
1512 1516
1513 client->ethumb_dirty = 1; 1517 if (!client->old_ethumb_conf)
1518 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1514 ethumb_thumb_format_set(client->ethumb, f); 1519 ethumb_thumb_format_set(client->ethumb, f);
1515} 1520}
1516 1521
@@ -1566,7 +1571,8 @@ ethumb_client_aspect_set(Ethumb_Client *client, Ethumb_Thumb_Aspect a)
1566{ 1571{
1567 EINA_SAFETY_ON_NULL_RETURN(client); 1572 EINA_SAFETY_ON_NULL_RETURN(client);
1568 1573
1569 client->ethumb_dirty = 1; 1574 if (!client->old_ethumb_conf)
1575 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1570 ethumb_thumb_aspect_set(client->ethumb, a); 1576 ethumb_thumb_aspect_set(client->ethumb, a);
1571} 1577}
1572 1578
@@ -1608,7 +1614,8 @@ ethumb_client_orientation_set(Ethumb_Client *client, Ethumb_Thumb_Orientation o)
1608{ 1614{
1609 EINA_SAFETY_ON_NULL_RETURN(client); 1615 EINA_SAFETY_ON_NULL_RETURN(client);
1610 1616
1611 client->ethumb_dirty = 1; 1617 if (!client->old_ethumb_conf)
1618 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1612 ethumb_thumb_orientation_set(client->ethumb, o); 1619 ethumb_thumb_orientation_set(client->ethumb, o);
1613} 1620}
1614 1621
@@ -1647,7 +1654,8 @@ ethumb_client_crop_align_set(Ethumb_Client *client, float x, float y)
1647{ 1654{
1648 EINA_SAFETY_ON_NULL_RETURN(client); 1655 EINA_SAFETY_ON_NULL_RETURN(client);
1649 1656
1650 client->ethumb_dirty = 1; 1657 if (!client->old_ethumb_conf)
1658 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1651 ethumb_thumb_crop_align_set(client->ethumb, x, y); 1659 ethumb_thumb_crop_align_set(client->ethumb, x, y);
1652} 1660}
1653 1661
@@ -1761,7 +1769,8 @@ ethumb_client_frame_set(Ethumb_Client *client, const char *file, const char *gro
1761{ 1769{
1762 EINA_SAFETY_ON_NULL_RETURN_VAL(client, 0); 1770 EINA_SAFETY_ON_NULL_RETURN_VAL(client, 0);
1763 1771
1764 client->ethumb_dirty = 1; 1772 if (!client->old_ethumb_conf)
1773 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1765 return ethumb_frame_set(client->ethumb, file, group, swallow); 1774 return ethumb_frame_set(client->ethumb, file, group, swallow);
1766} 1775}
1767 1776
@@ -1793,7 +1802,8 @@ ethumb_client_dir_path_set(Ethumb_Client *client, const char *path)
1793{ 1802{
1794 EINA_SAFETY_ON_NULL_RETURN(client); 1803 EINA_SAFETY_ON_NULL_RETURN(client);
1795 1804
1796 client->ethumb_dirty = 1; 1805 if (!client->old_ethumb_conf)
1806 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1797 ethumb_thumb_dir_path_set(client->ethumb, path); 1807 ethumb_thumb_dir_path_set(client->ethumb, path);
1798} 1808}
1799 1809
@@ -1846,7 +1856,8 @@ ethumb_client_category_set(Ethumb_Client *client, const char *category)
1846{ 1856{
1847 EINA_SAFETY_ON_NULL_RETURN(client); 1857 EINA_SAFETY_ON_NULL_RETURN(client);
1848 1858
1849 client->ethumb_dirty = 1; 1859 if (!client->old_ethumb_conf)
1860 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1850 ethumb_thumb_category_set(client->ethumb, category); 1861 ethumb_thumb_category_set(client->ethumb, category);
1851} 1862}
1852 1863
@@ -1883,7 +1894,8 @@ ethumb_client_video_time_set(Ethumb_Client *client, float t)
1883{ 1894{
1884 EINA_SAFETY_ON_NULL_RETURN(client); 1895 EINA_SAFETY_ON_NULL_RETURN(client);
1885 1896
1886 client->ethumb_dirty = 1; 1897 if (!client->old_ethumb_conf)
1898 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1887 ethumb_video_time_set(client->ethumb, t); 1899 ethumb_video_time_set(client->ethumb, t);
1888} 1900}
1889 1901
@@ -1906,7 +1918,8 @@ ethumb_client_video_start_set(Ethumb_Client *client, float start)
1906 EINA_SAFETY_ON_FALSE_RETURN(start >= 0.0); 1918 EINA_SAFETY_ON_FALSE_RETURN(start >= 0.0);
1907 EINA_SAFETY_ON_FALSE_RETURN(start <= 1.0); 1919 EINA_SAFETY_ON_FALSE_RETURN(start <= 1.0);
1908 1920
1909 client->ethumb_dirty = 1; 1921 if (!client->old_ethumb_conf)
1922 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1910 ethumb_video_start_set(client->ethumb, start); 1923 ethumb_video_start_set(client->ethumb, start);
1911} 1924}
1912 1925
@@ -1934,7 +1947,8 @@ ethumb_client_video_interval_set(Ethumb_Client *client, float interval)
1934{ 1947{
1935 EINA_SAFETY_ON_NULL_RETURN(client); 1948 EINA_SAFETY_ON_NULL_RETURN(client);
1936 1949
1937 client->ethumb_dirty = 1; 1950 if (!client->old_ethumb_conf)
1951 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1938 ethumb_video_interval_set(client->ethumb, interval); 1952 ethumb_video_interval_set(client->ethumb, interval);
1939} 1953}
1940 1954
@@ -1956,7 +1970,8 @@ ethumb_client_video_ntimes_set(Ethumb_Client *client, unsigned int ntimes)
1956 EINA_SAFETY_ON_NULL_RETURN(client); 1970 EINA_SAFETY_ON_NULL_RETURN(client);
1957 EINA_SAFETY_ON_FALSE_RETURN(ntimes > 0); 1971 EINA_SAFETY_ON_FALSE_RETURN(ntimes > 0);
1958 1972
1959 client->ethumb_dirty = 1; 1973 if (!client->old_ethumb_conf)
1974 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1960 ethumb_video_ntimes_set(client->ethumb, ntimes); 1975 ethumb_video_ntimes_set(client->ethumb, ntimes);
1961} 1976}
1962 1977
@@ -1982,7 +1997,8 @@ ethumb_client_video_fps_set(Ethumb_Client *client, unsigned int fps)
1982 EINA_SAFETY_ON_NULL_RETURN(client); 1997 EINA_SAFETY_ON_NULL_RETURN(client);
1983 EINA_SAFETY_ON_FALSE_RETURN(fps > 0); 1998 EINA_SAFETY_ON_FALSE_RETURN(fps > 0);
1984 1999
1985 client->ethumb_dirty = 1; 2000 if (!client->old_ethumb_conf)
2001 client->old_ethumb_conf = ethumb_dup(client->ethumb);
1986 ethumb_video_fps_set(client->ethumb, fps); 2002 ethumb_video_fps_set(client->ethumb, fps);
1987} 2003}
1988 2004
@@ -1999,7 +2015,8 @@ ethumb_client_document_page_set(Ethumb_Client *client, unsigned int page)
1999{ 2015{
2000 EINA_SAFETY_ON_NULL_RETURN(client); 2016 EINA_SAFETY_ON_NULL_RETURN(client);
2001 2017
2002 client->ethumb_dirty = 1; 2018 if (!client->old_ethumb_conf)
2019 client->old_ethumb_conf = ethumb_dup(client->ethumb);
2003 ethumb_document_page_set(client->ethumb, page); 2020 ethumb_document_page_set(client->ethumb, page);
2004} 2021}
2005 2022
@@ -2291,8 +2308,13 @@ ethumb_client_generate(Ethumb_Client *client, Ethumb_Client_Generate_Cb generate
2291 2308
2292 ethumb_thumb_path_get(client->ethumb, &thumb, &thumb_key); 2309 ethumb_thumb_path_get(client->ethumb, &thumb, &thumb_key);
2293 2310
2294 if (client->ethumb_dirty) 2311 if (client->old_ethumb_conf &&
2295 ethumb_client_ethumb_setup(client); 2312 ethumb_cmp(client->old_ethumb_conf, client->ethumb))
2313 {
2314 ethumb_client_ethumb_setup(client);
2315 ethumb_free(client->old_ethumb_conf);
2316 client->old_ethumb_conf = NULL;
2317 }
2296 id = _ethumb_client_queue_add(client, file, key, thumb, thumb_key, 2318 id = _ethumb_client_queue_add(client, file, key, thumb, thumb_key,
2297 generated_cb, data, free_data); 2319 generated_cb, data, free_data);
2298 2320