Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5281)

Unified Diff: chrome/browser/gtk/task_manager_gtk.cc

Issue 362001: GTK: Properly convert task manager UI row to task manager model row.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: another leak fix Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ipc/ipc_message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/task_manager_gtk.cc
===================================================================
--- chrome/browser/gtk/task_manager_gtk.cc (revision 30942)
+++ chrome/browser/gtk/task_manager_gtk.cc (working copy)
@@ -634,10 +634,14 @@
GtkTreeModel* model;
GList* paths = gtk_tree_selection_get_selected_rows(selection, &model);
for (GList* item = paths; item; item = item->next) {
- int row = gtk_tree::GetRowNumForPath(
+ GtkTreePath* path = gtk_tree_model_sort_convert_path_to_child_path(
+ GTK_TREE_MODEL_SORT(process_list_sort_),
reinterpret_cast<GtkTreePath*>(item->data));
+ int row = gtk_tree::GetRowNumForPath(path);
+ gtk_tree_path_free(path);
task_manager_->KillProcess(row);
}
+ g_list_foreach(paths, reinterpret_cast<GFunc>(gtk_tree_path_free), NULL);
g_list_free(paths);
}
@@ -656,10 +660,15 @@
GtkTreeModel* model;
GList* selected = gtk_tree_selection_get_selected_rows(selection, &model);
if (selected) {
- int row = gtk_tree::GetRowNumForPath(
+ GtkTreePath* path = gtk_tree_model_sort_convert_path_to_child_path(
+ GTK_TREE_MODEL_SORT(process_list_sort_),
reinterpret_cast<GtkTreePath*>(selected->data));
+ int row = gtk_tree::GetRowNumForPath(path);
+ gtk_tree_path_free(path);
task_manager_->ActivateProcess(row);
}
+ g_list_foreach(selected, reinterpret_cast<GFunc>(gtk_tree_path_free), NULL);
+ g_list_free(selected);
}
void TaskManagerGtk::OnLinkActivated() {
@@ -750,13 +759,17 @@
GtkTreeModel* model;
GList* paths = gtk_tree_selection_get_selected_rows(selection, &model);
for (GList* item = paths; item; item = item->next) {
- int row = gtk_tree::GetRowNumForPath(
+ GtkTreePath* path = gtk_tree_model_sort_convert_path_to_child_path(
+ GTK_TREE_MODEL_SORT(task_manager->process_list_sort_),
reinterpret_cast<GtkTreePath*>(item->data));
+ int row = gtk_tree::GetRowNumForPath(path);
+ gtk_tree_path_free(path);
if (task_manager->task_manager_->IsBrowserProcess(row)) {
selection_contains_browser_process = true;
break;
}
}
+ g_list_foreach(paths, reinterpret_cast<GFunc>(gtk_tree_path_free), NULL);
g_list_free(paths);
bool sensitive = (paths != NULL) && !selection_contains_browser_process;
« no previous file with comments | « no previous file | ipc/ipc_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698