summaryrefslogtreecommitdiffstats
path: root/src/gui/PropertiesWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-08-18 01:22:18 -0400
committerDavid Robillard <d@drobilla.net>2022-08-18 01:22:18 -0400
commit3af246bb3291d8568f6d110884fa55ee5fd20221 (patch)
tree434ac316050356e4db379ba8305b75285b17bbba /src/gui/PropertiesWindow.cpp
parent44381dbda9dbf8d20894789fe8e3ea941b70a1d0 (diff)
downloadingen-3af246bb3291d8568f6d110884fa55ee5fd20221.tar.gz
ingen-3af246bb3291d8568f6d110884fa55ee5fd20221.tar.bz2
ingen-3af246bb3291d8568f6d110884fa55ee5fd20221.zip
Avoid "else" after "return", "break", and "continue"
Diffstat (limited to 'src/gui/PropertiesWindow.cpp')
-rw-r--r--src/gui/PropertiesWindow.cpp35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 3390c53e..15f1818e 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -184,16 +184,24 @@ PropertiesWindow::datatype_supported(const rdfs::URISet& types,
if (types.find(_app->uris().atom_Int) != types.end()) {
*widget_type = _app->uris().atom_Int;
return true;
- } else if (types.find(_app->uris().atom_Float) != types.end()) {
+ }
+
+ if (types.find(_app->uris().atom_Float) != types.end()) {
*widget_type = _app->uris().atom_Float;
return true;
- } else if (types.find(_app->uris().atom_Bool) != types.end()) {
+ }
+
+ if (types.find(_app->uris().atom_Bool) != types.end()) {
*widget_type = _app->uris().atom_Bool;
return true;
- } else if (types.find(_app->uris().atom_String) != types.end()) {
+ }
+
+ if (types.find(_app->uris().atom_String) != types.end()) {
*widget_type = _app->uris().atom_String;
return true;
- } else if (types.find(_app->uris().atom_URID) != types.end()) {
+ }
+
+ if (types.find(_app->uris().atom_URID) != types.end()) {
*widget_type = _app->uris().atom_URID;
return true;
}
@@ -332,7 +340,9 @@ PropertiesWindow::create_value_widget(const URI& key,
widget->signal_value_changed().connect(
sigc::bind(sigc::mem_fun(this, &PropertiesWindow::on_change), key));
return widget;
- } else if (type == _app->uris().atom_Float) {
+ }
+
+ if (type == _app->uris().atom_Float) {
Gtk::SpinButton* widget = manage(new Gtk::SpinButton(0.0, 4));
widget->property_numeric() = true;
widget->set_snap_to_ticks(false);
@@ -344,7 +354,9 @@ PropertiesWindow::create_value_widget(const URI& key,
widget->signal_value_changed().connect(
sigc::bind(sigc::mem_fun(this, &PropertiesWindow::on_change), key));
return widget;
- } else if (type == _app->uris().atom_Bool) {
+ }
+
+ if (type == _app->uris().atom_Bool) {
Gtk::CheckButton* widget = manage(new Gtk::CheckButton());
if (value.is_valid()) {
widget->set_active(value.get<int32_t>());
@@ -352,7 +364,9 @@ PropertiesWindow::create_value_widget(const URI& key,
widget->signal_toggled().connect(
sigc::bind(sigc::mem_fun(this, &PropertiesWindow::on_change), key));
return widget;
- } else if (type == _app->uris().atom_String) {
+ }
+
+ if (type == _app->uris().atom_String) {
Gtk::Entry* widget = manage(new Gtk::Entry());
if (value.is_valid()) {
widget->set_text(value.ptr<char>());
@@ -360,7 +374,9 @@ PropertiesWindow::create_value_widget(const URI& key,
widget->signal_changed().connect(
sigc::bind(sigc::mem_fun(this, &PropertiesWindow::on_change), key));
return widget;
- } else if (type == _app->uris().atom_URID) {
+ }
+
+ if (type == _app->uris().atom_URID) {
const char* str = (value.is_valid()
? world.uri_map().unmap_uri(value.get<int32_t>())
: "");
@@ -486,9 +502,8 @@ PropertiesWindow::get_value(LV2_URID type, Gtk::Widget* value_widget)
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()));
- } else {
- _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) {