From a2aaf911e2e7b63af920186acb2a5e03bc58bd54 Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Thu, 18 Jun 2015 21:52:22 +0530 Subject: lokdocview: Use GInitable The construction of LokDocView widget can fail because it involves initializing the lok context via lok_init. Having lok_init calls in constructed virtual method is a bad idea since it assumes that construction will never fail. So, implement GInitable for this class, and move the object initialization from constructed to initable. Change-Id: Idf18a054cf8ef2e946392458ec52cb0107bd7454 --- include/LibreOfficeKit/LibreOfficeKitGtk.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/LibreOfficeKit') diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h index 7048dbefc0a1..3eaf28352a11 100644 --- a/include/LibreOfficeKit/LibreOfficeKitGtk.h +++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h @@ -42,10 +42,12 @@ struct _LOKDocViewClass GType lok_doc_view_get_type (void) G_GNUC_CONST; -GtkWidget* lok_doc_view_new (const char* pPath); +GtkWidget* lok_doc_view_new (const gchar* pPath, + GCancellable *cancellable, + GError **error); gboolean lok_doc_view_open_document (LOKDocView* pDocView, - char* pPath); + const gchar* pPath); /// Gets the document the viewer displays. LibreOfficeKitDocument* lok_doc_view_get_document (LOKDocView* pDocView); -- cgit