[dia: 26/105] #19: Output a warning when unable to find an object type & add missing shapes.



commit 0c3f7bba6cedbb20b2fd0a92842f40a84aff5027
Author: Eduard Nicodei <eddnicodei gmail com>
Date:   Mon Dec 24 14:22:18 2018 +0000

    #19: Output a warning when unable to find an object type & add missing shapes.
    
      - Also add a FIXME since this was just a way to see what
        objects were not being loaded.
      - The new warnings showed that there were some objects from Cisco/ and
        network/ that were not being loaded.  Add them to meson build.

 lib/object.c               | 8 +++++++-
 shapes/Cisco/meson.build   | 4 ++++
 shapes/network/meson.build | 2 ++
 3 files changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/lib/object.c b/lib/object.c
index 7a7ac109..fe93aea1 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -975,7 +975,13 @@ object_registry_foreach (GHFunc func, gpointer user_data)
 DiaObjectType *
 object_get_type(char *name)
 {
-  return (DiaObjectType *) g_hash_table_lookup(object_type_table, name);
+  /* FIXME: this was added here to get some visibility.  Idealy we should have a common way
+   * of ensuring g_hash_table_lookup return a non-NULL. */
+  DiaObjectType *type = (DiaObjectType *)g_hash_table_lookup(object_type_table, name);
+  if (type == NULL) {
+    g_warning("Unable to find object type: %s", name);
+  }
+  return type;
 }
 
 /** True if all the given flags are set, false otherwise.
diff --git a/shapes/Cisco/meson.build b/shapes/Cisco/meson.build
index 2d2f773b..68a4e6da 100644
--- a/shapes/Cisco/meson.build
+++ b/shapes/Cisco/meson.build
@@ -199,6 +199,8 @@ shape_sources = files(
     'front_end_processor.png',
     'fwsm.shape',
     'fwsm.png',
+    'gatekeeper.shape',
+    'gatekeeper.png',
     'general_appliance.shape',
     'general_appliance.png',
     'generic_building_blue.shape',
@@ -527,6 +529,8 @@ shape_sources = files(
     'ssl_terminator.png',
     'standing_man.shape',
     'standing_man.png',
+    'standing_woman.shape',
+    'standing_woman.png',
     'stb.shape',
     'stb.png',
     'storage_array.shape',
diff --git a/shapes/network/meson.build b/shapes/network/meson.build
index 5590037d..72138e45 100644
--- a/shapes/network/meson.build
+++ b/shapes/network/meson.build
@@ -53,6 +53,8 @@ shape_sources = files(
     'genmonitor.png',
     'computer.shape',
     'computer.png',
+    'laptop.shape',
+    'laptop.png',
     'telephone.shape',
     'telephone.png',
     'firewall.shape',


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