[gnac/devel] Code cleanup
- From: Benoît Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Code cleanup
- Date: Sun, 26 May 2013 08:22:36 +0000 (UTC)
commit 5297e710f0c1de2ec837d54280186a551ce3bdd2
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Sun May 26 10:22:29 2013 +0200
Code cleanup
data/ui/gnac.xml | 2 +-
libgnac/libgnac-converter.c | 2 +-
libgnac/libgnac-gst.c | 4 ++--
libgnac/libgnac-output.c | 4 ++--
src/gnac-ui.c | 41 ++++++++++++++++-------------------------
5 files changed, 22 insertions(+), 31 deletions(-)
---
diff --git a/data/ui/gnac.xml b/data/ui/gnac.xml
index fc71f99..28c98eb 100644
--- a/data/ui/gnac.xml
+++ b/data/ui/gnac.xml
@@ -548,7 +548,7 @@ Alexandre Roux <alexroux src gnome org></property>
</object>
</child>
<action-widgets>
- <action-widget response="-1">add_button</action-widget>
+ <action-widget response="-5">add_button</action-widget>
<action-widget response="-7">close_button</action-widget>
</action-widgets>
</object>
diff --git a/libgnac/libgnac-converter.c b/libgnac/libgnac-converter.c
index 929d25e..bbc16fe 100644
--- a/libgnac/libgnac-converter.c
+++ b/libgnac/libgnac-converter.c
@@ -910,7 +910,7 @@ libgnac_converter_error_cb(GstBus *bus,
g_free(out_uri);
if (restart && libgnac_converter_restart_current(item->parent)) {
- /* The restart was ok, do not send any signal and do not start next*/
+ /* The restart was ok, do not send any signal and do not start next */
return;
}
diff --git a/libgnac/libgnac-gst.c b/libgnac/libgnac-gst.c
index fd2e85f..77ee784 100644
--- a/libgnac/libgnac-gst.c
+++ b/libgnac/libgnac-gst.c
@@ -399,8 +399,8 @@ libgnac_gst_newpad_cb(GstElement *decodebin,
{
return;
}
- } else if (g_str_has_prefix(mimetype, "video/")
- && item->video_channel != -1)
+ } else if (g_str_has_prefix(mimetype, "video/") &&
+ item->video_channel != -1)
{
if (!libgnac_gstu_get_compatible_pad(item->video_encoder, pad,
caps, "video"))
diff --git a/libgnac/libgnac-output.c b/libgnac/libgnac-output.c
index 62fa6fd..cf89523 100644
--- a/libgnac/libgnac-output.c
+++ b/libgnac/libgnac-output.c
@@ -409,8 +409,8 @@ libgnac_output_build_output(GFile *source,
GFile *out_directory = libgnac_output_get_output_directory(source, config);
/* check whether we have to build a folder hierarchy */
- if (config->folder_hierarchy
- && !g_str_equal(g_strstrip(config->folder_hierarchy), ""))
+ if (config->folder_hierarchy &&
+ !g_str_equal(g_strstrip(config->folder_hierarchy), ""))
{
/* replace all known patterns by their value */
g_slist_foreach(rename_patterns,
diff --git a/src/gnac-ui.c b/src/gnac-ui.c
index a186760..b87927b 100644
--- a/src/gnac-ui.c
+++ b/src/gnac-ui.c
@@ -468,30 +468,21 @@ gnac_ui_file_chooser_response_cb(GtkDialog *dialog,
gint response,
gpointer user_data)
{
- switch (response) {
- /* Add button */
- case GTK_RESPONSE_NONE: {
- GSList *files = NULL;
- GSList *paths = gtk_file_chooser_get_uris(GTK_FILE_CHOOSER(dialog));
+ if (response == GTK_RESPONSE_OK) {
+ GSList *files = NULL;
+ GSList *paths = gtk_file_chooser_get_uris(GTK_FILE_CHOOSER(dialog));
- /* Add the different files */
- g_slist_foreach(paths, (GFunc) gnac_ui_file_chooser_foreach, &files);
- g_slist_free(paths);
- gnac_add_files(files);
+ /* Add the different files */
+ g_slist_foreach(paths, (GFunc) gnac_ui_file_chooser_foreach, &files);
+ g_slist_free(paths);
+ gnac_add_files(files);
- gchar *current_folder = gtk_file_chooser_get_current_folder(
- GTK_FILE_CHOOSER(dialog));
- gnac_ui_file_chooser_set_last_used_folder(current_folder);
+ gchar *current_folder = gtk_file_chooser_get_current_folder(
+ GTK_FILE_CHOOSER(dialog));
+ gnac_ui_file_chooser_set_last_used_folder(current_folder);
- /* Do we have to close the file chooser? */
- if (!gnac_ui_file_chooser_close_on_add_button_is_active()) return;
-
- break;
- }
-
- case GTK_RESPONSE_CLOSE:
- default:
- break;
+ /* Do we have to close the file chooser? */
+ if (!gnac_ui_file_chooser_close_on_add_button_is_active()) return;
}
gtk_widget_hide(GTK_WIDGET(dialog));
@@ -503,7 +494,7 @@ gnac_ui_file_chooser_file_activated_cb(GtkFileChooser *chooser,
gpointer user_data)
{
gnac_ui_file_chooser_response_cb(GTK_DIALOG(chooser),
- GTK_RESPONSE_NONE, NULL);
+ GTK_RESPONSE_OK, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]