X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-window-title.c;h=94dd33315f666c2c718c98618e76ec9cfab44db5;hb=69aaec8ae6f35af108718e904674e07589ebf302;hp=ca2429b5656b6edb563e74dde5a80d2d9957c9ca;hpb=2e7269db15755aad71ea5df8abb82c778dca6500;p=evince.git diff --git a/shell/ev-window-title.c b/shell/ev-window-title.c index ca2429b5..94dd3331 100644 --- a/shell/ev-window-title.c +++ b/shell/ev-window-title.c @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include @@ -83,7 +83,7 @@ get_filename_from_uri (const char *uri) } /* Some docs report titles with confusing extensions (ex. .doc for pdf). - Let's show the filename in this case */ + Erase the confusing extension of the title */ static void ev_window_title_sanitize_title (EvWindowTitle *window_title, char **title) { const gchar *backend; @@ -97,7 +97,7 @@ ev_window_title_sanitize_title (EvWindowTitle *window_title, char **title) { char *new_title; char *filename = get_filename_from_uri (window_title->uri); - new_title = g_strdup_printf ("%s (%s)", *title, filename); + new_title = g_strndup (*title, strlen(*title) - strlen(bad_extensions[i].text)); g_free (*title); *title = new_title; @@ -142,7 +142,15 @@ ev_window_title_update (EvWindowTitle *window_title) } if (title && window_title->uri) { + char *tmp_title; + char *filename = get_filename_from_uri (window_title->uri); + ev_window_title_sanitize_title (window_title, &title); + tmp_title = g_strdup_printf ("%s — %s", filename, title); + g_free (title); + g_free (filename); + + title = tmp_title; } else if (window_title->uri) { title = get_filename_from_uri (window_title->uri); } else if (!title) { @@ -159,7 +167,7 @@ ev_window_title_update (EvWindowTitle *window_title) gtk_window_set_title (window, title); break; case EV_WINDOW_TITLE_PASSWORD: - password_title = g_strdup_printf (_("%s - Password Required"), title); + password_title = g_strdup_printf (_("%s — Password Required"), title); gtk_window_set_title (window, password_title); g_free (password_title); break;