diff options
Diffstat (limited to 'src/gui/BreadCrumbs.cpp')
-rw-r--r-- | src/gui/BreadCrumbs.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp index 4e257d88..076a259f 100644 --- a/src/gui/BreadCrumbs.cpp +++ b/src/gui/BreadCrumbs.cpp @@ -20,24 +20,23 @@ #include "GraphView.hpp" #include "ingen/client/SigClientInterface.hpp" +#include "raul/Path.hpp" #include "raul/Symbol.hpp" -#include <boost/variant/get.hpp> #include <glibmm/signalproxy.h> #include <sigc++/adaptors/bind.h> #include <sigc++/functors/mem_fun.h> #include <string> +#include <variant> -namespace ingen { -namespace gui { +namespace ingen::gui { using std::string; BreadCrumbs::BreadCrumbs(App& app) : _active_path("/") , _full_path("/") - , _enable_signal(true) { app.sig_client()->signal_message().connect( sigc::mem_fun(this, &BreadCrumbs::message)); @@ -66,7 +65,7 @@ void BreadCrumbs::build(const raul::Path& path, const std::shared_ptr<GraphView>& view) { - bool old_enable_signal = _enable_signal; + const bool old_enable_signal = _enable_signal; _enable_signal = false; if (!_breadcrumbs.empty() && (path.is_parent_of(_full_path) || path == _full_path)) { @@ -78,7 +77,7 @@ BreadCrumbs::build(const raul::Path& path, b->set_view(view); } - // views are expensive, having two around for the same graph is a bug + // Views are expensive, having two around is a bug assert(b->view() == view); } else { @@ -90,7 +89,7 @@ BreadCrumbs::build(const raul::Path& path, _enable_signal = old_enable_signal; } else if (!_breadcrumbs.empty() && path.is_child_of(_full_path)) { - // Moving to a child of the full path, just append crumbs (preserve view cache) + // Moving to a child of the full path, append crumbs (preserve cache) string suffix = path.substr(_full_path.length()); while (suffix.length() > 0) { @@ -105,9 +104,9 @@ BreadCrumbs::build(const raul::Path& path, but->show(); if (suffix.find('/') == string::npos) { break; - } else { - suffix = suffix.substr(suffix.find('/') + 1); } + + suffix = suffix.substr(suffix.find('/') + 1); } for (const auto& b : _breadcrumbs) { @@ -116,8 +115,8 @@ BreadCrumbs::build(const raul::Path& path, _breadcrumbs.back()->set_active(true); } else { - // Rebuild from scratch - // Getting here is bad unless absolutely necessary, since the GraphView cache is lost + /* Rebuild from scratch. Getting here is bad unless absolutely + necessary, since the GraphView cache is lost. */ _full_path = path; _active_path = path; @@ -149,9 +148,9 @@ BreadCrumbs::build(const raul::Path& path, but->show(); if (suffix.find('/') == string::npos) { break; - } else { - suffix = suffix.substr(suffix.find('/')+1); } + + suffix = suffix.substr(suffix.find('/')+1); } } @@ -197,7 +196,7 @@ BreadCrumbs::breadcrumb_clicked(BreadCrumb* crumb) void BreadCrumbs::message(const Message& msg) { - if (const Del* const del = boost::get<Del>(&msg)) { + if (const Del* const del = std::get_if<Del>(&msg)) { object_destroyed(del->uri); } } @@ -228,5 +227,4 @@ BreadCrumbs::object_moved(const raul::Path& old_path, const raul::Path& new_path } } -} // namespace gui -} // namespace ingen +} // namespace ingen::gui |