[fvkbd] Remove unused variables. Fixes FTBFS 715805

Peter Robinson pbrobinson at fedoraproject.org
Sat Jun 25 12:41:47 UTC 2011


commit 7c5a6259f48b4d07261519089a9621e940c75688
Author: Peter Robinson <pbrobinson at gmail.com>
Date:   Sat Jun 25 13:41:28 2011 +0100

    Remove unused variables. Fixes FTBFS 715805

 fvkbd-remove-unused.patch |  251 +++++++++++++++++++++++++++++++++++++++++++++
 fvkbd.spec                |   12 +-
 2 files changed, 257 insertions(+), 6 deletions(-)
---
diff --git a/fvkbd-remove-unused.patch b/fvkbd-remove-unused.patch
new file mode 100644
index 0000000..0842ef7
--- /dev/null
+++ b/fvkbd-remove-unused.patch
@@ -0,0 +1,251 @@
+--- fvkbd-0.2.2/src/fvkbd-keyboard.c.orig	2011-06-24 13:00:07.549223431 +0100
++++ fvkbd-0.2.2/src/fvkbd-keyboard.c	2011-06-24 13:01:28.128095032 +0100
+@@ -156,8 +156,6 @@
+ void
+ fvkbd_keyboard_do_func (FvkbdKeyboard *keyboard, KbdFuncInfo *func)
+ {
+-	FvkbdKeyboardPrivate *priv;
+-	priv = FVKBD_KEYBOARD_GET_PRIVATE(keyboard);
+ 	gboolean return_value = FALSE;
+ 
+ 	g_signal_emit(keyboard, fvkbd_keyboard_signals[KBD_FUNCTION], 0, func, &return_value);
+--- fvkbd-0.2.2/src/fvkbd-key.c.orig	2011-06-24 13:01:42.707433803 +0100
++++ fvkbd-0.2.2/src/fvkbd-key.c	2011-06-24 13:03:02.964299428 +0100
+@@ -190,9 +190,7 @@
+ static void
+ fvkbd_key_init (FvkbdKey *self)
+ {
+-	FvkbdKeyPrivate *priv;
+ 	FvkbdUnit *unit = FVKBD_UNIT(self);
+-	priv = FVKBD_KEY_GET_PRIVATE(self);
+ 
+ 	fvkbd_set_unit_type(unit, UNIT_TYPE_KEY);
+ }
+@@ -797,9 +795,6 @@
+ void
+ fvkbd_key_send_xkeysym(KeySym sym)
+ {
+-	gint ret;
+-
+-	ret = fakekey_press_keysym(get_fakekey_instance(), sym, 0);
+ 	fakekey_release(get_fakekey_instance());
+ 	DBG("action: send sym: %x, result:%d\n", (unsigned int)sym, ret);
+ }
+--- fvkbd-0.2.2/ui/gtk/fvkbd-panel-ui-gtk.c.orig	2011-06-24 13:16:43.992451975 +0100
++++ fvkbd-0.2.2/ui/gtk/fvkbd-panel-ui-gtk.c	2011-06-24 14:07:51.720009666 +0100
+@@ -248,12 +248,7 @@
+ static void
+ gtk_vkb_panel_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
+ {
+-	FvkbdUnit *unit;
+-	FvkbdPanel *panel;
+-
+ 	DBG("aw=%d,ah=%d\n", widget->allocation.width, widget->allocation.height);
+-	unit = FVKBD_UNIT(GTK_VKB_PANEL(widget)->panel_unit);
+-	panel = FVKBD_PANEL(GTK_VKB_PANEL(widget)->panel_unit);
+ 
+ 	widget->allocation = *allocation;
+ 
+@@ -279,19 +274,11 @@
+ 
+ 	GdkPixmap *pixmap = NULL;
+ 
+-	GtkWidget *panel_widget;
+ 	gchar *img = NULL;
+-	KbdColor *kc;
+-	guint color = 0xFFFFFFFF;
+ 
+ 	if ((img = fvkbd_panel_get_img(panel)) == NULL)
+ 		return;
+ 
+-	if ((kc = fvkbd_unit_get_color(unit, KBD_COLOR_TYPE_PANEL_BG)) != NULL)
+-		color = (kc->r << 24) + (kc->g << 16) + (kc->b << 8) + (kc->a);
+-
+-	panel_widget = fvkbd_gtk_ui_get_widget(ui);
+-
+ 	load_and_scale_pixmap_and_mask(img, 1, 1, &pixmap, NULL);
+ 	if (pixmap) {
+ 		gtk_widget_set_app_paintable(widget, TRUE);
+@@ -299,8 +286,6 @@
+ 		g_object_unref(pixmap);
+ 	}
+ 
+-	//set_gtk_widget_bg_image(panel_widget, img, color);
+-
+ 	return;
+ }
+ 
+@@ -310,13 +295,10 @@
+ {
+ 	FvkbdGtkUI *ui = FVKBD_GTK_UI(data);
+ 	FvkbdUnit *unit = ui->unit;
+-	FvkbdPanel *panel;
+ 	int tmp_w = 1, tmp_h = 1;
+ 	float x_ratio, y_ratio;
+ 
+ 	unit = FVKBD_UNIT(GTK_VKB_PANEL(widget)->panel_unit);
+-	panel = FVKBD_PANEL(GTK_VKB_PANEL(widget)->panel_unit);
+-
+ 
+ 	fvkbd_unit_get_size(unit, &tmp_w, &tmp_h);
+ 	x_ratio = (float)allocation->width / (float)tmp_w;
+@@ -460,12 +442,8 @@
+ fvkbd_panel_gtk_ui_allocate (FvkbdGtkUI *ui, gint x, gint y, gfloat x_ratio, gfloat y_ratio)
+ {
+ 	FvkbdPanelGtkUI *self = FVKBD_PANEL_GTK_UI(ui);
+-	FvkbdUnit *unit;
+-	FvkbdPanel *panel;
+ 	GtkWidget *panel_widget;
+ 
+-	unit = ui->unit;
+-	panel = FVKBD_PANEL(unit);
+ 	panel_widget = fvkbd_gtk_ui_get_widget(ui);
+ 
+ 	fvkbd_gtk_ui_set_ratio(ui, x_ratio, y_ratio);
+@@ -487,15 +465,12 @@
+ fvkbd_panel_gtk_ui_destroy (FvkbdGtkUI *ui)
+ {
+ 	FvkbdPanelGtkUI *self = FVKBD_PANEL_GTK_UI(ui);
+-	FvkbdPanel *panel;
+ 	FvkbdGtkUI *child_ui;
+ 	GtkWidget *panel_widget;
+ 	GSList *children;
+ 	gint i;
+ 	gboolean ret = TRUE;
+ 
+-	panel = FVKBD_PANEL(ui->unit);
+-
+ 	panel_widget = ui->widget;
+ 
+ 	gtk_widget_hide_all(panel_widget);
+--- fvkbd-0.2.2/ui/gtk/fvkbd-key-ui-gtk.c.orig	2011-06-25 13:12:37.828855834 +0100
++++ fvkbd-0.2.2/ui/gtk/fvkbd-key-ui-gtk.c	2011-06-25 13:16:06.514736103 +0100
+@@ -284,25 +284,10 @@
+ static void
+ _key_gtk_ui_func_handlers(FvkbdKeyGtkUI *key_ui, FvkbdKeyAction *action, void *data)
+ {
+-	gint err;
+-	FvkbdKeyboardGtkUI *keyboard_ui = fvkbd_keyboard_gtk_ui_get_ui();
+ 	FvkbdKeyboard *keyboard = fvkbd_keyboard_gtk_ui_get_keyboard();
+ 
+ 	switch (action->u.func.type) {
+ 	case KBD_FUNC_MODE_SELECT:
+-		{
+-			int id;
+-			KeyboardModeStatus status = KEYBOARD_MODE_STATUS_NORMAL;
+-
+-			id = *((int *)action->u.func.data);
+-			if (data)
+-				status = *((KeyboardModeStatus *)data);
+-
+-			err = keyboard_ui_change_mode(keyboard_ui, id, status);
+-
+-			break;
+-		}
+-
+ 	case KBD_FUNC_EXIT:
+ 	case KBD_FUNC_MENU:
+ 		fvkbd_keyboard_do_func(keyboard, &(action->u.func));
+@@ -984,14 +969,12 @@
+ 	FvkbdKeyGtkUI *key_ui = FVKBD_KEY_GTK_UI(ui);
+ 	FvkbdUnit *unit = ui->unit;
+ 	FvkbdKeyGtkUIPrivate *priv = FVKBD_KEY_GTK_UI_GET_PRIVATE(key_ui);
+-	FvkbdKey *key;
+ 	gboolean ret = TRUE;
+ 	GtkWidget *key_widget;
+ 	int i;
+ 
+ 	g_return_val_if_fail(FVKBD_IS_KEY(unit), FALSE);
+ 
+-	key = FVKBD_KEY(unit);
+ 	key_widget = fvkbd_gtk_ui_get_widget(ui);
+ 
+ 	gtk_widget_hide_all(key_widget);
+@@ -1035,7 +1018,6 @@
+ fvkbd_key_gtk_ui_set_mode (FvkbdGtkUI *ui, gint id)
+ {
+ 	FvkbdKeyGtkUI *key_ui;
+-	FvkbdKey *key;
+ 	FvkbdKeyboard *keyboard = fvkbd_keyboard_gtk_ui_get_keyboard();
+ 
+ 	KeyboardModeStatus status;
+@@ -1044,7 +1026,6 @@
+ 	g_return_val_if_fail(FVKBD_IS_KEY_GTK_UI(ui), FALSE);
+ 
+ 	key_ui = FVKBD_KEY_GTK_UI(ui);
+-	key = FVKBD_KEY(ui->unit);
+ 	key_widget = fvkbd_gtk_ui_get_widget(ui);
+ 	status = fvkbd_keyboard_get_mode_status(keyboard);
+ 
+--- fvkbd-0.2.2/app/gtk/fvkbd-ui-gtk.c.orig	2011-06-25 13:27:36.248883717 +0100
++++ fvkbd-0.2.2/app/gtk/fvkbd-ui-gtk.c	2011-06-25 13:28:40.709417516 +0100
+@@ -619,7 +619,6 @@
+ 	GOptionContext *context;
+ 	GError *error = NULL;
+ 	gchar *layout_name;
+-	GTimer *timer;
+ 	FvkbdUnit *keyboard;
+ 	FvkbdGtkUI *keyboard_ui;
+ 
+@@ -627,8 +626,6 @@
+ 	opts.embedded = FALSE;
+ 	opts.dock = FALSE;
+ 
+-	timer = TIMER_NEW();
+-
+ 	context = g_option_context_new(" fvkbd : Free Virtual Keyboard");
+ 	g_option_context_add_main_entries(context, opt_entries, NULL);
+ 
+@@ -639,8 +636,6 @@
+ 
+ 	g_option_context_free(context);
+ 
+-	TIMER_ELAPSED(timer);
+-
+ 	if (!opts.embedded) {
+ 		app = unique_app_new_with_commands("com.intel.fvkbd.unique", NULL,
+ 							"layout", COMMAND_LAYOUT,
+@@ -671,8 +666,6 @@
+ 
+ 	layout_name = kbd_init(opts.layout_file);
+ 
+-	TIMER_ELAPSED(timer);
+-
+ 	if (!layout_name) {
+ 		fprintf(stderr, "Could not find layout file\n");
+ 		return -1;
+@@ -685,16 +678,12 @@
+ 
+ 	current_layout = g_strdup(layout_name);
+ 
+-	TIMER_ELAPSED(timer);
+-
+ 	keyboard_ui = fvkbd_keyboard_gtk_ui_new(keyboard);
+ 	if (fvkbd_gtk_ui_build(keyboard_ui, NULL) == FALSE) {
+ 		fprintf(stderr, "Failed to build ui for : %s\n", layout_name);
+ 		return -1;
+ 	}
+ 
+-	TIMER_ELAPSED(timer);
+-
+ 	if (build_panel_windows(keyboard_ui) != TRUE) {
+ 		fprintf(stderr, "Failed to init keyboard UI\n");
+ 		return -1;
+@@ -710,8 +699,6 @@
+ 		fflush(stdout);
+ 	}
+ 
+-	TIMER_ELAPSED(timer);
+-
+ 	the_keyboard_ui = keyboard_ui;
+ 
+ 	kbd_initialized = TRUE;
+@@ -721,8 +708,6 @@
+ 	kbd_cleanup();
+ 
+ done:
+-	TIMER_STOP(timer);
+-	TIMER_DESTROY(timer);
+ 
+ 	if (app)
+ 		g_object_unref(app);
diff --git a/fvkbd.spec b/fvkbd.spec
index 1f15f52..1e080d2 100644
--- a/fvkbd.spec
+++ b/fvkbd.spec
@@ -15,7 +15,7 @@ URL:           http://gitorious.org/fvkbd/pages/Home
 # vc           http://gitorious.org/fvkbd/fvkbd/commits/master
 Source0:       %{tarfile}
 Patch0:        fvkbd-fixdesktop.patch
-BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch1:        fvkbd-remove-unused.patch
 
 BuildRequires: clutter-devel
 BuildRequires: gtk2-devel
@@ -43,7 +43,8 @@ Files for development with %{name}.
 
 %prep
 %setup -q
-%patch0 -p1 -b .fixdesktop.patch
+%patch0 -p1 -b .fixdesktop
+%patch1 -p1 -b .remove_unused
 
 # run autogen.sh until we have a proper release, but don't run configure twice.
 sed -i '/configure/d' autogen.sh
@@ -54,7 +55,6 @@ sed -i '/configure/d' autogen.sh
 make %{?_smp_mflags} V=1
 
 %install
-rm -rf %{buildroot}
 make install DESTDIR=%{buildroot} INSTALL='install -p'
 
 desktop-file-validate %{buildroot}/%{_datadir}/applications/fvkbd-gtk.desktop
@@ -64,9 +64,6 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
 
 %find_lang %{name}
 
-%clean
-rm -rf %{buildroot}
-
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
@@ -87,6 +84,9 @@ rm -rf %{buildroot}
 %{_libdir}/libfvkbd-gtk-0.2.so
 
 %changelog
+* Wed Jun 22 2011 Peter Robinson <pbrobinson at gmail.com> - 0.2.2-4
+- Remove unused variables. Fixes FTBFS 715805
+
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.2.2-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list