bakery r131 - in trunk: . bakery/App
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: bakery r131 - in trunk: . bakery/App
- Date: Mon, 19 Jan 2009 11:14:21 +0000 (UTC)
Author: jhs
Date: Mon Jan 19 11:14:21 2009
New Revision: 131
URL: http://svn.gnome.org/viewvc/bakery?rev=131&view=rev
Log:
2009-01-19 Johannes Schmid <jschmid openismus com>
* bakery/App/App_WithDoc_Gtk.cc:
* bakery/App/App_WithDoc_Gtk.h:
Allow to add recent data for non-existing uris without
causing a Gtk-Critical from Gtk::RecentManager. Adds
virtual void document_history_add(const Glib::ustring& file_uri,
Gtk::RecentManager::Data& data);
Modified:
trunk/ChangeLog
trunk/bakery/App/App_WithDoc_Gtk.cc
trunk/bakery/App/App_WithDoc_Gtk.h
Modified: trunk/bakery/App/App_WithDoc_Gtk.cc
==============================================================================
--- trunk/bakery/App/App_WithDoc_Gtk.cc (original)
+++ trunk/bakery/App/App_WithDoc_Gtk.cc Mon Jan 19 11:14:21 2009
@@ -283,6 +283,27 @@
#endif // GTKMM_GEQ_2_10
}
+void App_WithDoc_Gtk::document_history_add(const Glib::ustring& file_uri,
+ Gtk::RecentManager::Data& data)
+{
+#ifdef GTKMM_GEQ_2_10
+ if(!file_uri.empty())
+ {
+ //TODO: Wrap gnome_vfs_escape_path_string() in gnome-vfsmm.
+ //Glib::ustring filename_e = Gnome::Vfs::escape_path_string(file_uri);
+ Glib::ustring uri = file_uri; // "file://" + filename_e;
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Gtk::RecentManager::get_default()->add_item(uri, data);
+#else
+ std::auto_ptr<Glib::Error> error;
+ Gtk::RecentManager::get_default()->add_item(uri, data, error);
+ // Ignore error
+#endif
+ }
+#endif // GTKMM_GEQ_2_10
+}
+
void App_WithDoc_Gtk::document_history_remove(const Glib::ustring& file_uri)
{
#ifdef GTKMM_GEQ_2_10
Modified: trunk/bakery/App/App_WithDoc_Gtk.h
==============================================================================
--- trunk/bakery/App/App_WithDoc_Gtk.h (original)
+++ trunk/bakery/App/App_WithDoc_Gtk.h Mon Jan 19 11:14:21 2009
@@ -23,6 +23,7 @@
#include <bakery/App/App_Gtk.h>
#include <bakery/Document/Document.h>
#include <gtkmm/toolbutton.h>
+#include <gtkmm/recentmanager.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" {
@@ -68,6 +69,8 @@
virtual void init_toolbars(); //overridden to add open/save
virtual void document_history_add(const Glib::ustring& file_uri); //overridden.
+ virtual void document_history_add(const Glib::ustring& file_uri,
+ Gtk::RecentManager::Data& data);
virtual void document_history_remove(const Glib::ustring& file_uri); //overridden.
virtual void update_window_title();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]