diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-01-02 09:41:30 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2019-01-02 09:41:30 +0000 |
| commit | 169dff19d4da8d76e69b8e896aa25b0013639c03 (patch) | |
| tree | a0c070fa95188b5cde708ac285e6a2db9df4a83f /src/io/resource-manager.cpp | |
| parent | Avoid creating a new document before opening an old document. (diff) | |
| download | inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.tar.gz inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.zip | |
modernize loops
Diffstat (limited to 'src/io/resource-manager.cpp')
| -rw-r--r-- | src/io/resource-manager.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/io/resource-manager.cpp b/src/io/resource-manager.cpp index ada60390e..48ef6ff76 100644 --- a/src/io/resource-manager.cpp +++ b/src/io/resource-manager.cpp @@ -260,8 +260,8 @@ std::map<Glib::ustring, Glib::ustring> ResourceManagerImpl::locateLinks(Glib::us Glib::RefPtr<Gtk::RecentManager> recentMgr = Gtk::RecentManager::get_default(); std::vector< Glib::RefPtr<Gtk::RecentInfo> > recentItems = recentMgr->get_items(); - for ( std::vector< Glib::RefPtr<Gtk::RecentInfo> >::iterator it = recentItems.begin(); it != recentItems.end(); ++it ) { - Glib::ustring uri = (*it)->get_uri(); + for (auto & recentItem : recentItems) { + Glib::ustring uri = recentItem->get_uri(); std::string scheme = Glib::uri_parse_scheme(uri); if ( scheme == "file" ) { try { @@ -278,11 +278,11 @@ std::map<Glib::ustring, Glib::ustring> ResourceManagerImpl::locateLinks(Glib::us } // At the moment we expect this list to contain file:// references, or simple relative or absolute paths. - for ( std::vector<Glib::ustring>::const_iterator it = brokenLinks.begin(); it != brokenLinks.end(); ++it ) { + for (const auto & brokenLink : brokenLinks) { // TODO debug g_message("========{%s}", it->c_str()); std::string uri; - if ( extractFilepath( *it, uri ) || reconstructFilepath( *it, uri ) ) { + if ( extractFilepath( brokenLink, uri ) || reconstructFilepath( brokenLink, uri ) ) { // We were able to get some path. Check it std::string origPath = uri; @@ -315,7 +315,7 @@ std::map<Glib::ustring, Glib::ustring> ResourceManagerImpl::locateLinks(Glib::us bool isAbsolute = Glib::path_is_absolute( uri ); Glib::ustring replacement = isAbsolute ? Glib::filename_to_uri( uri ) : Glib::filename_to_utf8( uri ); - result[*it] = replacement; + result[brokenLink] = replacement; } } } |
