summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-12-25 16:37:00 -0500
committerDavid Robillard <d@drobilla.net>2017-12-25 16:37:00 -0500
commit37729e5b314e39fb750a3fb46a005acdb15b4ac2 (patch)
tree5e8e316e9f186dc47bfef09c7546cc3a8f14f6bb /src/gui
parent05bce078b6b5cfc64f10399da3a422d00fe6f790 (diff)
downloadingen-37729e5b314e39fb750a3fb46a005acdb15b4ac2.tar.gz
ingen-37729e5b314e39fb750a3fb46a005acdb15b4ac2.tar.bz2
ingen-37729e5b314e39fb750a3fb46a005acdb15b4ac2.zip
Use auto for iterators
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/App.cpp6
-rw-r--r--src/gui/GraphCanvas.cpp4
-rw-r--r--src/gui/PluginMenu.cpp2
-rw-r--r--src/gui/Port.cpp3
-rw-r--r--src/gui/PropertiesWindow.cpp4
-rw-r--r--src/gui/RDFS.cpp2
-rw-r--r--src/gui/WindowFactory.cpp18
7 files changed, 19 insertions, 20 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 565f3b19..1473320b 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -361,7 +361,7 @@ App::port_activity(Port* port)
void
App::activity_port_destroyed(Port* port)
{
- ActivityPorts::iterator i = _activity_ports.find(port);
+ auto i = _activity_ports.find(port);
if (i != _activity_ports.end()) {
_activity_ports.erase(i);
}
@@ -372,8 +372,8 @@ App::activity_port_destroyed(Port* port)
bool
App::animate()
{
- for (ActivityPorts::iterator i = _activity_ports.begin(); i != _activity_ports.end(); ) {
- ActivityPorts::iterator next = i;
+ for (auto i = _activity_ports.begin(); i != _activity_ports.end(); ) {
+ auto next = i;
++next;
if ((*i).second) { // saw it last time, unhighlight and pop
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 8db0ef9c..3078e347 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -347,7 +347,7 @@ GraphCanvas::add_block(SPtr<const BlockModel> bm)
void
GraphCanvas::remove_block(SPtr<const BlockModel> bm)
{
- Views::iterator i = _views.find(bm);
+ auto i = _views.find(bm);
if (i != _views.end()) {
const guint n_ports = i->second->num_ports();
@@ -370,7 +370,7 @@ GraphCanvas::add_port(SPtr<const PortModel> pm)
void
GraphCanvas::remove_port(SPtr<const PortModel> pm)
{
- Views::iterator i = _views.find(pm);
+ auto i = _views.find(pm);
// Port on this graph
if (i != _views.end()) {
diff --git a/src/gui/PluginMenu.cpp b/src/gui/PluginMenu.cpp
index 08102221..e512d587 100644
--- a/src/gui/PluginMenu.cpp
+++ b/src/gui/PluginMenu.cpp
@@ -81,7 +81,7 @@ PluginMenu::add_plugin(SPtr<Client::PluginModel> p)
add_plugin_to_menu(_classless_menu, p);
} else {
// For each menu that represents plugin's class (possibly several)
- for (iterator i = range.first; i != range.second ; ++i) {
+ for (auto i = range.first; i != range.second ; ++i) {
add_plugin_to_menu(i->second, p);
}
}
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 4f8e085e..9622a7f5 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -234,8 +234,7 @@ Port::build_enum_menu()
PluginModel::ScalePoints points = block->plugin_model()->port_scale_points(
model()->index());
- for (PluginModel::ScalePoints::iterator i = points.begin();
- i != points.end(); ++i) {
+ for (auto i = points.begin(); i != points.end(); ++i) {
menu->items().push_back(Gtk::Menu_Helpers::MenuElem(i->second));
Gtk::MenuItem* menu_item = &(menu->items().back());
menu_item->signal_activate().connect(
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index c259a92f..31e0aff4 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -392,7 +392,7 @@ PropertiesWindow::on_show()
void
PropertiesWindow::change_property(const Raul::URI& key, const Atom& value)
{
- Records::iterator r = _records.find(key);
+ auto r = _records.find(key);
if (r == _records.end()) {
add_property(key, value);
_table->show_all();
@@ -467,7 +467,7 @@ PropertiesWindow::get_value(LV2_URID type, Gtk::Widget* value_widget)
void
PropertiesWindow::on_change(const Raul::URI& key)
{
- Records::iterator r = _records.find(key);
+ auto r = _records.find(key);
if (r == _records.end()) {
return;
}
diff --git a/src/gui/RDFS.cpp b/src/gui/RDFS.cpp
index 4dd21e28..1a5e190a 100644
--- a/src/gui/RDFS.cpp
+++ b/src/gui/RDFS.cpp
@@ -122,7 +122,7 @@ types(World* world, SPtr<const Client::ObjectModel> model)
URISet types;
types.insert(Raul::URI(LILV_NS_RDFS "Resource"));
PropRange range = model->properties().equal_range(world->uris().rdf_type);
- for (PropIter t = range.first; t != range.second; ++t) {
+ for (auto t = range.first; t != range.second; ++t) {
if (t->second.type() == world->forge().URI ||
t->second.type() == world->forge().URID) {
const Raul::URI type(world->forge().str(t->second, false));
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index 7e6afb77..5dbdbe98 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -113,7 +113,7 @@ WindowFactory::graph_window(SPtr<const GraphModel> graph)
return nullptr;
}
- GraphWindowMap::iterator w = _graph_windows.find(graph->path());
+ auto w = _graph_windows.find(graph->path());
return (w == _graph_windows.end()) ? nullptr : w->second;
}
@@ -141,7 +141,7 @@ WindowFactory::present_graph(SPtr<const GraphModel> graph,
{
assert(!view || view->graph() == graph);
- GraphWindowMap::iterator w = _graph_windows.find(graph->path());
+ auto w = _graph_windows.find(graph->path());
if (w != _graph_windows.end()) {
(*w).second->present();
@@ -192,7 +192,7 @@ WindowFactory::remove_graph_window(GraphWindow* win, GdkEventAny* ignored)
return !_app.quit(win);
}
- GraphWindowMap::iterator w = _graph_windows.find(win->graph()->path());
+ auto w = _graph_windows.find(win->graph()->path());
assert((*w).second == win);
_graph_windows.erase(w);
@@ -208,7 +208,7 @@ WindowFactory::present_load_plugin(SPtr<const GraphModel> graph,
{
_app.request_plugins_if_necessary();
- GraphWindowMap::iterator w = _graph_windows.find(graph->path());
+ auto w = _graph_windows.find(graph->path());
if (w != _graph_windows.end()) {
_load_plugin_win->set_transient_for(*w->second);
@@ -230,7 +230,7 @@ void
WindowFactory::present_load_graph(SPtr<const GraphModel> graph,
Properties data)
{
- GraphWindowMap::iterator w = _graph_windows.find(graph->path());
+ auto w = _graph_windows.find(graph->path());
if (w != _graph_windows.end()) {
_load_graph_win->set_transient_for(*w->second);
@@ -243,7 +243,7 @@ void
WindowFactory::present_load_subgraph(SPtr<const GraphModel> graph,
Properties data)
{
- GraphWindowMap::iterator w = _graph_windows.find(graph->path());
+ auto w = _graph_windows.find(graph->path());
if (w != _graph_windows.end()) {
_load_graph_win->set_transient_for(*w->second);
@@ -256,7 +256,7 @@ void
WindowFactory::present_new_subgraph(SPtr<const GraphModel> graph,
Properties data)
{
- GraphWindowMap::iterator w = _graph_windows.find(graph->path());
+ auto w = _graph_windows.find(graph->path());
if (w != _graph_windows.end()) {
_new_subgraph_win->set_transient_for(*w->second);
@@ -268,7 +268,7 @@ WindowFactory::present_new_subgraph(SPtr<const GraphModel> graph,
void
WindowFactory::present_rename(SPtr<const ObjectModel> object)
{
- GraphWindowMap::iterator w = _graph_windows.find(object->path());
+ auto w = _graph_windows.find(object->path());
if (w == _graph_windows.end()) {
w = _graph_windows.find(object->path().parent());
}
@@ -283,7 +283,7 @@ WindowFactory::present_rename(SPtr<const ObjectModel> object)
void
WindowFactory::present_properties(SPtr<const ObjectModel> object)
{
- GraphWindowMap::iterator w = _graph_windows.find(object->path());
+ auto w = _graph_windows.find(object->path());
if (w == _graph_windows.end()) {
w = _graph_windows.find(object->path().parent());
}