--- gedit/ChangeLog	2004-06-25 18:57:54.000000000 +0530
+++ ../gedit.new/ChangeLog	2004-08-17 19:55:29.000000000 +0530
@@ -1,131 +1,112 @@
-2004-06-25  Paolo Borelli  <pborelli@katamail.com>
-
-	* dialogs/replace.glade2: fix bug #143410.
-	Patch by <padraig.obriain@sun.com>
+2004-08-12  Udayan Kumar <udayan_kumar@da-iict.org>
+	* gedit/gedit-file.c ( added is_open() ) 
+	Checks if a file is already open before opening. 
+	if it does then skips opening it again
 
 2004-06-25  Paolo Borelli  <pborelli@katamail.com>
 
--- gedit/gedit-file.c	2004-06-25 18:39:35.000000000 +0530
+++ ../gedit.new/gedit/gedit-file.c	2004-08-17 19:51:36.000000000 +0530
@@ -1474,7 +1485,7 @@
 gedit_file_open_uri_list_real (GSList *uri_list, const GeditEncoding *encoding, gboolean create)
 {
 	gedit_debug (DEBUG_FILE, "");
-	
+	gboolean value=TRUE;
 	if (uri_list == NULL)
 		return TRUE;
 
@@ -1501,10 +1512,14 @@
 		gchar *uri;
 
 		uri = gnome_vfs_make_uri_canonical ((const gchar*)uri_list->data);
-		
-		gedit_debug (DEBUG_FILE, "URI: %s", uri);
+	
 
-		if (uri != NULL)
+        value = is_open((const gchar*)uri_list->data);
+
+
+
+		gedit_debug (DEBUG_FILE, "URI: %s", uri);
+		if (uri != NULL && value !=FALSE)
 		{
 			if (!gedit_utils_uri_has_file_scheme (uri) || 
 			     gedit_utils_uri_exists (uri))
@@ -1554,3 +1569,34 @@
 	return TRUE;
 }
 
+gboolean is_open(gchar* rec_uri)
+{
+        int i,lrec;
+	gchar *uri = NULL;
+	GeditMDIChild* child;
+        gboolean value=TRUE;
+
+        for ( lrec=7;lrec<=strlen(rec_uri);lrec++)
+        *(rec_uri-7+lrec)=*(rec_uri+lrec);
+	
+         
+
+	for (i = 0; i < g_list_length (bonobo_mdi_get_children (BONOBO_MDI (gedit_mdi))); i++)
+	{
+		child = GEDIT_MDI_CHILD (g_list_nth_data (
+				bonobo_mdi_get_children (BONOBO_MDI (gedit_mdi)), i));
+
+
+	uri = gedit_document_get_uri (child->document);
+         
+
+       if ( strcmp(uri,rec_uri)==0)
+      {
+           value=FALSE;
+      }
+        }
+		
+    return value;
+}
+
+
