[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 12/20: Use rvalue references.

noreply at xfce.org noreply at xfce.org
Thu Feb 6 12:03:29 CET 2020


This is an automated email from the git hooks/post-receive script.

g   o   t   t   c   o   d   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 9cb72c853b03321579acafa1dbb0660b8c00b92a
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sat Feb 1 20:53:31 2020 -0500

    Use rvalue references.
---
 panel-plugin/applications-page.cpp | 2 +-
 panel-plugin/favorites-page.cpp    | 4 ++--
 panel-plugin/recent-page.cpp       | 4 ++--
 panel-plugin/search-page.cpp       | 2 +-
 panel-plugin/settings.cpp          | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/panel-plugin/applications-page.cpp b/panel-plugin/applications-page.cpp
index 8305ced..f347306 100644
--- a/panel-plugin/applications-page.cpp
+++ b/panel-plugin/applications-page.cpp
@@ -420,7 +420,7 @@ void ApplicationsPage::load_menu_item(GarconMenuItem* menu_item, Category* categ
 	auto iter = m_items.find(desktop_id);
 	if (iter == m_items.end())
 	{
-		iter = m_items.insert(std::make_pair(desktop_id, new Launcher(menu_item))).first;
+		iter = m_items.insert(std::make_pair(std::move(desktop_id), new Launcher(menu_item))).first;
 	}
 
 	// Add menu item to current category
diff --git a/panel-plugin/favorites-page.cpp b/panel-plugin/favorites-page.cpp
index bde3039..71cc883 100644
--- a/panel-plugin/favorites-page.cpp
+++ b/panel-plugin/favorites-page.cpp
@@ -195,12 +195,12 @@ void FavoritesPage::on_row_inserted(GtkTreeModel* model, GtkTreePath* path, GtkT
 
 	if (pos >= wm_settings->favorites.size())
 	{
-		wm_settings->favorites.push_back(desktop_id);
+		wm_settings->favorites.push_back(std::move(desktop_id));
 		wm_settings->set_modified();
 	}
 	else if (wm_settings->favorites[pos] != desktop_id)
 	{
-		wm_settings->favorites.insert(wm_settings->favorites.begin() + pos, desktop_id);
+		wm_settings->favorites.insert(wm_settings->favorites.begin() + pos, std::move(desktop_id));
 		wm_settings->set_modified();
 	}
 }
diff --git a/panel-plugin/recent-page.cpp b/panel-plugin/recent-page.cpp
index f56f95b..bd94199 100644
--- a/panel-plugin/recent-page.cpp
+++ b/panel-plugin/recent-page.cpp
@@ -79,7 +79,7 @@ void RecentPage::add(Launcher* launcher)
 			gtk_tree_model_iter_nth_child(model, &iter, nullptr, std::distance(wm_settings->recent.begin(), i));
 			gtk_list_store_move_after(GTK_LIST_STORE(model), &iter, nullptr);
 			wm_settings->recent.erase(i);
-			wm_settings->recent.insert(wm_settings->recent.begin(), desktop_id);
+			wm_settings->recent.insert(wm_settings->recent.begin(), std::move(desktop_id));
 			wm_settings->set_modified();
 			return;
 		}
@@ -94,7 +94,7 @@ void RecentPage::add(Launcher* launcher)
 			LauncherView::COLUMN_TOOLTIP, launcher->get_tooltip(),
 			LauncherView::COLUMN_LAUNCHER, launcher,
 			-1);
-	wm_settings->recent.insert(wm_settings->recent.begin(), desktop_id);
+	wm_settings->recent.insert(wm_settings->recent.begin(), std::move(desktop_id));
 	wm_settings->set_modified();
 
 	// Prevent going over max
diff --git a/panel-plugin/search-page.cpp b/panel-plugin/search-page.cpp
index 026cf11..778496b 100644
--- a/panel-plugin/search-page.cpp
+++ b/panel-plugin/search-page.cpp
@@ -92,7 +92,7 @@ void SearchPage::set_filter(const gchar* filter)
 		match.update(m_query);
 		if (!Match::invalid(match))
 		{
-			search_action_matches.push_back(match);
+			search_action_matches.push_back(std::move(match));
 		}
 	}
 	std::stable_sort(search_action_matches.begin(), search_action_matches.end());
diff --git a/panel-plugin/settings.cpp b/panel-plugin/settings.cpp
index 2c7cd8d..bfe3776 100644
--- a/panel-plugin/settings.cpp
+++ b/panel-plugin/settings.cpp
@@ -64,7 +64,7 @@ static void read_vector_entry(XfceRc* rc, const char* key, std::vector<std::stri
 		std::string desktop_id(values[i]);
 		if (std::find(desktop_ids.cbegin(), desktop_ids.cend(), desktop_id) == desktop_ids.cend())
 		{
-			desktop_ids.push_back(desktop_id);
+			desktop_ids.push_back(std::move(desktop_id));
 		}
 	}
 	g_strfreev(values);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list