epiphany r8441 - branches/gnome-2-24/embed/mozilla



Author: diegoe
Date: Sat Aug 30 13:21:23 2008
New Revision: 8441
URL: http://svn.gnome.org/viewvc/epiphany?rev=8441&view=rev

Log:
Remove leading dots in suggested filename.

When saving files, remove the leading dots in the filename, presuming that
users could cluelessly save the files with a leading dot, closes: #430965.

Modified:
   branches/gnome-2-24/embed/mozilla/ContentHandler.cpp
   branches/gnome-2-24/embed/mozilla/EphyHeaderSniffer.cpp

Modified: branches/gnome-2-24/embed/mozilla/ContentHandler.cpp
==============================================================================
--- branches/gnome-2-24/embed/mozilla/ContentHandler.cpp	(original)
+++ branches/gnome-2-24/embed/mozilla/ContentHandler.cpp	Sat Aug 30 13:21:23 2008
@@ -165,7 +165,11 @@
 					CONF_STATE_SAVE_DIR,
 					EPHY_FILE_FILTER_ALL);
 	gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
-	gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), defaultFile.get());
+	/* Remove leading dots */
+	const char *fname = defaultFile.get();
+	while (*fname == '.') fname++;
+
+	gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), fname);
 
 	if (parentWindow)
 	{

Modified: branches/gnome-2-24/embed/mozilla/EphyHeaderSniffer.cpp
==============================================================================
--- branches/gnome-2-24/embed/mozilla/EphyHeaderSniffer.cpp	(original)
+++ branches/gnome-2-24/embed/mozilla/EphyHeaderSniffer.cpp	Sat Aug 30 13:21:23 2008
@@ -414,8 +414,12 @@
 						EPHY_FILE_FILTER_ALL_SUPPORTED);
 		gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
 
+		/* Remove leading dots */
+		char *fname = filename;
+		while (*fname == '.') fname++;
+
 		gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog),
-                                                   filename);
+                                                   fname);
 
 		g_signal_connect (dialog, "response",
 				  G_CALLBACK (filechooser_response_cb), this);



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