本文整理汇总了C++中EvDocumentClass::load_gfile方法的典型用法代码示例。如果您正苦于以下问题:C++ EvDocumentClass::load_gfile方法的具体用法?C++ EvDocumentClass::load_gfile怎么用?C++ EvDocumentClass::load_gfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvDocumentClass
的用法示例。
在下文中一共展示了EvDocumentClass::load_gfile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
* ev_document_load_gfile:
* @document: a #EvDocument
* @file: a #GFile
* @flags: flags from #EvDocumentLoadFlags
* @cancellable: (allow-none): a #GCancellable, or %NULL
* @error: (allow-none): a #GError location to store an error, or %NULL
*
* Synchronously loads the document from @file.
* See ev_document_load() for more information.
*
* Returns: %TRUE if loading succeeded, or %FALSE on error with @error filled in
*
* Since: 3.6
*/
gboolean
ev_document_load_gfile (EvDocument *document,
GFile *file,
EvDocumentLoadFlags flags,
GCancellable *cancellable,
GError **error)
{
EvDocumentClass *klass;
EvDocumentPrivate *priv;
g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
klass = EV_DOCUMENT_GET_CLASS (document);
if (!klass->load_gfile) {
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"Backend does not support loading from GFile");
return FALSE;
}
if (!klass->load_gfile (document, file, flags, cancellable, error))
return FALSE;
ev_document_setup_cache (document);
priv = document->priv;
priv->uri = g_file_get_uri (file);
priv->info = _ev_document_get_info (document);
return TRUE;
}