lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
ec0d344
To: vim_dev@googlegroups.com
ec0d344
Subject: Patch 7.3.506
ec0d344
Fcc: outbox
ec0d344
From: Bram Moolenaar <Bram@moolenaar.net>
ec0d344
Mime-Version: 1.0
ec0d344
Content-Type: text/plain; charset=UTF-8
ec0d344
Content-Transfer-Encoding: 8bit
ec0d344
------------
ec0d344
ec0d344
Patch 7.3.506
ec0d344
Problem:    GTK gives an error when selecting a non-existent file.
ec0d344
Solution:   Add a handler to avoid the error. (Christian Brabandt)
ec0d344
Files:	    src/gui_gtk.c
ec0d344
ec0d344
ec0d344
*** ../vim-7.3.505/src/gui_gtk.c	2011-06-26 04:48:56.000000000 +0200
ec0d344
--- src/gui_gtk.c	2012-04-25 17:08:58.000000000 +0200
ec0d344
***************
ec0d344
*** 90,95 ****
ec0d344
--- 90,100 ----
ec0d344
  static void entry_activate_cb(GtkWidget *widget, gpointer data);
ec0d344
  static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog);
ec0d344
  static void find_replace_cb(GtkWidget *widget, gpointer data);
ec0d344
+ static void recent_func_log_func(
ec0d344
+ 	const gchar *log_domain,
ec0d344
+ 	GLogLevelFlags log_level,
ec0d344
+ 	const gchar *message,
ec0d344
+ 	gpointer user_data);
ec0d344
  
ec0d344
  #if defined(FEAT_TOOLBAR)
ec0d344
  /*
ec0d344
***************
ec0d344
*** 839,844 ****
ec0d344
--- 844,851 ----
ec0d344
      GtkWidget		*fc;
ec0d344
  #endif
ec0d344
      char_u		dirbuf[MAXPATHL];
ec0d344
+     guint		log_handler;
ec0d344
+     const gchar		*domain = "Gtk";
ec0d344
  
ec0d344
      title = CONVERT_TO_UTF8(title);
ec0d344
  
ec0d344
***************
ec0d344
*** 853,858 ****
ec0d344
--- 860,870 ----
ec0d344
      /* If our pointer is currently hidden, then we should show it. */
ec0d344
      gui_mch_mousehide(FALSE);
ec0d344
  
ec0d344
+     /* Hack: The GTK file dialog warns when it can't access a new file, this
ec0d344
+      * makes it shut up. http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
ec0d344
+     log_handler = g_log_set_handler(domain, G_LOG_LEVEL_WARNING,
ec0d344
+ 						  recent_func_log_func, NULL);
ec0d344
+ 
ec0d344
  #ifdef USE_FILE_CHOOSER
ec0d344
      /* We create the dialog each time, so that the button text can be "Open"
ec0d344
       * or "Save" according to the action. */
ec0d344
***************
ec0d344
*** 916,921 ****
ec0d344
--- 928,934 ----
ec0d344
      gtk_widget_show(gui.filedlg);
ec0d344
      gtk_main();
ec0d344
  #endif
ec0d344
+     g_log_remove_handler(domain, log_handler);
ec0d344
  
ec0d344
      CONVERT_TO_UTF8_FREE(title);
ec0d344
      if (gui.browse_fname == NULL)
ec0d344
***************
ec0d344
*** 1882,1884 ****
ec0d344
--- 1895,1908 ----
ec0d344
       * backwards compatibility anyway. */
ec0d344
      do_cmdline_cmd((char_u *)"emenu ToolBar.FindHelp");
ec0d344
  }
ec0d344
+ 
ec0d344
+     static void
ec0d344
+ recent_func_log_func(const gchar *log_domain UNUSED,
ec0d344
+ 		     GLogLevelFlags log_level UNUSED,
ec0d344
+ 		     const gchar *message UNUSED,
ec0d344
+ 		     gpointer user_data UNUSED)
ec0d344
+ {
ec0d344
+     /* We just want to suppress the warnings. */
ec0d344
+     /* http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
ec0d344
+ }
ec0d344
+ 
ec0d344
*** ../vim-7.3.505/src/version.c	2012-04-25 16:50:44.000000000 +0200
ec0d344
--- src/version.c	2012-04-25 17:08:28.000000000 +0200
ec0d344
***************
ec0d344
*** 716,717 ****
ec0d344
--- 716,719 ----
ec0d344
  {   /* Add new patch number below this line */
ec0d344
+ /**/
ec0d344
+     506,
ec0d344
  /**/
ec0d344
ec0d344
-- 
ec0d344
Compilation process failed successfully.
ec0d344
ec0d344
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
ec0d344
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
ec0d344
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
ec0d344
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///