Kaydet (Commit) dabfa0ce authored tarafından Pranav Kant's avatar Pranav Kant Kaydeden (comit) David Tardon

lokdocview: Set a 'default' path for LOK init

When passed NULL to lok_doc_view_new, use the default path :
$libdir/libreoffice/program as LOK install path

Change-Id: I1e033c407184b29b1509cfb8c416b514591d67ce
Reviewed-on: https://gerrit.libreoffice.org/20476Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
(cherry picked from commit 424c09b1)
üst e7cdd680
...@@ -42,7 +42,8 @@ GType lok_doc_view_get_type (void) G_GNUC ...@@ -42,7 +42,8 @@ GType lok_doc_view_get_type (void) G_GNUC
/** /**
* lok_doc_view_new: * lok_doc_view_new:
* @pPath: LibreOffice install path. * @pPath: (nullable): LibreOffice install path. Pass null to set it to default
* path which in most cases would be $libdir/libreoffice/program
* @cancellable: The cancellable object that you can use to cancel this * @cancellable: The cancellable object that you can use to cancel this
* operation. * operation.
* @error: The error that will be set if the object fails to initialize. * @error: The error that will be set if the object fails to initialize.
......
...@@ -28,6 +28,10 @@ $(eval $(call gb_Library_add_libs,libreofficekitgtk,\ ...@@ -28,6 +28,10 @@ $(eval $(call gb_Library_add_libs,libreofficekitgtk,\
$(GTK3_LIBS) \ $(GTK3_LIBS) \
)) ))
$(eval $(call gb_Library_add_defs,libreofficekitgtk,\
-DLOK_PATH="\"$(LIBDIR)/libreoffice/$(LIBO_LIB_FOLDER)\"" \
))
ifeq ($(OS),$(filter LINUX %BSD SOLARIS, $(OS))) ifeq ($(OS),$(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Library_add_libs,libreofficekitgtk,\ $(eval $(call gb_Library_add_libs,libreofficekitgtk,\
$(DLOPEN_LIBS) -lm \ $(DLOPEN_LIBS) -lm \
......
...@@ -2387,7 +2387,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) ...@@ -2387,7 +2387,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
SAL_DLLPUBLIC_EXPORT GtkWidget* SAL_DLLPUBLIC_EXPORT GtkWidget*
lok_doc_view_new (const gchar* pPath, GCancellable *cancellable, GError **error) lok_doc_view_new (const gchar* pPath, GCancellable *cancellable, GError **error)
{ {
return GTK_WIDGET (g_initable_new (LOK_TYPE_DOC_VIEW, cancellable, error, "lopath", pPath, NULL)); return GTK_WIDGET (g_initable_new (LOK_TYPE_DOC_VIEW, cancellable, error, "lopath", pPath == NULL ? LOK_PATH : pPath, NULL));
} }
SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new_from_widget(LOKDocView* pOldLOKDocView) SAL_DLLPUBLIC_EXPORT GtkWidget* lok_doc_view_new_from_widget(LOKDocView* pOldLOKDocView)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment