[anjuta] libanjuta: Fixed stupid bugs in anjuta-status.c that can lead to random busy cursors.



commit 4da76f409e1ab3b9409c5082855ba6f827653b6d
Author: Johannes Schmid <jhs gnome org>
Date:   Mon Nov 23 22:39:04 2009 +0100

    libanjuta: Fixed stupid bugs in anjuta-status.c that can lead to random busy cursors.
    
    (and some coding style fixes)

 libanjuta/anjuta-status.c        |    9 ++++++-
 plugins/file-loader/dnd.c        |   40 ++++++++++++++--------------
 plugins/sourceview/anjuta-view.c |   52 +++++++++++++++++++-------------------
 3 files changed, 54 insertions(+), 47 deletions(-)
---
diff --git a/libanjuta/anjuta-status.c b/libanjuta/anjuta-status.c
index 751d556..9cd4ed6 100644
--- a/libanjuta/anjuta-status.c
+++ b/libanjuta/anjuta-status.c
@@ -31,6 +31,7 @@
 #include <gtk/gtk.h>
 #include <libanjuta/anjuta-status.h>
 #include <libanjuta/anjuta-utils.h>
+#include <libanjuta/anjuta-debug.h>
 #include <libanjuta/resources.h>
 #include <libanjuta/e-splash.h>
 
@@ -293,6 +294,9 @@ anjuta_status_busy_push (AnjutaStatus *status)
 		return;
 	
 	status->priv->busy_count++;
+
+	DEBUG_PRINT ("Busy status: %d", status->priv->busy_count);
+	
 	if (status->priv->busy_count > 1)
 		return;
 	cursor = gdk_cursor_new (GDK_WATCH);
@@ -320,11 +324,13 @@ anjuta_status_busy_pop (AnjutaStatus *status)
 		return;
 
 	status->priv->busy_count--;
+	DEBUG_PRINT ("Busy status: %d", status->priv->busy_count);
+
 	if (status->priv->busy_count > 0)
 		return;
 	
 	status->priv->busy_count = 0;
-	gtk_widget_get_window (top);
+	window = gtk_widget_get_window (top);
 	if (window)
 		gdk_window_set_cursor (window, NULL);
 	if (status->priv->widgets)
@@ -471,6 +477,7 @@ anjuta_status_progress_add_ticks (AnjutaStatus *status, gint ticks)
 			gtk_widget_queue_draw (GTK_WIDGET (status->priv->status_bar));
 			gtk_widget_queue_draw (GTK_WIDGET (status->priv->progress_bar));
 			progressbar_window = gtk_widget_get_window (GTK_WIDGET(status->priv->progress_bar));
+			statusbar_window = gtk_widget_get_window (GTK_WIDGET(status->priv->status_bar));
 			if (progressbar_window != NULL)
 				gdk_window_process_updates (progressbar_window, TRUE);
 			if (statusbar_window != NULL)
diff --git a/plugins/file-loader/dnd.c b/plugins/file-loader/dnd.c
index c4e077e..3a0d37f 100644
--- a/plugins/file-loader/dnd.c
+++ b/plugins/file-loader/dnd.c
@@ -59,8 +59,8 @@ dnd_drag_drop (GtkWidget      *widget,
 
   if (target != GDK_NONE)
   {
-	gtk_drag_get_data (widget, context, target, timestamp);
-	result = TRUE;
+		gtk_drag_get_data (widget, context, target, timestamp);
+		result = TRUE;
   }
   
   return result;
@@ -75,25 +75,25 @@ drag_data_received_cb (GtkWidget *widget, GdkDragContext *context,
                        gint x, gint y, GtkSelectionData *data,
                        guint info, guint time, gpointer user_data)
 {
-  GSList* files;
-  /* If this is an URL emit DROP_URIS, otherwise chain up the signal */
-  if (info == TARGET_URI_LIST)
-  {
-	files = anjuta_utils_drop_get_files (data);
-
-	if (files != NULL)
+	GSList* files;
+	/* If this is an URL emit DROP_URIS, otherwise chain up the signal */
+	if (info == TARGET_URI_LIST)
 	{
-	  GSList* node;
-	  for (node = files; node != NULL; node = g_slist_next(node))
-	  {
-		GFile* file = node->data;
-		dnd_data_dropped (file, user_data);
-		g_object_unref (file);
-	  }
-	  g_slist_free (files);
-	  gtk_drag_finish (context, TRUE, FALSE, time);
-	}
-	gtk_drag_finish (context, FALSE, FALSE, time);
+		files = anjuta_utils_drop_get_files (data);
+
+		if (files != NULL)
+		{
+			GSList* node;
+			for (node = files; node != NULL; node = g_slist_next(node))
+			{
+				GFile* file = node->data;
+				dnd_data_dropped (file, user_data);
+				g_object_unref (file);
+			}
+			g_slist_free (files);
+			gtk_drag_finish (context, TRUE, FALSE, time);
+		}
+		gtk_drag_finish (context, FALSE, FALSE, time);
   }
 }
 
diff --git a/plugins/sourceview/anjuta-view.c b/plugins/sourceview/anjuta-view.c
index c938daf..a5d7f4f 100644
--- a/plugins/sourceview/anjuta-view.c
+++ b/plugins/sourceview/anjuta-view.c
@@ -214,33 +214,33 @@ anjuta_view_drag_data_received (GtkWidget        *widget,
                                 guint             info,
                                 guint             timestamp)
 {
-  GSList* files;
-  AnjutaView* view = ANJUTA_VIEW (widget);
-  /* If this is an URL emit DROP_URIS, otherwise chain up the signal */
-  if (info == TARGET_URI_LIST)
-  {
-	files = anjuta_utils_drop_get_files (selection_data);
-
-	if (files != NULL)
+	GSList* files;
+	AnjutaView* view = ANJUTA_VIEW (widget);
+	/* If this is an URL emit DROP_URIS, otherwise chain up the signal */
+	if (info == TARGET_URI_LIST)
 	{
-	  IAnjutaFileLoader* loader = anjuta_shell_get_interface (view->priv->sv->priv->plugin->shell, 
-	                                                          IAnjutaFileLoader, NULL);
-	  GSList* node;
-	  for (node = files; node != NULL; node = g_slist_next(node))
-	  {
-		GFile* file = node->data;
-		ianjuta_file_loader_load (loader, file, FALSE, NULL);
-		g_object_unref (file);
-	  }
-	  g_slist_free (files);
-	  gtk_drag_finish (context, TRUE, FALSE, timestamp);
+		files = anjuta_utils_drop_get_files (selection_data);
+
+		if (files != NULL)
+		{
+			IAnjutaFileLoader* loader = anjuta_shell_get_interface (view->priv->sv->priv->plugin->shell, 
+			                                                        IAnjutaFileLoader, NULL);
+			GSList* node;
+			for (node = files; node != NULL; node = g_slist_next(node))
+			{
+				GFile* file = node->data;
+				ianjuta_file_loader_load (loader, file, FALSE, NULL);
+				g_object_unref (file);
+			}
+			g_slist_free (files);
+			gtk_drag_finish (context, TRUE, FALSE, timestamp);
+		}
+		gtk_drag_finish (context, FALSE, FALSE, timestamp);
+	}
+	else
+	{
+		GTK_WIDGET_CLASS (anjuta_view_parent_class)->drag_data_received (widget, context, x, y, selection_data, info, timestamp);
 	}
-	gtk_drag_finish (context, FALSE, FALSE, timestamp);
-  }
-  else
-  {
-	GTK_WIDGET_CLASS (anjuta_view_parent_class)->drag_data_received (widget, context, x, y, selection_data, info, timestamp);
-  }
 }
 
 static void
@@ -531,7 +531,7 @@ anjuta_view_copy_clipboard (AnjutaView *view)
 void
 anjuta_view_paste_clipboard (AnjutaView *view)
 {
-  	GtkTextBuffer *buffer;
+  GtkTextBuffer *buffer;
 	GtkClipboard *clipboard;
 
 	g_return_if_fail (ANJUTA_IS_VIEW (view));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]