[Xfce4-commits] xfdesktop:eric/settings-changes Correctly display settings defaults

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/eric/settings-changes
 to ee9c70df22b26648ec734e84181f4bf27a892aec (commit)
   from 2f9278f47973b337f52619afece20cf498664fd6 (commit)

commit ee9c70df22b26648ec734e84181f4bf27a892aec
Author: Eric Koegel eric.koe...@gmail.com
Date:   Sun Oct 27 10:38:54 2013 +0300

Correctly display settings defaults

When changing workspaces or monitors in the settings app, make sure
we fall back to xfdesktop's defaults when nothing else has been
configured.

 settings/main.c |   28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/settings/main.c b/settings/main.c
index b63ee3c..86d4bbd 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -1047,6 +1047,7 @@ cb_folder_selection_changed(GtkWidget *button,
 DBG(filename %s, previous_filename %s. Nothing changed,
 filename == NULL ? NULL : filename,
 previous_filename == NULL ? NULL : previous_filename);
+
 g_free(filename);
 g_free(previous_filename);
 return;
@@ -1164,7 +1165,9 @@ xfdesktop_settings_update_iconview_folder(AppearancePanel 
*panel)
 }
 
 /* This function is to add or remove all the bindings for the background
- * tab. It's intended to be used when the app changes monitors or workspaces */
+ * tab. It's intended to be used when the app changes monitors or workspaces.
+ * It reverts the items back to their defaults before binding any new settings
+ * that way if the setting isn't present, the default correctly displays. */
 static void
 xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
   gboolean remove_binding)
@@ -1248,6 +1251,13 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn),
g_value_get_boxed(value));
 g_value_unset(value);
+} else {
+/* revert to showing our default color */
+GdkColor color1;
+color1.red = 0x1515;
+color1.green = 0x;
+color1.blue = 0x;
+
gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn), color1);
 }
 
 g_free(old_property);
@@ -1276,6 +1286,13 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn),
g_value_get_boxed(value));
 g_value_unset(value);
+} else {
+/* revert to showing our default color */
+GdkColor color2;
+color2.red = 0x1515;
+color2.green = 0x;
+color2.blue = 0x;
+
gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color2_btn), color2);
 }
 
 g_free(old_property);
@@ -1294,6 +1311,9 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 xfconf_g_property_unbind_by_property(channel, buf,
G_OBJECT(panel-backdrop_cycle_chkbox), active);
 } else {
+/* The default is disable cycling, set that before we bind to anything 
*/
+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel-backdrop_cycle_chkbox), 
FALSE);
+
 xfconf_g_property_bind(channel, buf, G_TYPE_BOOLEAN,
G_OBJECT(panel-backdrop_cycle_chkbox), 
active);
 }
@@ -1305,6 +1325,9 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 xfconf_g_property_unbind_by_property(channel, buf,
G_OBJECT(panel-combo_backdrop_cycle_period), 
active);
 } else {
+/* default is minutes, set that before we bind to it */
+
gtk_combo_box_set_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period), 
XFCE_BACKDROP_PERIOD_MINUES);
+
 xfconf_g_property_bind(channel, buf, G_TYPE_INT,
G_OBJECT(panel-combo_backdrop_cycle_period), 
active);
 /* determine if the cycle timer spin box is sensitive */
@@ -1335,6 +1358,9 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 xfconf_g_property_unbind_by_property(channel, buf,
G_OBJECT(panel-random_backdrop_order_chkbox), 
active);
 } else {
+/* The default is sequential, set that before we bind to anything */
+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel-random_backdrop_order_chkbox),
 FALSE);
+
 xfconf_g_property_bind(channel, buf, G_TYPE_BOOLEAN,
G_OBJECT(panel-random_backdrop_order_chkbox), 
active);
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org

[Xfce4-commits] xfdesktop:eric/settings-changes Fix memory leaks in the settings app

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/eric/settings-changes
 to f6a34c5144f05eaf8327eca02da724353c542dff (commit)
   from ee9c70df22b26648ec734e84181f4bf27a892aec (commit)

commit f6a34c5144f05eaf8327eca02da724353c542dff
Author: Eric Koegel eric.koe...@gmail.com
Date:   Sun Oct 27 10:59:48 2013 +0300

Fix memory leaks in the settings app

 settings/main.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/settings/main.c b/settings/main.c
index 86d4bbd..f5d59dd 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -305,7 +305,7 @@ xfdesktop_settings_queue_preview(GtkTreeModel *model,
  GtkTreeIter *iter,
  AppearancePanel *panel)
 {
-gchar *filename;
+gchar *filename = NULL;
 
 gtk_tree_model_get(model, iter, COL_FILENAME, filename, -1);
 
@@ -319,6 +319,9 @@ xfdesktop_settings_queue_preview(GtkTreeModel *model,
 
 xfdesktop_settings_add_file_to_queue(panel, pdata);
 }
+
+if(filename)
+g_free(filename);
 }
 
 static void
@@ -1430,6 +1433,8 @@ cb_update_background_tab(WnckWindow *wnck_window,
 
 if(panel-monitor_name != NULL)
 g_free(panel-monitor_name);
+if(monitor_name != NULL)
+g_free(monitor_name);
 
 panel-workspace = workspace_num;
 panel-screen = screen_num;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfdesktop:eric/settings-changes Fix some memory leaks

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/eric/settings-changes
 to 2f9278f47973b337f52619afece20cf498664fd6 (commit)
   from 715985a0cfdcabe4eacc391c8f37690d343351e7 (commit)

commit 2f9278f47973b337f52619afece20cf498664fd6
Author: Eric Koegel eric.koe...@gmail.com
Date:   Sun Oct 27 09:29:43 2013 +0300

Fix some memory leaks

 common/xfdesktop-thumbnailer.c|   38 +++-
 src/xfce-backdrop.c   |   39 ++---
 src/xfce-desktop.c|   30 
 src/xfce-workspace.c  |2 ++
 src/xfdesktop-file-icon-manager.c |   17 +---
 5 files changed, 91 insertions(+), 35 deletions(-)

diff --git a/common/xfdesktop-thumbnailer.c b/common/xfdesktop-thumbnailer.c
index 2416d8b..248a3c5 100644
--- a/common/xfdesktop-thumbnailer.c
+++ b/common/xfdesktop-thumbnailer.c
@@ -340,7 +340,7 @@ xfdesktop_thumbnailer_queue_thumbnail(XfdesktopThumbnailer 
*thumbnailer,
 
 if(g_slist_find(thumbnailer-priv-queue, file) == NULL) {
 thumbnailer-priv-queue = g_slist_prepend(thumbnailer-priv-queue,
-   file);
+   g_strdup(file));
 }
 
 thumbnailer-priv-request_timer_id = g_timeout_add_full(
@@ -370,6 +370,8 @@ void
 xfdesktop_thumbnailer_dequeue_thumbnail(XfdesktopThumbnailer *thumbnailer,
 gchar *file)
 {
+GSList *item;
+
 g_return_if_fail(XFDESKTOP_IS_THUMBNAILER(thumbnailer));
 g_return_if_fail(file != NULL);
 
@@ -392,9 +394,11 @@ 
xfdesktop_thumbnailer_dequeue_thumbnail(XfdesktopThumbnailer *thumbnailer,
 thumbnailer-priv-handle = 0;
 }
 
-if(g_slist_find(thumbnailer-priv-queue, file) != NULL) {
-thumbnailer-priv-queue = g_slist_remove_all(thumbnailer-priv-queue,
-  file);
+item = g_slist_find(thumbnailer-priv-queue, file);
+if(item != NULL) {
+g_free(item-data);
+thumbnailer-priv-queue = g_slist_remove(thumbnailer-priv-queue,
+  file);
 }
 
 thumbnailer-priv-request_timer_id = g_timeout_add_full(
@@ -436,6 +440,7 @@ 
xfdesktop_thumbnailer_queue_request_timer(XfdesktopThumbnailer *thumbnailer)
 file = g_file_new_for_path(iter-data);
 uris[i] = g_file_get_uri(file);
 mimetypes[i] = xfdesktop_get_file_mimetype(iter-data);
+
 g_object_unref(file);
 }
 iter = g_slist_next(iter);
@@ -465,6 +470,18 @@ 
xfdesktop_thumbnailer_queue_request_timer(XfdesktopThumbnailer *thumbnailer)
 }
 }
 
+/* Free the memory */
+i = 0;
+iter = thumbnailer-priv-queue;
+while(iter) {
+if(iter-data) {
+g_free(uris[i]);
+g_free(mimetypes[i]);
+}
+iter = g_slist_next(iter);
+i++;
+}
+
 g_free(uris);
 g_free(mimetypes);
 
@@ -498,7 +515,7 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy 
*proxy,
 gchar *thumbnail_location;
 GFile *file;
 GSList *iter = thumbnailer-priv-queue;
-gchar *f_uri, *f_uri_checksum, *filename;
+gchar *f_uri, *f_uri_checksum, *filename, *temp;
 gchar *thumbnail_flavor;
 gint x = 0;
 
@@ -531,8 +548,8 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy 
*proxy,
   filename, NULL);
 
 DBG(thumbnail-ready src: %s thumbnail: %s,
-(char*)iter-data,
-thumbnail_location);
+(char*)iter-data,
+thumbnail_location);
 
 g_signal_emit(G_OBJECT(thumbnailer),
   thumbnailer_signals[THUMBNAIL_READY],
@@ -540,14 +557,17 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy 
*proxy,
   iter-data,
   thumbnail_location);
 
+temp = iter-data;
 thumbnailer-priv-queue = g_slist_remove(thumbnailer-priv-queue,
-  iter-data);
+  temp);
 
 iter = thumbnailer-priv-queue;
 x++;
-
+
 g_free(filename);
 g_free(f_uri_checksum);
+g_free(thumbnail_location);
+g_free(temp);
 } else {
 iter = g_slist_next(iter);
 }
diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c
index 14ce700..929c6ee 100644
--- a/src/xfce-backdrop.c
+++ b/src/xfce-backdrop.c
@@ -240,29 +240,36 @@ xfce_backdrop_clear_cached_image(XfceBackdrop *backdrop)
 backdrop-priv-pix = NULL;
 }
 
+/* Returns a GList of all the files in the parent directory of filename */
 static GList *
-list_files_in_dir(const gchar *path)
+list_files_in_dir(const gchar *filename)
 {
 GDir *dir;
 gboolean needs_slash = 

[Xfce4-commits] xfce4-weather-plugin:master I18n: Update translation ar (100%).

2013-10-27 Thread Transifex
Updating branch refs/heads/master
 to 1657a51219a067a60f2fc64204e7d08a0897aebb (commit)
   from ccbe9f455b2ec0b04c0ed85d2e62b79cc259aaad (commit)

commit 1657a51219a067a60f2fc64204e7d08a0897aebb
Author: mohammad alhargan malh...@hotmail.com
Date:   Sun Oct 27 12:31:37 2013 +0100

I18n: Update translation ar (100%).

319 translated messages.

Transifex (https://www.transifex.com/projects/p/xfce/).

 po/ar.po |   76 +++---
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/po/ar.po b/po/ar.po
index c0d1c7a..e965107 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -10,7 +10,7 @@ msgstr 
 Project-Id-Version: Xfce Panel Plugins\n
 Report-Msgid-Bugs-To: \n
 POT-Creation-Date: 2013-07-03 21:29+0200\n
-PO-Revision-Date: 2013-10-24 07:15+\n
+PO-Revision-Date: 2013-10-27 07:37+\n
 Last-Translator: mohammad alhargan malh...@hotmail.com\n
 Language-Team: Arabic 
(http://www.transifex.com/projects/p/xfce/language/ar/)\n
 MIME-Version: 1.0\n
@@ -269,11 +269,11 @@ msgstr سحب متوسطة (CM)
 
 #: ../panel-plugin/weather-config.c:107
 msgid High clouds (CH)
-msgstr غيوم عالية (CH)
+msgstr سحب عالية (CH)
 
 #: ../panel-plugin/weather-config.c:108
 msgid Cloudiness (C)
-msgstr غيوم (C)
+msgstr التغييم (C)
 
 #: ../panel-plugin/weather-config.c:109
 msgid Fog (F)
@@ -807,14 +807,14 @@ msgid 
 This is the temperature to which air must be cooled to reach 100% relative 
humidity, given no change in water content. Reaching the dew point halts the 
cooling process, as condensation occurs which releases heat into the air. A 
high dew point increases the possibility of rain and severe thunderstorms. The 
dew point allows the prediction of dew, frost, fog and minimum overnight 
temperature, and has influence on the comfort level one experiences.\n
 \n
 bNote:/b This is a calculated value not provided by met.no.
-msgstr 
+msgstr هذه هي درجة الحرارة التي يجب أن تبرد الهواء للوصول الرطوبة النسبية 
100٪، لا يعطي تغيير في المحتوى المائي. وللوصول إلى نقطة الندى توقف عملية 
التبريد، لاحظ التكثيف الذي يخرج من التنفس في الهواء. نقطة الندى العالية تزيد من 
احتمال هطول أمطار والعواصف الرعدية شديدة. نقطة الندى تسمح بالتنبؤ بالندى، 
والصقيع والضباب ودرجة الحرارة الدنيا بين وقت لآخر، ولها تأثير على الاحساس 
بالراحة لدى الخبراء.\n\nbملاحظة:/b هذه القيمة المحسوبة لا توفرها met.no.
 
 #: ../panel-plugin/weather-config.c:1580
 msgid 
 Also known as ifelt temperature/i, ieffective temperature/i, or what 
some weather providers declare as ifeels like/i. Human temperature 
sensation is not only based on air temperature, but also on heat flow, physical 
activity and individual condition. While being a highly subjective value, 
apparent temperature can actually be useful for warning about extreme 
conditions (cold, heat).\n
 \n
 bNote:/b This is a calculated value not provided by met.no. You should 
use a calculation model appropriate for your local climate and personal 
preferences on the units page.
-msgstr 
+msgstr يعرف أيضا باسم iالاحساس بدرجة الحرارة/i, iدرجة الحرارة 
المحسوسة/iأو ما يعلنه بعض موفري الطقس كما iيشعر كأنه/i. الإحساس بدرجة 
الحرارة البشرية لا يقوم فقط على درجة حرارة الهواء، ولكن أيضا على تدفق الحرارة 
والنشاط البدني والحالة الفردية. وتعطي قيمة ذاتية عالية، يمكن أن تكون درجة حرارة 
الظاهر مفيدة لتحذير حول الظروف القاسية (البرد، الحرارة).\n\nbملاحظة:/b هذه 
قيمة محسوبة لا توفره met.no. يجب عليك استخدام نموذج حساب مناسبة للمناخ المحلي 
والتفضيلاتك الشخصية على صفحة وحدة.
 
 #: ../panel-plugin/weather-config.c:1594
 msgid 
@@ -823,7 +823,7 @@ msgid 
  ft), or 5,000 m (16,000 ft) at the equator, though their basis often lie 
 below 2,000 m (6,500 ft). They are mainly composed of water droplets or ice 
 particles and snow, when temperatures are cold enough.
-msgstr 
+msgstr وهذا يعرض الغطاء السحابي ذو المستوى المنخفض بنسبة مئوية. وفقا لتعريف 
المنظمة العالمية للأرصاد الجوية، يمكن الاطلاع على المستوى المنخفض للسحب على 
ارتفاعات أدنى من 000 4 متر (13,000 قدم)، أو 5,000 آلاف متر (16,000 قدم) عند خط 
الاستواء، على الرغم من أن الأساس غالباً ما تكون أقل من 000 2 متر (6,500 قدم). 
وتتكون من قطرات الماء أو جزيئات الجليد والثلج، وعندما تكون درجات الحرارة 
الباردة بما يكفي.
 
 #: ../panel-plugin/weather-config.c:1602
 msgid 
@@ -832,7 +832,7 @@ msgid 
  ft), or 5,000-10,000 m (16,000-33,000 ft) at the equator. Like their low-
 level cousins, they are principally composed of water droplets. When 
 temperatures get low enough, ice particles can replace the droplets.
-msgstr 
+msgstr يحدد هذا الغطاء السحابي المستوى المتوسط بنسبة مئوية. ووفقا لتعريف 
المنظمة العالمية للأرصاد الجوية، تشكل سحب المستوى المتوسط في مرتفعات 
4,000-8,000 متر (13,000-26,000)، أو 5,000-10,000 متر (16,000-33,000) عند خط 
الاستواء. مثل السحب ذات المستوى المنخفض، وتتكون أساسا من قطرات الماء. عند 
إنخفاض درجات حرارة بما يكفي، يمكن أن تتحول لجزيئات جليد.
 
 #: ../panel-plugin/weather-config.c:1611
 msgid 
@@ -842,7 +842,7 @@ msgid 
 equator, where temperatures are so low that they are mainly 

[Xfce4-commits] xfce4-notifyd:master Fix grammatical error.

2013-10-27 Thread Jérôme Guelfucci
Updating branch refs/heads/master
 to 8b9eb8b9a94fa5443ae14484b878aca3287be152 (commit)
   from 289c46e3723c17a54f7b26306efa651c2be0b36f (commit)

commit 8b9eb8b9a94fa5443ae14484b878aca3287be152
Author: Jérôme Guelfucci jero...@xfce.org
Date:   Sun Oct 27 17:18:44 2013 +0100

Fix grammatical error.

 xfce4-notifyd-config/main.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xfce4-notifyd-config/main.c b/xfce4-notifyd-config/main.c
index b0f6d26..5977749 100644
--- a/xfce4-notifyd-config/main.c
+++ b/xfce4-notifyd-config/main.c
@@ -55,7 +55,7 @@ xfce_notifyd_config_show_notification_preview(GtkWindow 
*parent_window)
 
 notification =
 notify_notification_new(_(Notification Preview),
-_(This is how notifications will look like),
+_(This is what notifications will look like),
 xfce4-notifyd);
 
 notify_notification_add_action(notification,
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-mailwatch-plugin:master I18n: Update translation uk (100%).

2013-10-27 Thread Transifex
Updating branch refs/heads/master
 to 335721a2338dbbc8f3583fdd49bdaf24d04df378 (commit)
   from e108011de0ce54d188747c07b98ca3d5021d0ae1 (commit)

commit 335721a2338dbbc8f3583fdd49bdaf24d04df378
Author: zubr139 zubr...@ukr.net
Date:   Sun Oct 27 18:31:29 2013 +0100

I18n: Update translation uk (100%).

111 translated messages.

Transifex (https://www.transifex.com/projects/p/xfce/).

 po/uk.po |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/po/uk.po b/po/uk.po
index 551cb3e..f7871b4 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -12,7 +12,7 @@ msgstr 
 Project-Id-Version: Xfce Panel Plugins\n
 Report-Msgid-Bugs-To: \n
 POT-Creation-Date: 2013-10-16 00:31+0200\n
-PO-Revision-Date: 2013-10-17 22:54+\n
+PO-Revision-Date: 2013-10-27 13:09+\n
 Last-Translator: zubr139 zubr...@ukr.net\n
 Language-Team: Ukrainian 
(http://www.transifex.com/projects/p/xfce/language/uk/)\n
 MIME-Version: 1.0\n
@@ -487,7 +487,7 @@ msgstr _Нова пошта
 
 #: ../panel-plugin/mailwatch-plugin.c:883
 msgid Failed to open web browser for online documentation
-msgstr 
+msgstr Не вдалося відкрити переглядач для онлайн-документації
 
 #: ../panel-plugin/mailwatch-plugin.c:931
 msgid Online Documentation
@@ -501,15 +501,15 @@ msgstr Бажаєте ознайомитися з відомостями дов
 msgid 
 You will be redirected to the documentation website where the help pages are
  maintained.
-msgstr 
+msgstr Ви будете перенаправлені на сайт документації, де знаходяться сторінки 
допомоги.
 
 #: ../panel-plugin/mailwatch-plugin.c:938
 msgid _Read Online
-msgstr 
+msgstr _Читати онлайн
 
 #: ../panel-plugin/mailwatch-plugin.c:949
 msgid _Always go directly to the online documentation
-msgstr 
+msgstr _Завжди переходити до онлайн документації
 
 #: ../panel-plugin/mailwatch-plugin.c:988
 #: ../panel-plugin/mailwatch.desktop.in.h:1
@@ -555,7 +555,7 @@ msgid 
 Copyright (c) 2013 Ján Sučan\n
 Copyright (c) 2005-2008 Brian Tarricone\n
 Copyright (c) 2005 Pasi Orovuo
-msgstr 
+msgstr Авторське право (c) 2013 Ján Sučan\nАвторське право (c) 2005-2008 
Brian Tarricone\nАвторське право (c) 2005 Pasi Orovuo
 
 #: ../panel-plugin/mailwatch-plugin.c:1241
 msgid Update Now
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master I18n: Update translation cs (80%).

2013-10-27 Thread Transifex
Updating branch refs/heads/master
 to 08fc56b4afa933a0847c10711a0c583252a0dbd4 (commit)
   from 1657a51219a067a60f2fc64204e7d08a0897aebb (commit)

commit 08fc56b4afa933a0847c10711a0c583252a0dbd4
Author: Michal Várady miko.v...@gmail.com
Date:   Sun Oct 27 18:31:51 2013 +0100

I18n: Update translation cs (80%).

256 translated messages, 63 untranslated messages.

Transifex (https://www.transifex.com/projects/p/xfce/).

 po/cs.po |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/po/cs.po b/po/cs.po
index e6469ba..0d76617 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -11,7 +11,7 @@ msgstr 
 Project-Id-Version: Xfce Panel Plugins\n
 Report-Msgid-Bugs-To: \n
 POT-Creation-Date: 2013-07-03 21:29+0200\n
-PO-Revision-Date: 2013-10-27 01:00+\n
+PO-Revision-Date: 2013-10-27 11:57+\n
 Last-Translator: Michal Várady miko.v...@gmail.com\n
 Language-Team: Czech 
(http://www.transifex.com/projects/p/xfce/language/cs/)\n
 MIME-Version: 1.0\n
@@ -1570,7 +1570,7 @@ msgstr 
 #: ../panel-plugin/weather-summary.c:673
 #, c-format
 msgid ttsmallCloudiness:%5s%s%s/small/tt
-msgstr 
+msgstr ttsmallOblačnost: %5s%s%s/small/tt
 
 #. daytime headers
 #: ../panel-plugin/weather-summary.c:837
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfdesktop:master Tooltip options in xfdesktop-settings

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/master
 to 7b305eb5092ce88c32e019d6479903d630b9ae86 (commit)
   from d12988225513fff7c219df973dd11e18a4670a27 (commit)

commit 7b305eb5092ce88c32e019d6479903d630b9ae86
Author: Eric Koegel eric.koe...@gmail.com
Date:   Mon Oct 21 11:22:16 2013 +0300

Tooltip options in xfdesktop-settings

There's now an option to toggle the display of tooltips on the
desktop as well as a spinbox to choose the preview image size.
The tooltip style is still present and if the user doesn't change
the tooltip size then it will fallback to the style setting, and
then finally default to the DEFAULT_TOOLTIP_SIZE.

 settings/main.c  |   28 +++--
 settings/xfdesktop-settings-ui.glade |   47 +++
 src/xfdesktop-icon-view.c|  110 +-
 3 files changed, 167 insertions(+), 18 deletions(-)

diff --git a/settings/main.c b/settings/main.c
index 7122d35..3e92b16 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -75,6 +75,8 @@
 #define DESKTOP_ICONS_ICON_SIZE_PROP /desktop-icons/icon-size
 #define DESKTOP_ICONS_FONT_SIZE_PROP /desktop-icons/font-size
 #define DESKTOP_ICONS_CUSTOM_FONT_SIZE_PROP  
/desktop-icons/use-custom-font-size
+#define DESKTOP_ICONS_SHOW_TOOLTIP_PROP  /desktop-icons/show-tooltips
+#define DESKTOP_ICONS_TOOLTIP_SIZE_PROP  /desktop-icons/tooltip-size
 #define DESKTOP_ICONS_SINGLE_CLICK_PROP  /desktop-icons/single-click
 
 typedef struct
@@ -867,9 +869,11 @@ xfdesktop_settings_get_active_workspace(AppearancePanel 
*panel,
 return workspace_num;
 }
 
+/* This works for both the custom font size and show tooltips check buttons,
+ * it just enables the associated spin button */
 static void
-cb_xfdesktop_chk_custom_font_size_toggled(GtkCheckButton *button,
-  gpointer user_data)
+cb_xfdesktop_chk_button_toggled(GtkCheckButton *button,
+gpointer user_data)
 {
 GtkWidget *spin_button = GTK_WIDGET(user_data);
 
@@ -1599,7 +1603,7 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder 
*main_gxml,
 GtkWidget *appearance_container, *chk_custom_font_size,
   *spin_font_size, *w, *box, *spin_icon_size,
   *chk_show_thumbnails, *chk_single_click, *appearance_settings,
-  *bnt_exit;
+  *chk_show_tooltips, *spin_tooltip_size, *bnt_exit;
 GtkBuilder *appearance_gxml;
 AppearancePanel *panel = g_new0(AppearancePanel, 1);
 GError *error = NULL;
@@ -1639,10 +1643,20 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder 
*main_gxml,
 chk_single_click = GTK_WIDGET(gtk_builder_get_object(main_gxml,
  chk_single_click));
 
+/* tooltip options */
+chk_show_tooltips = GTK_WIDGET(gtk_builder_get_object(main_gxml, 
chk_show_tooltips));
+spin_tooltip_size = GTK_WIDGET(gtk_builder_get_object(main_gxml, 
spin_tooltip_size));
+gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_tooltip_size), 128);
+
+/* connect up the signals */
 g_signal_connect(G_OBJECT(chk_custom_font_size), toggled,
- G_CALLBACK(cb_xfdesktop_chk_custom_font_size_toggled),
+ G_CALLBACK(cb_xfdesktop_chk_button_toggled),
  spin_font_size);
 
+g_signal_connect(G_OBJECT(chk_show_tooltips), toggled,
+ G_CALLBACK(cb_xfdesktop_chk_button_toggled),
+ spin_tooltip_size);
+
 /* thumbnails */
 chk_show_thumbnails = GTK_WIDGET(gtk_builder_get_object(main_gxml,
 
chk_show_thumbnails));
@@ -1836,6 +1850,12 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder 
*main_gxml,
 xfconf_g_property_bind(channel, DESKTOP_ICONS_CUSTOM_FONT_SIZE_PROP,
G_TYPE_BOOLEAN, G_OBJECT(chk_custom_font_size),
active);
+xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_TOOLTIP_PROP,
+   G_TYPE_BOOLEAN, G_OBJECT(chk_show_tooltips),
+   active);
+xfconf_g_property_bind(channel, DESKTOP_ICONS_TOOLTIP_SIZE_PROP, 
G_TYPE_DOUBLE,
+   
G_OBJECT(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(spin_tooltip_size))),
+   value);
 xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_THUMBNAILS,
G_TYPE_BOOLEAN, G_OBJECT(chk_show_thumbnails),
active);
diff --git a/settings/xfdesktop-settings-ui.glade 
b/settings/xfdesktop-settings-ui.glade
index b69fe4b..1e72179 100644
--- a/settings/xfdesktop-settings-ui.glade
+++ b/settings/xfdesktop-settings-ui.glade
@@ -17,6 +17,14 @@
 property name=page_size0/property
 property name=value12/property
   /object
+  object class=GtkAdjustment id=adjustment_tooltip
+property name=upper256/property
+property 

[Xfce4-commits] xfdesktop:master Allow the font size to go to 0.

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/master
 to 751d6e29c1ad3e02d7fdaaf873ff3c3285cc568a (commit)
   from 7b305eb5092ce88c32e019d6479903d630b9ae86 (commit)

commit 751d6e29c1ad3e02d7fdaaf873ff3c3285cc568a
Author: Eric Koegel eric.koe...@gmail.com
Date:   Mon Oct 21 11:39:03 2013 +0300

Allow the font size to go to 0.

Allow the user to set the font size to 0, at which point no icon
label will be drawn.

 settings/xfdesktop-settings-ui.glade |2 +-
 src/xfce-desktop.c   |7 ---
 src/xfdesktop-icon-view.c|5 +++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/settings/xfdesktop-settings-ui.glade 
b/settings/xfdesktop-settings-ui.glade
index 1e72179..ff04b37 100644
--- a/settings/xfdesktop-settings-ui.glade
+++ b/settings/xfdesktop-settings-ui.glade
@@ -11,7 +11,7 @@
   /object
   object class=GtkAdjustment id=adjustment4
 property name=upper144/property
-property name=lower4/property
+property name=lower0/property
 property name=page_increment10/property
 property name=step_increment1/property
 property name=page_size0/property
diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c
index b5b718d..e7d5b45 100644
--- a/src/xfce-desktop.c
+++ b/src/xfce-desktop.c
@@ -245,9 +245,10 @@ xfce_desktop_setup_icon_view(XfceDesktop *desktop)
 xfce_desktop_ensure_system_font_size(desktop);
 
 desktop-priv-icon_view = xfdesktop_icon_view_new(manager);
+/* If the user set a custom font size, use it. Otherwise use the system
+ * font size */
 
xfdesktop_icon_view_set_font_size(XFDESKTOP_ICON_VIEW(desktop-priv-icon_view),
-  (!desktop-priv-icons_font_size_set
-   || !desktop-priv-icons_font_size)
+  (!desktop-priv-icons_font_size_set)
   ? desktop-priv-system_font_size
   : desktop-priv-icons_font_size);
 if(desktop-priv-icons_size  0) {
@@ -818,7 +819,7 @@ xfce_desktop_class_init(XfceDesktopClass *klass)
 g_param_spec_uint(icon-font-size,
   icon font size,
   icon font size,
-  4, 144, 12,
+  0, 144, 12,
   XFDESKTOP_PARAM_FLAGS));
 
 g_object_class_install_property(gobject_class, PROP_ICON_FONT_SIZE_SET,
diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index dd4a7e4..987c9a7 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -1166,7 +1166,6 @@ xfdesktop_icon_view_show_tooltip(GtkWidget *widget,
 return FALSE;
 
 tooltip_size = xfdesktop_icon_view_get_tooltip_size(icon_view);
-DBG(tooltip size %d, tooltip_size);
 
 tip_text = 
xfdesktop_icon_peek_tooltip(icon_view-priv-item_under_pointer);
 if(!tip_text)
@@ -3116,7 +3115,9 @@ xfdesktop_icon_view_paint_icon(XfdesktopIconView 
*icon_view,
 }
 
 /* Only redraw the text if the text area requires it.  */
-if(gdk_rectangle_intersect(area, text_extents, intersection)) {
+if(gdk_rectangle_intersect(area, text_extents, intersection)
+icon_view-priv-font_size  0)
+{
 xfdesktop_paint_rounded_box(icon_view, state, text_extents, area);
 
 if (state == GTK_STATE_NORMAL) {
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfdesktop:master Correctly display settings defaults

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/master
 to ee9c70df22b26648ec734e84181f4bf27a892aec (commit)
   from 2f9278f47973b337f52619afece20cf498664fd6 (commit)

commit ee9c70df22b26648ec734e84181f4bf27a892aec
Author: Eric Koegel eric.koe...@gmail.com
Date:   Sun Oct 27 10:38:54 2013 +0300

Correctly display settings defaults

When changing workspaces or monitors in the settings app, make sure
we fall back to xfdesktop's defaults when nothing else has been
configured.

 settings/main.c |   28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/settings/main.c b/settings/main.c
index b63ee3c..86d4bbd 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -1047,6 +1047,7 @@ cb_folder_selection_changed(GtkWidget *button,
 DBG(filename %s, previous_filename %s. Nothing changed,
 filename == NULL ? NULL : filename,
 previous_filename == NULL ? NULL : previous_filename);
+
 g_free(filename);
 g_free(previous_filename);
 return;
@@ -1164,7 +1165,9 @@ xfdesktop_settings_update_iconview_folder(AppearancePanel 
*panel)
 }
 
 /* This function is to add or remove all the bindings for the background
- * tab. It's intended to be used when the app changes monitors or workspaces */
+ * tab. It's intended to be used when the app changes monitors or workspaces.
+ * It reverts the items back to their defaults before binding any new settings
+ * that way if the setting isn't present, the default correctly displays. */
 static void
 xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
   gboolean remove_binding)
@@ -1248,6 +1251,13 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn),
g_value_get_boxed(value));
 g_value_unset(value);
+} else {
+/* revert to showing our default color */
+GdkColor color1;
+color1.red = 0x1515;
+color1.green = 0x;
+color1.blue = 0x;
+
gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn), color1);
 }
 
 g_free(old_property);
@@ -1276,6 +1286,13 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color1_btn),
g_value_get_boxed(value));
 g_value_unset(value);
+} else {
+/* revert to showing our default color */
+GdkColor color2;
+color2.red = 0x1515;
+color2.green = 0x;
+color2.blue = 0x;
+
gtk_color_button_set_color(GTK_COLOR_BUTTON(panel-color2_btn), color2);
 }
 
 g_free(old_property);
@@ -1294,6 +1311,9 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 xfconf_g_property_unbind_by_property(channel, buf,
G_OBJECT(panel-backdrop_cycle_chkbox), active);
 } else {
+/* The default is disable cycling, set that before we bind to anything 
*/
+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel-backdrop_cycle_chkbox), 
FALSE);
+
 xfconf_g_property_bind(channel, buf, G_TYPE_BOOLEAN,
G_OBJECT(panel-backdrop_cycle_chkbox), 
active);
 }
@@ -1305,6 +1325,9 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 xfconf_g_property_unbind_by_property(channel, buf,
G_OBJECT(panel-combo_backdrop_cycle_period), 
active);
 } else {
+/* default is minutes, set that before we bind to it */
+
gtk_combo_box_set_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period), 
XFCE_BACKDROP_PERIOD_MINUES);
+
 xfconf_g_property_bind(channel, buf, G_TYPE_INT,
G_OBJECT(panel-combo_backdrop_cycle_period), 
active);
 /* determine if the cycle timer spin box is sensitive */
@@ -1335,6 +1358,9 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
 xfconf_g_property_unbind_by_property(channel, buf,
G_OBJECT(panel-random_backdrop_order_chkbox), 
active);
 } else {
+/* The default is sequential, set that before we bind to anything */
+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel-random_backdrop_order_chkbox),
 FALSE);
+
 xfconf_g_property_bind(channel, buf, G_TYPE_BOOLEAN,
G_OBJECT(panel-random_backdrop_order_chkbox), 
active);
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

[Xfce4-commits] xfdesktop:master Fix memory leaks in the settings app

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/master
 to f6a34c5144f05eaf8327eca02da724353c542dff (commit)
   from ee9c70df22b26648ec734e84181f4bf27a892aec (commit)

commit f6a34c5144f05eaf8327eca02da724353c542dff
Author: Eric Koegel eric.koe...@gmail.com
Date:   Sun Oct 27 10:59:48 2013 +0300

Fix memory leaks in the settings app

 settings/main.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/settings/main.c b/settings/main.c
index 86d4bbd..f5d59dd 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -305,7 +305,7 @@ xfdesktop_settings_queue_preview(GtkTreeModel *model,
  GtkTreeIter *iter,
  AppearancePanel *panel)
 {
-gchar *filename;
+gchar *filename = NULL;
 
 gtk_tree_model_get(model, iter, COL_FILENAME, filename, -1);
 
@@ -319,6 +319,9 @@ xfdesktop_settings_queue_preview(GtkTreeModel *model,
 
 xfdesktop_settings_add_file_to_queue(panel, pdata);
 }
+
+if(filename)
+g_free(filename);
 }
 
 static void
@@ -1430,6 +1433,8 @@ cb_update_background_tab(WnckWindow *wnck_window,
 
 if(panel-monitor_name != NULL)
 g_free(panel-monitor_name);
+if(monitor_name != NULL)
+g_free(monitor_name);
 
 panel-workspace = workspace_num;
 panel-screen = screen_num;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfdesktop:master Add a chronological backdrop cycle option

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/master
 to d12988225513fff7c219df973dd11e18a4670a27 (commit)
   from 8ee9256cf6459ee827d8a98e09fa51e0ca7e2a30 (commit)

commit d12988225513fff7c219df973dd11e18a4670a27
Author: Eric Koegel eric.koe...@gmail.com
Date:   Mon Oct 21 09:11:46 2013 +0300

Add a chronological backdrop cycle option

When cycling backdrops sequentially with a period of hourly, setting
this option causes xfdesktop to map files in the selected directory
to hours of the day. Fewer images in the directory than hours in the
day are handled by repeating images to scale them over the time range.
That means there will be at most 24 images displayed showing the first
image from midnight to one, the second from one until two o'clock,
etc. If there were 6 images in the directory then every image would
be displayed for 4 hour time intervals before advancing. If there's
more images in the folder than hours then they won't be shown.
The entire point is that the user can have darker backdrops shown at
night or do other fancy time of day image selections (i.e. one image
in the morning, one in the afternoon, one in the evening, etc).

 common/xfdesktop-common.c  |  128 
 common/xfdesktop-common.h  |3 -
 settings/main.c|   36 +++
 .../xfdesktop-settings-appearance-frame-ui.glade   |   16 +
 src/xfce-backdrop.c|  310 +++-
 src/xfce-backdrop.h|6 +
 src/xfce-workspace.c   |   32 +-
 7 files changed, 372 insertions(+), 159 deletions(-)

diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c
index bf86ba4..2011e6c 100644
--- a/common/xfdesktop-common.c
+++ b/common/xfdesktop-common.c
@@ -53,134 +53,6 @@
 #include xfdesktop-common.h
 #include xfce-backdrop.h /* for XfceBackdropImageStyle */
 
-#ifndef O_BINARY
-#define O_BINARY  0
-#endif
-
-static GList *
-list_files_in_dir(const gchar *path)
-{
-GDir *dir;
-gboolean needs_slash = TRUE;
-const gchar *file;
-GList *files = NULL;
-
-dir = g_dir_open(path, 0, 0);
-if(!dir)
-return NULL;
-
-if(path[strlen(path)-1] == '/')
-needs_slash = FALSE;
-
-while((file = g_dir_read_name(dir))) {
-gchar *current_file = g_strdup_printf(needs_slash ? %s/%s : %s%s,
-  path, file);
-
-files = g_list_insert_sorted(files, current_file, 
(GCompareFunc)g_strcmp0);
-}
-
-g_dir_close(dir);
-
-return files;
-}
-
-/* Gets the next valid image file in the folder. Free when done using it
- * returns NULL on fail. */
-gchar *
-xfdesktop_backdrop_choose_next(const gchar *filename)
-{
-GList *files, *current_file, *start_file;
-gchar *file = NULL;
-
-g_return_val_if_fail(filename, NULL);
-
-/* We don't cache the list at all. This way the user can add/remove items
- * whenever they like without xfdesktop having to do anything */
-files = list_files_in_dir(g_path_get_dirname(filename));
-if(!files)
-return NULL;
-
-/* Get the our current background in the list */
-current_file = g_list_find_custom(files, filename, 
(GCompareFunc)g_strcmp0);
-
-/* if somehow we don't have a valid file, grab the first one available */
-if(current_file == NULL)
-current_file = g_list_first(files);
-
-start_file = current_file;
-
-/* We want the next valid image file in the dir while making sure
- * we don't loop on ourselves */
-do {
-current_file = g_list_next(current_file);
-
-/* we hit the end of the list */
-if(current_file == NULL)
-current_file = g_list_first(files);
-
-/* We went through every item in the list */
-if(g_strcmp0(start_file-data, current_file-data) == 0)
-break;
-
-} while(!xfdesktop_image_file_is_valid(current_file-data));
-
-file = g_strdup(current_file-data);
-g_list_free_full(files, g_free);
-
-return file;
-}
-
-/* Gets a random valid image file in the folder. Free when done using it.
- * returns NULL on fail. */
-gchar *
-xfdesktop_backdrop_choose_random(const gchar *filename)
-{
-static gint previndex = -1;
-GList *files;
-gchar *file = NULL;
-gint n_items = 0, cur_file, tries = 0;
-
-g_return_val_if_fail(filename, NULL);
-
-/* We don't cache the list at all. This way the user can add/remove items
- * whenever they like without xfdesktop having to do anything */
-files = list_files_in_dir(g_path_get_dirname(filename));
-if(!files)
-return NULL;
-
-n_items = g_list_length(files);
-
-/* If there's only 1 item, just return it, easy */
-if(1 == n_items) {
-file = g_strdup(g_list_first(files)-data);
-g_list_free_full(files, g_free);
-return file;
-}
-
-do {
-

[Xfce4-commits] xfdesktop:master Additonal backdrop cycle options

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/master
 to 8ee9256cf6459ee827d8a98e09fa51e0ca7e2a30 (commit)
   from c460b0acb86791eb7ee9d954fae505589b88a68a (commit)

commit 8ee9256cf6459ee827d8a98e09fa51e0ca7e2a30
Author: Eric Koegel eric.koe...@gmail.com
Date:   Sat Oct 19 21:20:43 2013 +0300

Additonal backdrop cycle options

Xfdesktop can now change the backdrop every x seconds, minutes,
or hours. It can also change every hour on the hour, or every day,
or just during start up.

 common/xfdesktop-common.c  |   31 ++--
 settings/main.c|   70 ++-
 .../xfdesktop-settings-appearance-frame-ui.glade   |   31 +++-
 src/xfce-backdrop.c|  192 ++--
 src/xfce-backdrop.h|   16 ++
 src/xfce-workspace.c   |   46 -
 6 files changed, 340 insertions(+), 46 deletions(-)

diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c
index 6d5546d..bf86ba4 100644
--- a/common/xfdesktop-common.c
+++ b/common/xfdesktop-common.c
@@ -84,7 +84,8 @@ list_files_in_dir(const gchar *path)
 return files;
 }
 
-
+/* Gets the next valid image file in the folder. Free when done using it
+ * returns NULL on fail. */
 gchar *
 xfdesktop_backdrop_choose_next(const gchar *filename)
 {
@@ -93,6 +94,8 @@ xfdesktop_backdrop_choose_next(const gchar *filename)
 
 g_return_val_if_fail(filename, NULL);
 
+/* We don't cache the list at all. This way the user can add/remove items
+ * whenever they like without xfdesktop having to do anything */
 files = list_files_in_dir(g_path_get_dirname(filename));
 if(!files)
 return NULL;
@@ -127,10 +130,11 @@ xfdesktop_backdrop_choose_next(const gchar *filename)
 return file;
 }
 
+/* Gets a random valid image file in the folder. Free when done using it.
+ * returns NULL on fail. */
 gchar *
 xfdesktop_backdrop_choose_random(const gchar *filename)
 {
-static gboolean __initialized = FALSE;
 static gint previndex = -1;
 GList *files;
 gchar *file = NULL;
@@ -138,30 +142,21 @@ xfdesktop_backdrop_choose_random(const gchar *filename)
 
 g_return_val_if_fail(filename, NULL);
 
+/* We don't cache the list at all. This way the user can add/remove items
+ * whenever they like without xfdesktop having to do anything */
 files = list_files_in_dir(g_path_get_dirname(filename));
 if(!files)
 return NULL;
 
 n_items = g_list_length(files);
 
+/* If there's only 1 item, just return it, easy */
 if(1 == n_items) {
 file = g_strdup(g_list_first(files)-data);
 g_list_free_full(files, g_free);
 return file;
 }
 
-/* NOTE: 4.3BSD random()/srandom() are a) stronger and b) faster than
-* ANSI-C rand()/srand(). So we use random() if available */
-if(G_UNLIKELY(!__initialized)){
-guint seed = time(NULL) ^ (getpid() + (getpid()  15));
-#ifdef HAVE_SRANDOM
-srandom(seed);
-#else
-srand(seed);
-#endif
-__initialized = TRUE;
-}
-
 do {
 if(tries++ == n_items) {
 /* this isn't precise, but if we've failed to get a good
@@ -172,17 +167,15 @@ xfdesktop_backdrop_choose_random(const gchar *filename)
 }
 
 do {
-#ifdef HAVE_SRANDOM
-cur_file = random() % n_items;
-#else
-cur_file = rand() % n_items;
-#endif
+/* g_random_int_range bounds to n_items-1 */
+cur_file = g_random_int_range(0, n_items);
 } while(cur_file == previndex  G_LIKELY(previndex != -1));
 
 } while(!xfdesktop_image_file_is_valid(g_list_nth(files, cur_file)-data));
 
 previndex = cur_file;
 
+/* Keep a copy of our new random item, free everything else */
 file = g_strdup(g_list_nth(files, cur_file)-data);
 g_list_free_full(files, g_free);
 
diff --git a/settings/main.c b/settings/main.c
index 84340f0..cbc7e2d 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -109,8 +109,10 @@ typedef struct
 gulong color1_btn_id;
 gulong color2_btn_id;
 
-GtkWidget *backdrop_cycle_spinbox;
+/* backdrop cycling options */
 GtkWidget *backdrop_cycle_chkbox;
+GtkWidget *combo_backdrop_cycle_period;
+GtkWidget *backdrop_cycle_spinbox;
 GtkWidget *random_backdrop_order_chkbox;
 
 GThread *preview_thread;
@@ -877,11 +879,42 @@ cb_xfdesktop_chk_custom_font_size_toggled(GtkCheckButton 
*button,
 }
 
 static void
+update_backdrop_cycle_spinbox(AppearancePanel *panel)
+{
+gboolean sensitive = FALSE;
+gint period;
+
+/* For the spinbox to be active the combo_backdrop_cycle_period needs to be
+ * active and needs to be set to something where the spinbox would apply */
+if(gtk_widget_get_sensitive(panel-combo_backdrop_cycle_period)) {
+period = 
gtk_combo_box_get_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period));
+if(period == 

[Xfce4-commits] xfdesktop:master Include the chronological option in the combobox

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/master
 to 715985a0cfdcabe4eacc391c8f37690d343351e7 (commit)
   from 751d6e29c1ad3e02d7fdaaf873ff3c3285cc568a (commit)

commit 715985a0cfdcabe4eacc391c8f37690d343351e7
Author: Eric Koegel eric.koe...@gmail.com
Date:   Tue Oct 22 21:08:23 2013 +0300

Include the chronological option in the combobox

 settings/main.c|   49 
 .../xfdesktop-settings-appearance-frame-ui.glade   |   18 +
 src/xfce-backdrop.c|   79 +++-
 src/xfce-backdrop.h|7 +-
 src/xfce-workspace.c   |5 --
 5 files changed, 28 insertions(+), 130 deletions(-)

diff --git a/settings/main.c b/settings/main.c
index 3e92b16..b63ee3c 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -116,7 +116,6 @@ typedef struct
 GtkWidget *combo_backdrop_cycle_period;
 GtkWidget *backdrop_cycle_spinbox;
 GtkWidget *random_backdrop_order_chkbox;
-GtkWidget *chrono_backdrop_order_chkbox;
 
 GThread *preview_thread;
 GAsyncQueue *preview_queue;
@@ -884,43 +883,41 @@ cb_xfdesktop_chk_button_toggled(GtkCheckButton *button,
 }
 
 static void
-update_backdrop_cycle_spinbox(AppearancePanel *panel)
+update_backdrop_random_order_chkbox(AppearancePanel *panel)
 {
 gboolean sensitive = FALSE;
 gint period;
 
-/* For the spinbox to be active the combo_backdrop_cycle_period needs to be
- * active and needs to be set to something where the spinbox would apply */
+/* For the random check box to be active the combo_backdrop_cycle_period
+ * needs to be active and needs to not be set to chronological */
 if(gtk_widget_get_sensitive(panel-combo_backdrop_cycle_period)) {
 period = 
gtk_combo_box_get_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period));
-if(period == XFCE_BACKDROP_PERIOD_SECONDS ||
-   period == XFCE_BACKDROP_PERIOD_MINUES  ||
-   period == XFCE_BACKDROP_PERIOD_HOURS)
-{
+if(period != XFCE_BACKDROP_PERIOD_CHRONOLOGICAL)
 sensitive = TRUE;
-}
 }
 
-gtk_widget_set_sensitive(panel-backdrop_cycle_spinbox, sensitive);
+gtk_widget_set_sensitive(panel-random_backdrop_order_chkbox, sensitive);
 }
 
 static void
-update_backdrop_chrono_order_chkbox(AppearancePanel *panel)
+update_backdrop_cycle_spinbox(AppearancePanel *panel)
 {
 gboolean sensitive = FALSE;
 gint period;
 
-/* For this check box to be active the combo_backdrop_cycle_period needs
- * to be active and needs to be set to hourly so it would apply */
+/* For the spinbox to be active the combo_backdrop_cycle_period needs to be
+ * active and needs to be set to something where the spinbox would apply */
 if(gtk_widget_get_sensitive(panel-combo_backdrop_cycle_period)) {
 period = 
gtk_combo_box_get_active(GTK_COMBO_BOX(panel-combo_backdrop_cycle_period));
-if(period == XFCE_BACKDROP_PERIOD_HOURLY)
+if(period == XFCE_BACKDROP_PERIOD_SECONDS ||
+   period == XFCE_BACKDROP_PERIOD_MINUES  ||
+   period == XFCE_BACKDROP_PERIOD_HOURS)
 {
 sensitive = TRUE;
 }
 }
 
-gtk_widget_set_sensitive(panel-chrono_backdrop_order_chkbox, sensitive);
+gtk_widget_set_sensitive(panel-backdrop_cycle_spinbox, sensitive);
 }
 
 static void
@@ -931,8 +928,8 @@ cb_combo_backdrop_cycle_period_change(GtkComboBox *combo,
 
 /* determine if the spin box should be sensitive */
 update_backdrop_cycle_spinbox(panel);
-/* same with the chronological backdrop order */
-update_backdrop_chrono_order_chkbox(panel);
+/* determine if the random check box should be sensitive */
+update_backdrop_random_order_chkbox(panel);
 }
 
 static void
@@ -950,11 +947,10 @@ cb_xfdesktop_chk_cycle_backdrop_toggled(GtkCheckButton 
*button,
 
 /* The cycle backdrop toggles the period and random widgets */
 gtk_widget_set_sensitive(panel-combo_backdrop_cycle_period, sensitive);
-gtk_widget_set_sensitive(panel-random_backdrop_order_chkbox, sensitive);
 /* determine if the spin box should be sensitive */
 update_backdrop_cycle_spinbox(panel);
-/* same with the chronological backdrop order */
-update_backdrop_chrono_order_chkbox(panel);
+/* determine if the random check box should be sensitive */
+update_backdrop_random_order_chkbox(panel);
 }
 
 static gboolean
@@ -1343,17 +1339,6 @@ 
xfdesktop_settings_background_tab_change_bindings(AppearancePanel *panel,
G_OBJECT(panel-random_backdrop_order_chkbox), 
active);
 }
 g_free(buf);
-
-/* chronological order check box */
-buf = xfdesktop_settings_generate_per_workspace_binding_string(panel, 
backdrop-cycle-chronological-order);
-if(remove_binding) {
-xfconf_g_property_unbind_by_property(channel, buf,
-   

[Xfce4-commits] xfdesktop:master Fix some memory leaks

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/master
 to 2f9278f47973b337f52619afece20cf498664fd6 (commit)
   from 715985a0cfdcabe4eacc391c8f37690d343351e7 (commit)

commit 2f9278f47973b337f52619afece20cf498664fd6
Author: Eric Koegel eric.koe...@gmail.com
Date:   Sun Oct 27 09:29:43 2013 +0300

Fix some memory leaks

 common/xfdesktop-thumbnailer.c|   38 +++-
 src/xfce-backdrop.c   |   39 ++---
 src/xfce-desktop.c|   30 
 src/xfce-workspace.c  |2 ++
 src/xfdesktop-file-icon-manager.c |   17 +---
 5 files changed, 91 insertions(+), 35 deletions(-)

diff --git a/common/xfdesktop-thumbnailer.c b/common/xfdesktop-thumbnailer.c
index 2416d8b..248a3c5 100644
--- a/common/xfdesktop-thumbnailer.c
+++ b/common/xfdesktop-thumbnailer.c
@@ -340,7 +340,7 @@ xfdesktop_thumbnailer_queue_thumbnail(XfdesktopThumbnailer 
*thumbnailer,
 
 if(g_slist_find(thumbnailer-priv-queue, file) == NULL) {
 thumbnailer-priv-queue = g_slist_prepend(thumbnailer-priv-queue,
-   file);
+   g_strdup(file));
 }
 
 thumbnailer-priv-request_timer_id = g_timeout_add_full(
@@ -370,6 +370,8 @@ void
 xfdesktop_thumbnailer_dequeue_thumbnail(XfdesktopThumbnailer *thumbnailer,
 gchar *file)
 {
+GSList *item;
+
 g_return_if_fail(XFDESKTOP_IS_THUMBNAILER(thumbnailer));
 g_return_if_fail(file != NULL);
 
@@ -392,9 +394,11 @@ 
xfdesktop_thumbnailer_dequeue_thumbnail(XfdesktopThumbnailer *thumbnailer,
 thumbnailer-priv-handle = 0;
 }
 
-if(g_slist_find(thumbnailer-priv-queue, file) != NULL) {
-thumbnailer-priv-queue = g_slist_remove_all(thumbnailer-priv-queue,
-  file);
+item = g_slist_find(thumbnailer-priv-queue, file);
+if(item != NULL) {
+g_free(item-data);
+thumbnailer-priv-queue = g_slist_remove(thumbnailer-priv-queue,
+  file);
 }
 
 thumbnailer-priv-request_timer_id = g_timeout_add_full(
@@ -436,6 +440,7 @@ 
xfdesktop_thumbnailer_queue_request_timer(XfdesktopThumbnailer *thumbnailer)
 file = g_file_new_for_path(iter-data);
 uris[i] = g_file_get_uri(file);
 mimetypes[i] = xfdesktop_get_file_mimetype(iter-data);
+
 g_object_unref(file);
 }
 iter = g_slist_next(iter);
@@ -465,6 +470,18 @@ 
xfdesktop_thumbnailer_queue_request_timer(XfdesktopThumbnailer *thumbnailer)
 }
 }
 
+/* Free the memory */
+i = 0;
+iter = thumbnailer-priv-queue;
+while(iter) {
+if(iter-data) {
+g_free(uris[i]);
+g_free(mimetypes[i]);
+}
+iter = g_slist_next(iter);
+i++;
+}
+
 g_free(uris);
 g_free(mimetypes);
 
@@ -498,7 +515,7 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy 
*proxy,
 gchar *thumbnail_location;
 GFile *file;
 GSList *iter = thumbnailer-priv-queue;
-gchar *f_uri, *f_uri_checksum, *filename;
+gchar *f_uri, *f_uri_checksum, *filename, *temp;
 gchar *thumbnail_flavor;
 gint x = 0;
 
@@ -531,8 +548,8 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy 
*proxy,
   filename, NULL);
 
 DBG(thumbnail-ready src: %s thumbnail: %s,
-(char*)iter-data,
-thumbnail_location);
+(char*)iter-data,
+thumbnail_location);
 
 g_signal_emit(G_OBJECT(thumbnailer),
   thumbnailer_signals[THUMBNAIL_READY],
@@ -540,14 +557,17 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy 
*proxy,
   iter-data,
   thumbnail_location);
 
+temp = iter-data;
 thumbnailer-priv-queue = g_slist_remove(thumbnailer-priv-queue,
-  iter-data);
+  temp);
 
 iter = thumbnailer-priv-queue;
 x++;
-
+
 g_free(filename);
 g_free(f_uri_checksum);
+g_free(thumbnail_location);
+g_free(temp);
 } else {
 iter = g_slist_next(iter);
 }
diff --git a/src/xfce-backdrop.c b/src/xfce-backdrop.c
index 14ce700..929c6ee 100644
--- a/src/xfce-backdrop.c
+++ b/src/xfce-backdrop.c
@@ -240,29 +240,36 @@ xfce_backdrop_clear_cached_image(XfceBackdrop *backdrop)
 backdrop-priv-pix = NULL;
 }
 
+/* Returns a GList of all the files in the parent directory of filename */
 static GList *
-list_files_in_dir(const gchar *path)
+list_files_in_dir(const gchar *filename)
 {
 GDir *dir;
 gboolean needs_slash = TRUE;
 const 

[Xfce4-commits] xfdesktop:master More removable device icon types (Bug 4056)

2013-10-27 Thread Eric Koegel
Updating branch refs/heads/master
 to c460b0acb86791eb7ee9d954fae505589b88a68a (commit)
   from 7fd36c23d7e72cec2721c5324b63ca1e57dd2fef (commit)

commit c460b0acb86791eb7ee9d954fae505589b88a68a
Author: Eric Koegel eric.koe...@gmail.com
Date:   Tue Oct 15 19:25:30 2013 +0300

More removable device icon types (Bug 4056)

In xfdesktop-settings the removable devices option now has an
expander allowing the user to show network shares, devices, or
unknown/other volumes (such as mtp devices).

 common/xfdesktop-common.h |9 ++
 settings/main.c   |   38 ---
 src/xfdesktop-file-icon-manager.c |  218 ++---
 src/xfdesktop-file-icon-manager.h |   13 ---
 src/xfdesktop-file-utils.c|  131 --
 src/xfdesktop-file-utils.h|3 -
 src/xfdesktop-volume-icon.c   |   11 --
 7 files changed, 162 insertions(+), 261 deletions(-)

diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h
index 4dcec73..88e86c5 100644
--- a/common/xfdesktop-common.h
+++ b/common/xfdesktop-common.h
@@ -53,6 +53,15 @@
 #define SINGLE_WORKSPACE_MODE /backdrop/single-workspace-mode
 #define SINGLE_WORKSPACE_NUMBER   /backdrop/single-workspace-number
 
+#define DESKTOP_ICONS_SHOW_THUMBNAILS/desktop-icons/show-thumbnails
+#define DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE 
/desktop-icons/file-icons/show-network-removable
+#define DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE  
/desktop-icons/file-icons/show-device-removable
+#define DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE 
/desktop-icons/file-icons/show-unknown-removable
+#define DESKTOP_ICONS_SHOW_HOME  
/desktop-icons/file-icons/show-home
+#define DESKTOP_ICONS_SHOW_TRASH 
/desktop-icons/file-icons/show-trash
+#define DESKTOP_ICONS_SHOW_FILESYSTEM
/desktop-icons/file-icons/show-filesystem
+#define DESKTOP_ICONS_SHOW_REMOVABLE 
/desktop-icons/file-icons/show-removable
+
 /**
  * File information namespaces queried for #GFileInfo objects.
  */
diff --git a/settings/main.c b/settings/main.c
index 74da46e..84340f0 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -76,12 +76,6 @@
 #define DESKTOP_ICONS_FONT_SIZE_PROP /desktop-icons/font-size
 #define DESKTOP_ICONS_CUSTOM_FONT_SIZE_PROP  
/desktop-icons/use-custom-font-size
 #define DESKTOP_ICONS_SINGLE_CLICK_PROP  /desktop-icons/single-click
-#define DESKTOP_ICONS_SHOW_THUMBNAILS_PROP   /desktop-icons/show-thumbnails
-#define DESKTOP_ICONS_SHOW_HOME  
/desktop-icons/file-icons/show-home
-#define DESKTOP_ICONS_SHOW_TRASH 
/desktop-icons/file-icons/show-trash
-#define DESKTOP_ICONS_SHOW_FILESYSTEM
/desktop-icons/file-icons/show-filesystem
-#define DESKTOP_ICONS_SHOW_REMOVABLE 
/desktop-icons/file-icons/show-removable
-
 
 typedef struct
 {
@@ -342,7 +336,7 @@ cb_special_icon_toggled(GtkCellRendererToggle *render, 
gchar *path, gpointer use
 
 xfconf_channel_set_bool(channel, icon_property, show_icon);
 
-gtk_list_store_set(GTK_LIST_STORE(model), iter,
+gtk_tree_store_set(GTK_TREE_STORE(model), iter,
COL_ICON_ENABLED, show_icon, -1);
 
 gtk_tree_path_free(tree_path);
@@ -354,10 +348,10 @@ setup_special_icon_list(GtkBuilder *gxml,
 XfconfChannel *channel)
 {
 GtkWidget *treeview;
-GtkListStore *ls;
+GtkTreeStore *ts;
 GtkTreeViewColumn *col;
 GtkCellRenderer *render;
-GtkTreeIter iter;
+GtkTreeIter iter, parent_iter, child_iter;
 const struct {
 const gchar *name;
 const gchar *icon;
@@ -373,14 +367,21 @@ setup_special_icon_list(GtkBuilder *gxml,
   DESKTOP_ICONS_SHOW_TRASH, TRUE },
 { N_(Removable Devices), drive-removable-media, 
gnome-dev-removable,
   DESKTOP_ICONS_SHOW_REMOVABLE, TRUE },
+{ N_(Network Shares), network_fs, gnome-dev-network,
+  DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE, TRUE },
+{ N_(Disks and Drives), drive-harddisk-usb, 
gnome-dev-removable-usb,
+  DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE, TRUE },
+{ N_(Other Items), phone-symbolic, phone,
+  DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE, TRUE },
 { NULL, NULL, NULL, NULL, FALSE },
 };
+const int REMOVABLE_DEVICES = 4;
 int i, w;
 GtkIconTheme *itheme = gtk_icon_theme_get_default();
 
 gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, w, NULL);
 
-ls = gtk_list_store_new(N_ICON_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING,
+ts = gtk_tree_store_new(N_ICON_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING,
 G_TYPE_BOOLEAN, G_TYPE_STRING);
 for(i = 0; icons[i].name; ++i) {
 GdkPixbuf *pix = NULL;
@@ -390,8 +391,15 @@ setup_special_icon_list(GtkBuilder *gxml,
 else
 pix = gtk_icon_theme_load_icon(itheme, icons[i].icon_fallback, w, 
0, NULL);
 
-gtk_list_store_append(ls, iter);
-gtk_list_store_set(ls, iter,
+