[gnome-control-center] background: Replace ifdefs with #pragma once



commit b32eab65a60f14b3995e184589d97e08c393d358
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Nov 21 20:32:51 2019 +1300

    background: Replace ifdefs with #pragma once

 panels/background/bg-colors-source.h          | 5 +----
 panels/background/bg-pictures-source.h        | 6 +-----
 panels/background/bg-source.h                 | 5 +----
 panels/background/bg-wallpapers-source.h      | 6 +-----
 panels/background/cc-background-grilo-miner.h | 6 +-----
 panels/background/cc-background-item.h        | 5 +----
 panels/background/cc-background-panel.h       | 6 +-----
 panels/background/cc-background-xml.h         | 6 +-----
 panels/background/meson.build                 | 4 ++--
 9 files changed, 10 insertions(+), 39 deletions(-)
---
diff --git a/panels/background/bg-colors-source.h b/panels/background/bg-colors-source.h
index e0d37df6d..8e2575d3b 100644
--- a/panels/background/bg-colors-source.h
+++ b/panels/background/bg-colors-source.h
@@ -19,8 +19,7 @@
  *
  */
 
-#ifndef _BG_COLORS_SOURCE_H
-#define _BG_COLORS_SOURCE_H
+#pragma once
 
 #include <gtk/gtk.h>
 #include "bg-source.h"
@@ -37,5 +36,3 @@ gboolean bg_colors_source_add        (BgColorsSource       *self,
                                       GtkTreeRowReference **ret_row_ref);
 
 G_END_DECLS
-
-#endif /* _BG_COLORS_SOURCE_H */
diff --git a/panels/background/bg-pictures-source.h b/panels/background/bg-pictures-source.h
index c57a61ff4..f62cbe532 100644
--- a/panels/background/bg-pictures-source.h
+++ b/panels/background/bg-pictures-source.h
@@ -19,9 +19,7 @@
  *
  */
 
-
-#ifndef _BG_PICTURES_SOURCE_H
-#define _BG_PICTURES_SOURCE_H
+#pragma once
 
 #include <gtk/gtk.h>
 #include "bg-source.h"
@@ -46,5 +44,3 @@ gboolean          bg_pictures_source_is_known       (BgPicturesSource *bg_source
 const char * const * bg_pictures_get_support_content_types (void);
 
 G_END_DECLS
-
-#endif /* _BG_PICTURES_SOURCE_H */
diff --git a/panels/background/bg-source.h b/panels/background/bg-source.h
index 84518d1dd..ff86a85c6 100644
--- a/panels/background/bg-source.h
+++ b/panels/background/bg-source.h
@@ -18,8 +18,7 @@
  *
  */
 
-#ifndef _BG_SOURCE_H
-#define _BG_SOURCE_H
+#pragma once
 
 #include <gtk/gtk.h>
 #include <libgnome-desktop/gnome-desktop-thumbnail.h>
@@ -45,5 +44,3 @@ gint bg_source_get_thumbnail_width (BgSource *source);
 GnomeDesktopThumbnailFactory* bg_source_get_thumbnail_factory (BgSource *source);
 
 G_END_DECLS
-
-#endif /* _BG_SOURCE_H */
diff --git a/panels/background/bg-wallpapers-source.h b/panels/background/bg-wallpapers-source.h
index 90c93df8b..3ca222b8a 100644
--- a/panels/background/bg-wallpapers-source.h
+++ b/panels/background/bg-wallpapers-source.h
@@ -19,9 +19,7 @@
  *
  */
 
-
-#ifndef _BG_WALLPAPERS_SOURCE_H
-#define _BG_WALLPAPERS_SOURCE_H
+#pragma once
 
 #include <gtk/gtk.h>
 #include "bg-source.h"
@@ -34,5 +32,3 @@ G_DECLARE_FINAL_TYPE (BgWallpapersSource, bg_wallpapers_source, BG, WALLPAPERS_S
 BgWallpapersSource *bg_wallpapers_source_new (GtkWidget *widget);
 
 G_END_DECLS
-
-#endif /* _BG_WALLPAPERS_SOURCE_H */
diff --git a/panels/background/cc-background-grilo-miner.h b/panels/background/cc-background-grilo-miner.h
index 647d307cf..b018129ae 100644
--- a/panels/background/cc-background-grilo-miner.h
+++ b/panels/background/cc-background-grilo-miner.h
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-
-#ifndef _CC_BACKGROUND_GRILO_MINER_H
-#define _CC_BACKGROUND_GRILO_MINER_H
+#pragma once
 
 #include <glib-object.h>
 
@@ -31,5 +29,3 @@ CcBackgroundGriloMiner   *cc_background_grilo_miner_new            (void);
 void                      cc_background_grilo_miner_start          (CcBackgroundGriloMiner *self);
 
 G_END_DECLS
-
-#endif /* _CC_BACKGROUND_GRILO_MINER_H */
diff --git a/panels/background/cc-background-item.h b/panels/background/cc-background-item.h
index b97c7a006..b7b8df628 100644
--- a/panels/background/cc-background-item.h
+++ b/panels/background/cc-background-item.h
@@ -17,8 +17,7 @@
  *
  */
 
-#ifndef __CC_BACKGROUND_ITEM_H
-#define __CC_BACKGROUND_ITEM_H
+#pragma once
 
 #include <glib-object.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
@@ -82,5 +81,3 @@ gboolean                  cc_background_item_compare        (CcBackgroundItem *s
 void                      cc_background_item_dump           (CcBackgroundItem *item);
 
 G_END_DECLS
-
-#endif /* __CC_BACKGROUND_ITEM_H */
diff --git a/panels/background/cc-background-panel.h b/panels/background/cc-background-panel.h
index 42ea8c2e8..abc894a13 100644
--- a/panels/background/cc-background-panel.h
+++ b/panels/background/cc-background-panel.h
@@ -18,9 +18,7 @@
  *
  */
 
-
-#ifndef _CC_BACKGROUND_PANEL_H
-#define _CC_BACKGROUND_PANEL_H
+#pragma once
 
 #include <shell/cc-panel.h>
 
@@ -30,5 +28,3 @@ G_BEGIN_DECLS
 G_DECLARE_FINAL_TYPE (CcBackgroundPanel, cc_background_panel, CC, BACKGROUND_PANEL, CcPanel)
 
 G_END_DECLS
-
-#endif /* _CC_BACKGROUND_PANEL_H */
diff --git a/panels/background/cc-background-xml.h b/panels/background/cc-background-xml.h
index 809f6f1c7..95618fbb3 100644
--- a/panels/background/cc-background-xml.h
+++ b/panels/background/cc-background-xml.h
@@ -17,8 +17,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _CC_BACKGROUND_XML_H_
-#define _CC_BACKGROUND_XML_H_
+#pragma once
 
 #include <libgnome-desktop/gnome-desktop-thumbnail.h>
 #include <gtk/gtk.h>
@@ -46,6 +45,3 @@ gboolean cc_background_xml_load_list_finish          (CcBackgroundXml    *xml,
                                                      GError            **error);
 
 G_END_DECLS
-
-#endif
-
diff --git a/panels/background/meson.build b/panels/background/meson.build
index f5a493fd7..71e38f098 100644
--- a/panels/background/meson.build
+++ b/panels/background/meson.build
@@ -43,10 +43,10 @@ enums_header = files(
 common_sources += gnome.mkenums(
   enums + '.h',
   sources: enums_header,
-  fhead: '#ifndef __GDESKTOP_ENUMS_TYPES_H__\n#define __GDESKTOP_ENUMS_TYPES_H__\n\n#include 
<glib-object.h>\n\nG_BEGIN_DECLS\n',
+  fhead: '#pragma once\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
   fprod: '/* enumerations from "@filename@" */\n',
   vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define G_DESKTOP_TYPE_@ENUMSHORT@ 
(@enum_name@_get_type())\n',
-  ftail: 'G_END_DECLS\n\n#endif /* __GDESKTOP_ENUMS_TYPES_H__ */'
+  ftail: 'G_END_DECLS\n'
 )
 
 common_sources += gnome.mkenums(


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