window: Profile panel creation times

This commit is contained in:
Georges Basile Stavracas Neto 2018-03-28 16:39:13 -03:00
parent 0d16cd3feb
commit 1367a8c083

View file

@ -20,6 +20,8 @@
* Author: Thomas Wood <thos@gnome.org>
*/
#define G_LOG_DOMAIN "cc-window"
#include <config.h>
#include "cc-window.h"
@ -31,6 +33,7 @@
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#include <string.h>
#include <time.h>
#include "cc-panel.h"
#include "cc-shell.h"
@ -117,14 +120,21 @@ activate_panel (CcWindow *self,
const gchar *name,
GIcon *gicon)
{
g_autoptr (GTimer) timer = NULL;
GtkWidget *box, *title_widget;
const gchar *icon_name;
gdouble ellapsed_time;
if (!id)
return FALSE;
timer = g_timer_new ();
g_settings_set_string (self->settings, "last-panel", id);
/* Begin the profile */
g_timer_start (timer);
self->current_panel = GTK_WIDGET (cc_panel_loader_load_by_name (CC_SHELL (self), id, parameters));
cc_shell_set_active_panel (CC_SHELL (self), CC_PANEL (self->current_panel));
gtk_widget_show (self->current_panel);
@ -156,6 +166,13 @@ activate_panel (CcWindow *self,
self->current_panel_box = box;
/* Finish profiling */
g_timer_stop (timer);
ellapsed_time = g_timer_elapsed (timer, NULL);
g_debug ("Time to open panel '%s': %lfs", name, ellapsed_time);
return TRUE;
}
@ -779,4 +796,4 @@ cc_window_set_search_item (CcWindow *center,
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (center->search_bar), TRUE);
gtk_entry_set_text (GTK_ENTRY (center->search_entry), search);
gtk_editable_set_position (GTK_EDITABLE (center->search_entry), -1);
}
}