*
* 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 <config.h>
#include "ev-window-title.h"
#include "ev-backends-manager.h"
+#include "ev-utils.h"
#include <string.h>
#include <gio/gio.h>
static char *
get_filename_from_uri (const char *uri)
{
- GFile *file;
char *filename;
+ char *basename;
- file = g_file_new_for_uri (uri);
- filename = g_file_get_basename (file);
- g_object_unref (file);
+ filename = g_uri_unescape_string (uri, NULL);
+ basename = g_path_get_basename (filename);
+ g_free(filename);
- return filename;
+ return basename;
}
/* Some docs report titles with confusing extensions (ex. .doc for pdf).
{
GtkWindow *window = GTK_WINDOW (window_title->window);
char *title = NULL, *password_title, *p;
- EvPageCache *page_cache;
if (window_title->document != NULL) {
- char *doc_title;
+ gchar *doc_title;
- page_cache = ev_page_cache_get (window_title->document);
- g_return_if_fail (page_cache != NULL);
- doc_title = (char *)ev_page_cache_get_title (page_cache);
+ doc_title = g_strdup (ev_document_get_title (window_title->document));
/* Make sure we get a valid title back */
if (doc_title != NULL) {
g_utf8_validate (doc_title, -1, NULL)) {
title = g_strdup (doc_title);
}
+
+ g_free (doc_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;