summaryrefslogtreecommitdiffstats
path: root/src/gui/PropertiesWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/PropertiesWindow.cpp')
-rw-r--r--src/gui/PropertiesWindow.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 4ea1536d..958a73c9 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -54,6 +54,7 @@
#include <gtkmm/table.h>
#include <gtkmm/treeiter.h>
#include <gtkmm/widget.h>
+#include <gtkmm/window.h>
#include <sigc++/adaptors/bind.h>
#include <sigc++/functors/mem_fun.h>
#include <sigc++/signal.h>
@@ -382,9 +383,9 @@ PropertiesWindow::create_value_widget(const URI& key,
? world.uri_map().unmap_uri(value.get<int32_t>())
: "");
- LilvNode* pred = lilv_new_uri(lworld, key.c_str());
- URISet ranges = rdfs::range(world, pred, true);
- URIEntry* widget = manage(new URIEntry(_app, ranges, str ? str : ""));
+ LilvNode* pred = lilv_new_uri(lworld, key.c_str());
+ const URISet ranges = rdfs::range(world, pred, true);
+ URIEntry* widget = manage(new URIEntry(_app, ranges, str ? str : ""));
widget->signal_changed().connect(
sigc::bind(sigc::mem_fun(this, &PropertiesWindow::on_change), key));
lilv_node_free(pred);
@@ -400,10 +401,10 @@ PropertiesWindow::create_value_widget(const URI& key,
if (type == _app->uris().atom_URI ||
type == _app->uris().rdfs_Class ||
is_class) {
- LilvNode* pred = lilv_new_uri(lworld, key.c_str());
- URISet ranges = rdfs::range(world, pred, true);
- const char* str = value.is_valid() ? value.ptr<const char>() : "";
- URIEntry* widget = manage(new URIEntry(_app, ranges, str));
+ LilvNode* pred = lilv_new_uri(lworld, key.c_str());
+ const URISet ranges = rdfs::range(world, pred, true);
+ const char* str = value.is_valid() ? value.ptr<const char>() : "";
+ URIEntry* widget = manage(new URIEntry(_app, ranges, str));
widget->signal_changed().connect(
sigc::bind(sigc::mem_fun(this, &PropertiesWindow::on_change), key));
lilv_node_free(pred);
@@ -482,7 +483,7 @@ PropertiesWindow::remove_property(const URI& key, const Atom& value)
Atom
PropertiesWindow::get_value(LV2_URID type, Gtk::Widget* value_widget)
{
- Forge& forge = _app->forge();
+ const Forge& forge = _app->forge();
if (type == forge.Int) {
auto* spin = dynamic_cast<Gtk::SpinButton*>(value_widget);
@@ -501,10 +502,13 @@ PropertiesWindow::get_value(LV2_URID type, Gtk::Widget* value_widget)
}
} else if (type == forge.URI || type == forge.URID) {
auto* uri_entry = dynamic_cast<URIEntry*>(value_widget);
- if (uri_entry && URI::is_valid(uri_entry->get_text())) {
- return _app->forge().make_urid(URI(uri_entry->get_text()));
+ if (uri_entry) {
+ if (URI::is_valid(uri_entry->get_text())) {
+ return _app->forge().make_urid(URI(uri_entry->get_text()));
+ }
+
+ _app->log().error("Invalid URI <%1%>\n", uri_entry->get_text());
}
- _app->log().error("Invalid URI <%1%>\n", uri_entry->get_text());
} else if (type == forge.String) {
auto* entry = dynamic_cast<Gtk::Entry*>(value_widget);
if (entry) {
@@ -542,7 +546,7 @@ PropertiesWindow::active_key() const
return "";
}
- Glib::ustring prop_uri = (*iter)[_combo_columns.uri_col];
+ const Glib::ustring prop_uri = (*iter)[_combo_columns.uri_col];
return prop_uri;
}