summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2008-03-09 13:58:58 -0400
committerSøren Sandmann <sandmann@redhat.com>2008-03-09 13:58:58 -0400
commit26a330e72339712bee0bf135d43f41812532609f (patch)
treeee21833e62613b0afdb02050b84eb808bb562c19
parent2ebe756bd2cc249d8b70214cc1fdb6a4dc1a0e4f (diff)
Remove some unused code
-rw-r--r--siv.c18
-rw-r--r--window.c34
2 files changed, 10 insertions, 42 deletions
diff --git a/siv.c b/siv.c
index 3e6a852..2884951 100644
--- a/siv.c
+++ b/siv.c
@@ -1,21 +1,3 @@
-/* Sysprof -- Sampling, systemwide CPU profiler
- * Copyright 2004, Red Hat, Inc.
- * Copyright 2004, 2005, 2006, 2007, Soeren Sandmann
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <glib/gprintf.h>
diff --git a/window.c b/window.c
index 617f33b..24aad94 100644
--- a/window.c
+++ b/window.c
@@ -134,8 +134,8 @@ adjust_adjustment (GtkAdjustment *adj, int old_size, int new_size)
static void
rebuild (Window *window)
{
- gboolean can_zoom_out;
- gboolean can_zoom_in;
+ gboolean can_zoom_out = FALSE;
+ gboolean can_zoom_in = FALSE;
if (window->zoom_level < MIN_ZOOM)
window->zoom_level = MIN_ZOOM;
@@ -143,34 +143,18 @@ rebuild (Window *window)
if (window->zoom_level > MAX_ZOOM)
window->zoom_level = MAX_ZOOM;
- if (!window->original)
- {
- can_zoom_out = FALSE;
- can_zoom_in = FALSE;
- }
- else
+ if (window->original)
{
int w, h;
GtkAdjustment *vadj, *hadj;
compute_size (window, &w, &h);
- can_zoom_in = window->zoom_level < MAX_ZOOM;
-
- can_zoom_out = window->zoom_level > MIN_ZOOM;
- if (window->zoom_level <= 0 && (w < 32 || h < 32))
- can_zoom_out = FALSE;
-
gtk_widget_hide (GET_WIDGET (window, "scrolled_window"));
hadj = gtk_scrolled_window_get_hadjustment (GET_WIDGET (window, "scrolled_window"));
vadj = gtk_scrolled_window_get_vadjustment (GET_WIDGET (window, "scrolled_window"));
-#if 0
- gtk_viewport_set_hadjustment (GET_WIDGET (window, "viewport1"), NULL);
- gtk_viewport_set_vadjustment (GET_WIDGET (window, "viewport1"), NULL);
-#endif
-
if (window->first)
{
gtk_adjustment_set_value (hadj, 0.0);
@@ -190,13 +174,13 @@ rebuild (Window *window)
gtk_widget_show (GET_WIDGET (window, "scrolled_window"));
-#if 0
- gtk_viewport_set_hadjustment (GET_WIDGET (window, "viewport1"), hadj);
- gtk_viewport_set_vadjustment (GET_WIDGET (window, "viewport1"), vadj);
-#endif
-
window->width = w;
window->height = h;
+
+ can_zoom_in = window->zoom_level < MAX_ZOOM;
+ can_zoom_out = window->zoom_level > MIN_ZOOM;
+ if (window->zoom_level <= 0 && (w < 16 || h < 16))
+ can_zoom_out = FALSE;
}
gtk_widget_set_sensitive (GET_WIDGET (window, "menu_zoom_out"), can_zoom_out);
@@ -453,4 +437,6 @@ void
window_show (Window *window)
{
gtk_widget_show (GET_WIDGET (window, "main_window"));
+
+ gtk_window_set_focus (GET_WIDGET (window, "main_window"), NULL);
}