diff options
author | Diego Escalante Urrelo <diegoe@src.gnome.org> | 2008-08-30 21:21:23 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <diegoe@src.gnome.org> | 2008-08-30 21:21:23 +0800 |
commit | 2a3829e09c0c7d46fffadfab6eb74068bf14e311 (patch) | |
tree | 66be841b19bf3c5af916e6717db3fc856a1dc73e | |
parent | e8fc293fa2dc70173c06e3adca9e685c43096cda (diff) | |
download | gsoc2013-epiphany-2a3829e09c0c7d46fffadfab6eb74068bf14e311.tar gsoc2013-epiphany-2a3829e09c0c7d46fffadfab6eb74068bf14e311.tar.gz gsoc2013-epiphany-2a3829e09c0c7d46fffadfab6eb74068bf14e311.tar.bz2 gsoc2013-epiphany-2a3829e09c0c7d46fffadfab6eb74068bf14e311.tar.lz gsoc2013-epiphany-2a3829e09c0c7d46fffadfab6eb74068bf14e311.tar.xz gsoc2013-epiphany-2a3829e09c0c7d46fffadfab6eb74068bf14e311.tar.zst gsoc2013-epiphany-2a3829e09c0c7d46fffadfab6eb74068bf14e311.zip |
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.
svn path=/branches/gnome-2-24/; revision=8441
-rw-r--r-- | embed/mozilla/ContentHandler.cpp | 6 | ||||
-rw-r--r-- | embed/mozilla/EphyHeaderSniffer.cpp | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp index 11d33c877..6601f070b 100644 --- a/embed/mozilla/ContentHandler.cpp +++ b/embed/mozilla/ContentHandler.cpp @@ -165,7 +165,11 @@ NS_IMETHODIMP GContentHandler::PromptForSaveToFile( 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) { diff --git a/embed/mozilla/EphyHeaderSniffer.cpp b/embed/mozilla/EphyHeaderSniffer.cpp index 4b2f30424..c9fb91aa7 100644 --- a/embed/mozilla/EphyHeaderSniffer.cpp +++ b/embed/mozilla/EphyHeaderSniffer.cpp @@ -414,8 +414,12 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI) 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); |