From f916c87968729b7c5065c94730dbb499e8510042 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sun, 6 May 2012 22:21:02 +0100 Subject: Fix missing glib headers in imageicon (bzr r11341) --- src/ui/widget/imageicon.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui/widget/imageicon.cpp') diff --git a/src/ui/widget/imageicon.cpp b/src/ui/widget/imageicon.cpp index 77015bdd2..567608ef8 100644 --- a/src/ui/widget/imageicon.cpp +++ b/src/ui/widget/imageicon.cpp @@ -19,6 +19,8 @@ #include "svg-view-widget.h" #include "document.h" #include "inkscape.h" +#include +#include namespace Inkscape -- cgit v1.2.3 From 8ee9827502fadcae0b02fec434799e94ee115357 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Tue, 25 Dec 2012 22:50:08 +0000 Subject: Convert a load more C-style pointer casts to GObject or C++ casts (merry christmas\!) (bzr r11986) --- src/ui/widget/imageicon.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ui/widget/imageicon.cpp') diff --git a/src/ui/widget/imageicon.cpp b/src/ui/widget/imageicon.cpp index 567608ef8..1c36dc36e 100644 --- a/src/ui/widget/imageicon.cpp +++ b/src/ui/widget/imageicon.cpp @@ -117,7 +117,7 @@ bool ImageIcon::showSvgDocument(const SPDocument *docArg) viewerGtkmm->show(); pack_start(*viewerGtkmm, TRUE, TRUE, 0); - //GtkWidget *vbox = (GtkWidget *)gobj(); + //GtkWidget *vbox = GTK_WIDGET(gobj()); //gtk_box_pack_start(GTK_BOX(vbox), viewerGtk, TRUE, TRUE, 0); return true; @@ -306,7 +306,7 @@ void ImageIcon::showBrokenImage(const Glib::ustring &errorMessage) ""; //Fill in the template - char *cErrorMessage = (char *)errorMessage.c_str(); + char *cErrorMessage = const_cast(errorMessage.c_str()); gchar *xmlBuffer = g_strdup_printf(xformat, cErrorMessage); //g_message("%s\n", xmlBuffer); @@ -375,7 +375,7 @@ bool ImageIcon::show(const Glib::ustring &fileName) if (!Glib::file_test(fileName, Glib::FILE_TEST_EXISTS)) return false; - gchar *fName = (gchar *)fileName.c_str(); + gchar *fName = const_cast(fileName.c_str()); //g_message("fname:%s\n", fName); -- cgit v1.2.3 From 3c213cec8c2aab1a53d0d5cb9d87659b584ac876 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Wed, 3 Apr 2013 22:47:48 +0200 Subject: Checking file presence before calling lstat (should fix Bug #785701 Inkscape freezes at opening) (bzr r12263) --- src/ui/widget/imageicon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/widget/imageicon.cpp') diff --git a/src/ui/widget/imageicon.cpp b/src/ui/widget/imageicon.cpp index 1c36dc36e..cf41a16a4 100644 --- a/src/ui/widget/imageicon.cpp +++ b/src/ui/widget/imageicon.cpp @@ -382,7 +382,7 @@ bool ImageIcon::show(const Glib::ustring &fileName) if (Glib::file_test(fileName, Glib::FILE_TEST_IS_REGULAR)) { struct stat info; - if (stat(fName, &info)) + if (g_file_test (fName, G_FILE_TEST_EXISTS) && stat(fName, &info)) { Glib::ustring err = "cannot get file info"; showBrokenImage(err); -- cgit v1.2.3