From 370a3f5cc9e39352a081e5d5dd8c43676547a6e6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 4 Oct 2012 11:45:44 +1000 Subject: code cleanup: add own includes to cpp files or make the functions static if they are not used elsewhere. (bzr r11735) --- src/inkscape.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 8548b398f..b1cc53b4e 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -1065,7 +1065,7 @@ inkscape_find_desktop_by_dkey (unsigned int dkey) -unsigned int +static unsigned int inkscape_maximum_dkey() { unsigned int dkey = 0; @@ -1081,7 +1081,7 @@ inkscape_maximum_dkey() -SPDesktop * +static SPDesktop * inkscape_next_desktop () { SPDesktop *d = NULL; @@ -1112,7 +1112,7 @@ inkscape_next_desktop () -SPDesktop * +static SPDesktop * inkscape_prev_desktop () { SPDesktop *d = NULL; -- cgit v1.2.3 From 900d1a05ba36f84df3a51188b938a6551a5201d2 Mon Sep 17 00:00:00 2001 From: John Smith Date: Mon, 8 Oct 2012 21:00:57 +0900 Subject: Fix for 490338 : Try to create the autosave directory if that does not exists (bzr r11759) --- src/inkscape.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index b1cc53b4e..0a94d0742 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -309,8 +309,24 @@ static gint inkscape_autosave(gpointer) GDir *autosave_dir_ptr = g_dir_open(autosave_dir.c_str(), 0, NULL); if( !autosave_dir_ptr ){ - g_warning("Cannot open autosave directory!"); - return TRUE; + // Try to create the autosave directory if it doesn't exist + if (g_mkdir(autosave_dir.c_str(), 0755)) { + // the creation failed + Glib::ustring msg = Glib::ustring::format( + _("Autosave failed! Cannot create directory "), Glib::filename_to_utf8(autosave_dir)); + g_warning("%s", msg.c_str()); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, msg.c_str()); + return TRUE; + } + // Try to read dir again + autosave_dir_ptr = g_dir_open(autosave_dir.c_str(), 0, NULL); + if( !autosave_dir_ptr ){ + Glib::ustring msg = Glib::ustring::format( + _("Autosave failed! Cannot open directory "), Glib::filename_to_utf8(autosave_dir)); + g_warning("%s", msg.c_str()); + SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, msg.c_str()); + return TRUE; + } } time_t sptime = time(NULL); -- cgit v1.2.3 From fab4c86f1347c48c3e87d645343faf0b167ea635 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Tue, 9 Oct 2012 21:26:18 +0200 Subject: Fix translation issue of rev 11759. (bzr r11772) --- src/inkscape.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 0a94d0742..fc9a9783f 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -312,8 +312,8 @@ static gint inkscape_autosave(gpointer) // Try to create the autosave directory if it doesn't exist if (g_mkdir(autosave_dir.c_str(), 0755)) { // the creation failed - Glib::ustring msg = Glib::ustring::format( - _("Autosave failed! Cannot create directory "), Glib::filename_to_utf8(autosave_dir)); + Glib::ustring msg = Glib::ustring::compose( + _("Autosave failed! Cannot create directory %1."), Glib::filename_to_utf8(autosave_dir)); g_warning("%s", msg.c_str()); SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, msg.c_str()); return TRUE; @@ -321,8 +321,8 @@ static gint inkscape_autosave(gpointer) // Try to read dir again autosave_dir_ptr = g_dir_open(autosave_dir.c_str(), 0, NULL); if( !autosave_dir_ptr ){ - Glib::ustring msg = Glib::ustring::format( - _("Autosave failed! Cannot open directory "), Glib::filename_to_utf8(autosave_dir)); + Glib::ustring msg = Glib::ustring::compose( + _("Autosave failed! Cannot open directory %1."), Glib::filename_to_utf8(autosave_dir)); g_warning("%s", msg.c_str()); SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, msg.c_str()); return TRUE; -- cgit v1.2.3 From 32598fdd4d1e85228e46242d37f83c739591a078 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 29 Nov 2012 09:37:30 +0900 Subject: Fix for 1073128 : Command line PNG export fails if FeFlood filter primitive is present (bzr r11913) --- src/inkscape.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index fc9a9783f..fc823f8b7 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -1270,6 +1270,10 @@ inkscape_active_document (void) { if (SP_ACTIVE_DESKTOP) { return sp_desktop_document (SP_ACTIVE_DESKTOP); + } else if (!inkscape->document_set.empty()) { + // If called from the command line there will be no desktop + // So 'fall back' to take the first listed document in the Inkscape instance + return inkscape->document_set.begin()->first; } return NULL; -- cgit v1.2.3