[gnome-shell/wip/snwh/icons-cleanup: 14/16] build: Replace array with dict




commit 0048f5aef467a97ac8046f369da6078c878ad1ec
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Jan 31 23:55:57 2022 +0100

    build: Replace array with dict
    
    It's more readable than "magic" indexes, and makes it easier to
    provide fallback values for optional entries.

 data/meson.build | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 76ae45c93a..c4264e015c 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -48,16 +48,19 @@ subdir('icons')
 subdir('theme')
 
 data_resources = [
-  ['dbus-interfaces', []],
-  ['osk-layouts', []],
-  ['theme', theme_deps]
+  {'name': 'dbus-interfaces'},
+  {'name': 'osk-layouts'},
+  {'name': 'theme', 'deps': theme_deps}
 ]
 foreach resource : data_resources
+  name = resource.get('name')
+  deps = resource.get('deps', [])
+
   gnome.compile_resources(
-    'gnome-shell-' + resource[0],
-    'gnome-shell-@0  gresource xml'.format(resource[0]),
-    source_dir: resource[0],
-    dependencies: resource[1],
+    'gnome-shell-' + name,
+    'gnome-shell-@0  gresource xml'.format(name),
+    source_dir: name,
+    dependencies: deps,
     gresource_bundle: true,
     install: true,
     install_dir: pkgdatadir


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