[gnome-builder] flatpak: whitespace cleanup



commit 02efc6c12f5cf9edfc21a35cedae33b04824843e
Author: Christian Hergert <chergert redhat com>
Date:   Thu Mar 16 14:07:08 2017 -0700

    flatpak: whitespace cleanup
    
    We use 2-space indent for { after switch, cases aligned there, and then
    2 more for the content inside the case.

 .../flatpak/gbp-flatpak-configuration-provider.c   |  107 ++++++++++----------
 1 files changed, 53 insertions(+), 54 deletions(-)
---
diff --git a/plugins/flatpak/gbp-flatpak-configuration-provider.c 
b/plugins/flatpak/gbp-flatpak-configuration-provider.c
index d28611f..5e60c63 100644
--- a/plugins/flatpak/gbp-flatpak-configuration-provider.c
+++ b/plugins/flatpak/gbp-flatpak-configuration-provider.c
@@ -706,66 +706,65 @@ gbp_flatpak_configuration_provider_manifest_changed (GbpFlatpakConfigurationProv
     {
     case G_FILE_MONITOR_EVENT_DELETED:
     case G_FILE_MONITOR_EVENT_MOVED_OUT:
-        ide_configuration_manager_remove (self->manager, IDE_CONFIGURATION (relevant_config));
-        g_ptr_array_remove_fast (self->configurations, relevant_config);
-        g_ptr_array_remove_fast (self->manifest_monitors, file_monitor);
-        break;
+      ide_configuration_manager_remove (self->manager, IDE_CONFIGURATION (relevant_config));
+      g_ptr_array_remove_fast (self->configurations, relevant_config);
+      g_ptr_array_remove_fast (self->manifest_monitors, file_monitor);
+      break;
 
     case G_FILE_MONITOR_EVENT_RENAMED:
-        filename = g_file_get_basename (other_file);
-        /* The "rename" is just a temporary file created by an editor */
-        if (g_str_has_suffix (filename, "~"))
-          IDE_EXIT;
-        else
-          g_free (filename);
-        new_config_file = other_file;
-        /* Don't break so we can reuse the code below to add the new config */
+      filename = g_file_get_basename (other_file);
+      /* The "rename" is just a temporary file created by an editor */
+      if (g_str_has_suffix (filename, "~"))
+        IDE_EXIT;
+      else
+        g_clear_pointer (&filename, g_free);
+      new_config_file = other_file;
       IDE_FALLTHROUGH;
     case G_FILE_MONITOR_EVENT_CREATED:
     case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
     case G_FILE_MONITOR_EVENT_MOVED_IN:
-        path = g_file_get_path (new_config_file);
-        filename = g_file_get_basename (new_config_file);
-        id = get_manifest_id (path, filename);
-
-        if (!contains_id (self->configurations, id))
-          {
-            g_autoptr(GbpFlatpakConfiguration) new_config = NULL;
-
-            new_config = gbp_flatpak_configuration_new (context, id, filename);
-            if (gbp_flatpak_configuration_load_from_file (new_config, new_config_file))
-              {
-                g_autoptr(GFileMonitor) manifest_monitor = NULL;
-                g_autoptr(GError) local_error = NULL;
-
-                g_signal_connect_object (new_config,
-                                         "changed",
-                                         G_CALLBACK (gbp_flatpak_configuration_provider_config_changed),
-                                         self,
-                                         G_CONNECT_SWAPPED);
-
-                manifest_monitor = g_file_monitor_file (file, G_FILE_MONITOR_WATCH_MOVES, NULL, 
&local_error);
-                if (manifest_monitor == NULL)
-                  g_warning ("Error encountered trying to monitor flatpak manifest %s: %s", path, 
local_error->message);
-                else
-                  {
-                    g_signal_connect_object (manifest_monitor,
-                                             "changed",
-                                             G_CALLBACK 
(gbp_flatpak_configuration_provider_manifest_changed),
-                                             self,
-                                             G_CONNECT_SWAPPED);
-                    g_ptr_array_add (self->manifest_monitors, g_steal_pointer (&manifest_monitor));
-                  }
-
-                ide_configuration_manager_remove (self->manager, IDE_CONFIGURATION (relevant_config));
-                g_ptr_array_remove_fast (self->configurations, relevant_config);
-                g_ptr_array_remove_fast (self->manifest_monitors, file_monitor);
-                ide_configuration_manager_add (self->manager, IDE_CONFIGURATION (new_config));
-                ide_configuration_manager_set_current (self->manager, IDE_CONFIGURATION (new_config));
-                g_ptr_array_add (self->configurations, g_steal_pointer (&new_config));
-              }
-          }
-        break;
+      path = g_file_get_path (new_config_file);
+      filename = g_file_get_basename (new_config_file);
+      id = get_manifest_id (path, filename);
+
+      if (!contains_id (self->configurations, id))
+        {
+          g_autoptr(GbpFlatpakConfiguration) new_config = NULL;
+
+          new_config = gbp_flatpak_configuration_new (context, id, filename);
+          if (gbp_flatpak_configuration_load_from_file (new_config, new_config_file))
+            {
+              g_autoptr(GFileMonitor) manifest_monitor = NULL;
+              g_autoptr(GError) local_error = NULL;
+
+              g_signal_connect_object (new_config,
+                                       "changed",
+                                       G_CALLBACK (gbp_flatpak_configuration_provider_config_changed),
+                                       self,
+                                       G_CONNECT_SWAPPED);
+
+              manifest_monitor = g_file_monitor_file (file, G_FILE_MONITOR_WATCH_MOVES, NULL, &local_error);
+              if (manifest_monitor == NULL)
+                g_warning ("Error encountered trying to monitor flatpak manifest %s: %s", path, 
local_error->message);
+              else
+                {
+                  g_signal_connect_object (manifest_monitor,
+                                           "changed",
+                                           G_CALLBACK (gbp_flatpak_configuration_provider_manifest_changed),
+                                           self,
+                                           G_CONNECT_SWAPPED);
+                  g_ptr_array_add (self->manifest_monitors, g_steal_pointer (&manifest_monitor));
+                }
+
+              ide_configuration_manager_remove (self->manager, IDE_CONFIGURATION (relevant_config));
+              g_ptr_array_remove_fast (self->configurations, relevant_config);
+              g_ptr_array_remove_fast (self->manifest_monitors, file_monitor);
+              ide_configuration_manager_add (self->manager, IDE_CONFIGURATION (new_config));
+              ide_configuration_manager_set_current (self->manager, IDE_CONFIGURATION (new_config));
+              g_ptr_array_add (self->configurations, g_steal_pointer (&new_config));
+            }
+        }
+      break;
 
     case G_FILE_MONITOR_EVENT_CHANGED:
     case G_FILE_MONITOR_EVENT_MOVED:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]