Port rpmostreed-transaction-livefs to C++

Prep for using https://cxx.rs/
This commit is contained in:
Colin Walters 2020-12-19 18:15:56 +00:00 committed by OpenShift Merge Robot
parent aeb3dc2c07
commit 1ec8a341f8
2 changed files with 6 additions and 10 deletions

View File

@ -43,7 +43,7 @@ librpmostreed_sources = \
src/daemon/rpmostreed-transaction.cxx \ src/daemon/rpmostreed-transaction.cxx \
src/daemon/rpmostreed-transaction-types.h \ src/daemon/rpmostreed-transaction-types.h \
src/daemon/rpmostreed-transaction-types.cxx \ src/daemon/rpmostreed-transaction-types.cxx \
src/daemon/rpmostreed-transaction-livefs.c \ src/daemon/rpmostreed-transaction-livefs.cxx \
src/daemon/rpmostree-package-variants.h \ src/daemon/rpmostree-package-variants.h \
src/daemon/rpmostree-package-variants.c \ src/daemon/rpmostree-package-variants.c \
src/daemon/rpmostreed-os.h \ src/daemon/rpmostreed-os.h \

View File

@ -86,14 +86,14 @@ livefs_transaction_execute (RpmostreedTransaction *transaction,
} }
static void static void
livefs_transaction_class_init (LiveFsTransactionClass *class) livefs_transaction_class_init (LiveFsTransactionClass *clazz)
{ {
GObjectClass *object_class; GObjectClass *object_class;
object_class = G_OBJECT_CLASS (class); object_class = G_OBJECT_CLASS (clazz);
object_class->finalize = livefs_transaction_finalize; object_class->finalize = livefs_transaction_finalize;
class->execute = livefs_transaction_execute; clazz->execute = livefs_transaction_execute;
} }
static void static void
@ -108,21 +108,17 @@ rpmostreed_transaction_new_livefs (GDBusMethodInvocation *invocation,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
LiveFsTransaction *self;
g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL); g_return_val_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation), NULL);
g_return_val_if_fail (OSTREE_IS_SYSROOT (sysroot), NULL); g_return_val_if_fail (OSTREE_IS_SYSROOT (sysroot), NULL);
self = g_initable_new (livefs_transaction_get_type (), auto self = (LiveFsTransaction *)g_initable_new (livefs_transaction_get_type (),
cancellable, error, cancellable, error,
"invocation", invocation, "invocation", invocation,
"sysroot-path", gs_file_get_path_cached (ostree_sysroot_get_path (sysroot)), "sysroot-path", gs_file_get_path_cached (ostree_sysroot_get_path (sysroot)),
NULL); NULL);
if (self != NULL) if (self != NULL)
{ self->options = g_variant_ref (options);
self->options = g_variant_ref (options);
}
return (RpmostreedTransaction *) self; return (RpmostreedTransaction *) self;
} }