[SCM] calf/master: Print control name in missing attribute messages.

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:40:11 UTC 2013


The following commit has been merged in the master branch:
commit 90547468c63b9a27ae527f1f498fb78cec5cdc60
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Sat May 8 14:02:49 2010 +0100

    Print control name in missing attribute messages.

diff --git a/src/calf/gui.h b/src/calf/gui.h
index 434a5be..4a578a8 100644
--- a/src/calf/gui.h
+++ b/src/calf/gui.h
@@ -34,6 +34,7 @@ class plugin_gui;
 
 struct control_base
 {
+    std::string control_name;
     typedef std::map<std::string, std::string> xml_attribute_map;
     xml_attribute_map attribs;
     plugin_gui *gui;
diff --git a/src/gui.cpp b/src/gui.cpp
index 9c7fc8d..628f545 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -161,6 +161,7 @@ void plugin_gui::xml_element_start(const char *element, const char *attributes[]
         current_control = create_control_from_xml(element, attributes);
         if (current_control)
         {
+            current_control->control_name = element;
             current_control->attribs = xam;
             int param_no = -1;
             if (xam.count("param"))
diff --git a/src/gui_controls.cpp b/src/gui_controls.cpp
index 89c320b..575cd8f 100644
--- a/src/gui_controls.cpp
+++ b/src/gui_controls.cpp
@@ -38,17 +38,15 @@ using namespace std;
 void control_base::require_attribute(const char *name)
 {
     if (attribs.count(name) == 0) {
-        g_error("Missing attribute: %s", name);
+        g_error("Missing attribute '%s' in control '%s'", name, control_name.c_str());
     }
 }
 
 void control_base::require_int_attribute(const char *name)
 {
-    if (attribs.count(name) == 0) {
-        g_error("Missing attribute: %s", name);
-    }
+    require_attribute(name);
     if (attribs[name].empty() || attribs[name].find_first_not_of("0123456789") != string::npos) {
-        g_error("Wrong data type on attribute: %s (required integer)", name);
+        g_error("Wrong data type on attribute '%s' in control '%s' (required integer)", name, control_name.c_str());
     }
 }
 

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list