[nautilus/wip/antoniof/switch-case-braces-style-fix: 6/7] general: Uniformize case code style
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/switch-case-braces-style-fix: 6/7] general: Uniformize case code style
- Date: Sun, 11 Jul 2021 22:05:52 +0000 (UTC)
commit 619970b1e831daaca349c03373702dd63c400713
Author: António Fernandes <antoniof gnome org>
Date: Sun Jul 11 13:40:51 2021 +0100
general: Uniformize case code style
There are a few non-braced single-statement in the final cases, which
have gone unnoticed until detected by a recent uncrustify update.
Let's add the missing braces around single-statements even if it's the
last case.
eel/eel-canvas.c | 4 ++++
src/nautilus-canvas-item.c | 8 ++++++++
src/nautilus-dnd.c | 2 ++
src/nautilus-file-operations.c | 4 ++++
src/nautilus-file-utilities.c | 2 ++
src/nautilus-file.c | 4 ++++
src/nautilus-files-view.c | 4 ++++
src/nautilus-list-model.c | 10 ++++++++++
src/nautilus-list-view.c | 2 ++
src/nautilus-location-entry.c | 8 ++++++++
src/nautilus-pathbar.c | 2 ++
src/nautilus-places-view.c | 4 ++++
src/nautilus-query-editor.c | 4 ++++
src/nautilus-query.c | 4 ++++
src/nautilus-search-engine-model.c | 2 ++
src/nautilus-search-engine-recent.c | 2 ++
src/nautilus-search-engine-tracker.c | 2 ++
src/nautilus-search-engine.c | 2 ++
src/nautilus-search-popover.c | 4 ++++
src/nautilus-special-location-bar.c | 2 ++
src/nautilus-vfs-file.c | 2 ++
src/nautilus-window-slot.c | 2 ++
22 files changed, 80 insertions(+)
---
diff --git a/eel/eel-canvas.c b/eel/eel-canvas.c
index de3902f6b..559114f8f 100644
--- a/eel/eel-canvas.c
+++ b/eel/eel-canvas.c
@@ -2952,7 +2952,9 @@ eel_canvas_button (GtkWidget *widget,
break;
default:
+ {
mask = 0;
+ }
}
switch (event->type)
@@ -2988,7 +2990,9 @@ eel_canvas_button (GtkWidget *widget,
break;
default:
+ {
g_assert_not_reached ();
+ }
}
return retval;
diff --git a/src/nautilus-canvas-item.c b/src/nautilus-canvas-item.c
index a3c389501..762c8832a 100644
--- a/src/nautilus-canvas-item.c
+++ b/src/nautilus-canvas-item.c
@@ -378,8 +378,10 @@ nautilus_canvas_item_set_property (GObject *object,
break;
default:
+ {
g_warning ("nautilus_canvas_item_set_property on unknown argument");
return;
+ }
}
eel_canvas_item_request_update (EEL_CANVAS_ITEM (object));
@@ -776,8 +778,10 @@ nautilus_canvas_item_get_max_text_width (NautilusCanvasItem *item)
break;
default:
+ {
g_warning ("Zoom level not valid. This may incur in missaligned grid");
max_text_width = MAX_TEXT_WIDTH_STANDARD;
+ }
}
return max_text_width * canvas_item->canvas->pixels_per_unit - 2 * TEXT_BACK_PADDING_X;
@@ -1526,8 +1530,10 @@ nautilus_canvas_item_event (EelCanvasItem *item,
}
default:
+ {
/* Don't eat up other events; canvas container might use them. */
return FALSE;
+ }
}
}
@@ -2056,8 +2062,10 @@ nautilus_canvas_item_accessible_do_action (AtkAction *accessible,
break;
default:
+ {
g_warning ("Invalid action passed to NautilusCanvasItemAccessible::do_action");
return FALSE;
+ }
}
return TRUE;
diff --git a/src/nautilus-dnd.c b/src/nautilus-dnd.c
index 8071d5b80..067bc27ec 100644
--- a/src/nautilus-dnd.c
+++ b/src/nautilus-dnd.c
@@ -696,7 +696,9 @@ nautilus_drag_drag_data_get_from_cache (GList *cache,
break;
default:
+ {
return FALSE;
+ }
}
result = g_string_new (NULL);
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 59beecd7e..0c0fa43e8 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -3278,10 +3278,12 @@ report_preparing_count_progress (CommonJob *job,
break;
case OP_KIND_COMPRESS:
+ {
s = g_strdup_printf (ngettext ("Preparing to compress %'d file",
"Preparing to compress %'d files",
source_info->num_files),
source_info->num_files);
+ }
}
nautilus_progress_info_take_details (job->progress, s);
@@ -3339,7 +3341,9 @@ get_scan_primary (OpKind kind)
}
case OP_KIND_COMPRESS:
+ {
return g_strdup (_("Error while compressing files."));
+ }
}
}
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index 62d8d70bb..3b161f52b 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -655,7 +655,9 @@ special_directory_get_icon (GUserDirectory directory,
ICON_CASE (VIDEOS);
default:
+ {
return (symbolic) ? g_themed_icon_new (NAUTILUS_ICON_FOLDER) : g_themed_icon_new
(NAUTILUS_ICON_FULLCOLOR_FOLDER);
+ }
}
#undef ICON_CASE
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 280bbb9e3..c14356d8f 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -3795,7 +3795,9 @@ nautilus_file_compare_for_sort (NautilusFile *file_1,
break;
default:
+ {
g_return_val_if_reached (0);
+ }
}
if (reversed)
@@ -9416,8 +9418,10 @@ nautilus_drag_can_accept_info (NautilusFile *drop_target_item,
}
default:
+ {
g_assert_not_reached ();
return FALSE;
+ }
}
}
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index d1a36fa2f..91212262c 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1760,7 +1760,9 @@ pattern_select_response_cb (GtkWidget *dialog,
break;
default:
+ {
g_assert_not_reached ();
+ }
}
}
@@ -2308,7 +2310,9 @@ compress_dialog_controller_on_name_accepted (NautilusFileNameWidgetController *c
break;
default:
+ {
g_assert_not_reached ();
+ }
}
nautilus_file_operations_compress (source_files, output,
diff --git a/src/nautilus-list-model.c b/src/nautilus-list-model.c
index e700669e7..7e2aeeeee 100644
--- a/src/nautilus-list-model.c
+++ b/src/nautilus-list-model.c
@@ -183,6 +183,7 @@ nautilus_list_model_get_column_type (GtkTreeModel *tree_model,
}
default:
+ {
if (index < NAUTILUS_LIST_MODEL_NUM_COLUMNS + priv->columns->len)
{
return G_TYPE_STRING;
@@ -191,6 +192,7 @@ nautilus_list_model_get_column_type (GtkTreeModel *tree_model,
{
return G_TYPE_INVALID;
}
+ }
}
}
@@ -325,7 +327,9 @@ nautilus_list_model_get_icon_size_for_zoom_level (NautilusListZoomLevel zoom_lev
}
case NAUTILUS_LIST_ZOOM_LEVEL_LARGER:
+ {
return NAUTILUS_LIST_ICON_SIZE_LARGER;
+ }
}
g_return_val_if_reached (NAUTILUS_LIST_ICON_SIZE_STANDARD);
}
@@ -444,6 +448,7 @@ nautilus_list_model_get_value (GtkTreeModel *tree_model,
break;
default:
+ {
if (column >= NAUTILUS_LIST_MODEL_NUM_COLUMNS && column < NAUTILUS_LIST_MODEL_NUM_COLUMNS +
priv->columns->len)
{
NautilusColumn *nautilus_column;
@@ -476,6 +481,7 @@ nautilus_list_model_get_value (GtkTreeModel *tree_model,
{
g_assert_not_reached ();
}
+ }
}
}
@@ -1540,7 +1546,9 @@ nautilus_list_model_get_zoom_level_from_column_id (int column)
}
case NAUTILUS_LIST_MODEL_LARGER_ICON_COLUMN:
+ {
return NAUTILUS_LIST_ZOOM_LEVEL_LARGER;
+ }
}
g_return_val_if_reached (NAUTILUS_LIST_ZOOM_LEVEL_STANDARD);
@@ -1567,7 +1575,9 @@ nautilus_list_model_get_column_id_from_zoom_level (NautilusListZoomLevel zoom_le
}
case NAUTILUS_LIST_ZOOM_LEVEL_LARGER:
+ {
return NAUTILUS_LIST_MODEL_LARGER_ICON_COLUMN;
+ }
}
g_return_val_if_reached (NAUTILUS_LIST_MODEL_STANDARD_ICON_COLUMN);
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index e3c0b81f6..0ee93f640 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -2020,7 +2020,9 @@ nautilus_list_view_get_icon_padding_for_zoom_level (NautilusListZoomLevel zoom_l
}
default:
+ {
g_assert_not_reached ();
+ }
}
}
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c
index e9ad0dadc..91b9ec7cb 100644
--- a/src/nautilus-location-entry.c
+++ b/src/nautilus-location-entry.c
@@ -348,7 +348,9 @@ drag_data_get_callback (GtkWidget *widget,
break;
default:
+ {
g_assert_not_reached ();
+ }
}
g_free (uri);
g_object_unref (location);
@@ -513,6 +515,7 @@ entry_would_have_inserted_characters (const GdkEvent *event)
}
default:
+ {
if (keyval >= 0x20 && keyval <= 0xFF)
{
if ((state & GDK_CONTROL_MASK) != 0)
@@ -524,6 +527,7 @@ entry_would_have_inserted_characters (const GdkEvent *event)
return FALSE;
}
}
+ }
}
/* GTK+ 4 TODO: gdk_event_get_string () and check if length > 0. */
@@ -671,7 +675,9 @@ nautilus_location_entry_icon_release (GtkEntry *gentry,
break;
default:
+ {
g_assert_not_reached ();
+ }
}
}
@@ -910,7 +916,9 @@ nautilus_location_entry_set_secondary_action (NautilusLocationEntry *entry
break;
default:
+ {
g_assert_not_reached ();
+ }
}
priv->secondary_action = secondary_action;
}
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index edc0fff56..68cd38639 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -1257,7 +1257,9 @@ get_gicon (ButtonData *button_data)
}
default:
+ {
return NULL;
+ }
}
return NULL;
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index 97761180b..06643af73 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -189,7 +189,9 @@ nautilus_places_view_get_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
@@ -216,7 +218,9 @@ nautilus_places_view_set_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index 0f284b5b3..1eb074927 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -184,7 +184,9 @@ nautilus_query_editor_get_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
@@ -213,7 +215,9 @@ nautilus_query_editor_set_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
diff --git a/src/nautilus-query.c b/src/nautilus-query.c
index 9c43743fa..e3b64c913 100644
--- a/src/nautilus-query.c
+++ b/src/nautilus-query.c
@@ -144,7 +144,9 @@ nautilus_query_get_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
@@ -207,7 +209,9 @@ nautilus_query_set_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
diff --git a/src/nautilus-search-engine-model.c b/src/nautilus-search-engine-model.c
index 509010e84..58ae6bf11 100644
--- a/src/nautilus-search-engine-model.c
+++ b/src/nautilus-search-engine-model.c
@@ -309,7 +309,9 @@ nautilus_search_engine_model_get_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
diff --git a/src/nautilus-search-engine-recent.c b/src/nautilus-search-engine-recent.c
index dd535873e..bc2ad84f0 100644
--- a/src/nautilus-search-engine-recent.c
+++ b/src/nautilus-search-engine-recent.c
@@ -399,7 +399,9 @@ nautilus_search_engine_recent_get_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
diff --git a/src/nautilus-search-engine-tracker.c b/src/nautilus-search-engine-tracker.c
index 6ba9446a6..a23ff6f40 100644
--- a/src/nautilus-search-engine-tracker.c
+++ b/src/nautilus-search-engine-tracker.c
@@ -545,7 +545,9 @@ nautilus_search_engine_tracker_get_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c
index e30f6e007..48bfa1f35 100644
--- a/src/nautilus-search-engine.c
+++ b/src/nautilus-search-engine.c
@@ -482,7 +482,9 @@ nautilus_search_engine_get_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
diff --git a/src/nautilus-search-popover.c b/src/nautilus-search-popover.c
index fe4aae029..37e18d889 100644
--- a/src/nautilus-search-popover.c
+++ b/src/nautilus-search-popover.c
@@ -738,7 +738,9 @@ nautilus_search_popover_get_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
@@ -767,7 +769,9 @@ nautilus_search_popover_set_property (GObject *object,
break;
default:
+ {
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
}
}
diff --git a/src/nautilus-special-location-bar.c b/src/nautilus-special-location-bar.c
index dc10a82a0..2c2ce0759 100644
--- a/src/nautilus-special-location-bar.c
+++ b/src/nautilus-special-location-bar.c
@@ -65,7 +65,9 @@ set_special_location (NautilusSpecialLocationBar *bar,
break;
default:
+ {
g_assert_not_reached ();
+ }
}
gtk_label_set_text (GTK_LABEL (bar->label), message);
diff --git a/src/nautilus-vfs-file.c b/src/nautilus-vfs-file.c
index ccbbc3536..d9d288e43 100644
--- a/src/nautilus-vfs-file.c
+++ b/src/nautilus-vfs-file.c
@@ -294,6 +294,7 @@ vfs_file_get_date (NautilusFile *file,
}
case NAUTILUS_DATE_TYPE_RECENCY:
+ {
/* Before we have info on a file, the date is unknown. */
if (recency == 0)
{
@@ -304,6 +305,7 @@ vfs_file_get_date (NautilusFile *file,
*date = recency;
}
return TRUE;
+ }
}
return FALSE;
}
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 0ae084795..4f93f67c8 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -2448,8 +2448,10 @@ update_history (NautilusWindowSlot *self,
}
case NAUTILUS_LOCATION_CHANGE_FORWARD:
+ {
handle_go_direction (self, new_location, TRUE);
return;
+ }
}
g_return_if_fail (FALSE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]