From bd89362f08dc07b3444d19bc373f2b4f8bc47b2c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 25 Dec 2017 16:13:15 -0500 Subject: Use std::move to potentially avoid copying --- src/gui/ConnectWindow.cpp | 6 +++--- src/gui/ConnectWindow.hpp | 4 ++-- src/gui/GraphCanvas.cpp | 2 +- src/gui/ThreadedLoader.cpp | 2 +- src/gui/URIEntry.cpp | 8 ++++---- src/gui/URIEntry.hpp | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/gui') diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index 74cba256..7cacb498 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -45,10 +45,10 @@ using namespace Ingen::Client; namespace Ingen { namespace GUI { -ConnectWindow::ConnectWindow(BaseObjectType* cobject, - const Glib::RefPtr& xml) +ConnectWindow::ConnectWindow(BaseObjectType* cobject, + Glib::RefPtr xml) : Dialog(cobject) - , _xml(xml) + , _xml(std::move(xml)) , _icon(nullptr) , _progress_bar(nullptr) , _progress_label(nullptr) diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp index b3b7473e..015a6e76 100644 --- a/src/gui/ConnectWindow.hpp +++ b/src/gui/ConnectWindow.hpp @@ -46,8 +46,8 @@ class App; class ConnectWindow : public Dialog { public: - ConnectWindow(BaseObjectType* cobject, - const Glib::RefPtr& xml); + ConnectWindow(BaseObjectType* cobject, + Glib::RefPtr xml); void set_connected_to(SPtr engine); void start(App& app, Ingen::World* world); diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp index 2d168468..8db0ef9c 100644 --- a/src/gui/GraphCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -78,7 +78,7 @@ GraphCanvas::GraphCanvas(App& app, int height) : Canvas(width, height) , _app(app) - , _graph(graph) + , _graph(std::move(graph)) , _auto_position_count(0) , _menu_x(0) , _menu_y(0) diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index 37636c42..93c97cbd 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -32,7 +32,7 @@ namespace GUI { ThreadedLoader::ThreadedLoader(App& app, SPtr engine) : _app(app) , _sem(0) - , _engine(engine) + , _engine(std::move(engine)) , _exit_flag(false) , _thread(&ThreadedLoader::run, this) { diff --git a/src/gui/URIEntry.cpp b/src/gui/URIEntry.cpp index 466948e4..30e6edb2 100644 --- a/src/gui/URIEntry.cpp +++ b/src/gui/URIEntry.cpp @@ -23,12 +23,12 @@ namespace Ingen { namespace GUI { -URIEntry::URIEntry(App* app, - const std::set& types, - const std::string& value) +URIEntry::URIEntry(App* app, + std::set types, + const std::string& value) : Gtk::HBox(false, 4) , _app(app) - , _types(types) + , _types(std::move(types)) , _menu_button(Gtk::manage(new Gtk::Button("≡"))) , _entry(Gtk::manage(new Gtk::Entry())) { diff --git a/src/gui/URIEntry.hpp b/src/gui/URIEntry.hpp index f49f5b0d..90df2160 100644 --- a/src/gui/URIEntry.hpp +++ b/src/gui/URIEntry.hpp @@ -36,9 +36,9 @@ public: * If `types` is given, then a menu button will be shown which pops up a * enu for easily choosing known values with valid types. */ - URIEntry(App* app, - const std::set& types, - const std::string& value); + URIEntry(App* app, + std::set types, + const std::string& value); std::string get_text() { return _entry->get_text(); } Glib::SignalProxy0 signal_changed() { return _entry->signal_changed(); } -- cgit v1.2.1