Rename private to priv

Avoid to name variables after a C++ keyword.
This commit is contained in:
Sebastian Ramacher 2022-05-14 00:20:44 +02:00
parent 36065d3bf3
commit 72f3ce1d62

View file

@ -10,7 +10,7 @@
#include <girara/utils.h>
typedef struct private_s {
typedef struct {
char* file_path;
} ZathuraFileMonitorPrivate;
@ -24,11 +24,11 @@ enum {
static void
finalize(GObject* object)
{
ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object);
ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor);
ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object);
ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor);
if (private->file_path != NULL) {
g_free(private->file_path);
if (priv->file_path != NULL) {
g_free(priv->file_path);
}
G_OBJECT_CLASS(zathura_filemonitor_parent_class)->finalize(object);
@ -37,15 +37,15 @@ finalize(GObject* object)
static void
set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
{
ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object);
ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor);
ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object);
ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor);
switch (prop_id) {
case PROP_FILE_PATH:
if (private->file_path != NULL) {
g_free(private->file_path);
if (priv->file_path != NULL) {
g_free(priv->file_path);
}
private->file_path = g_value_dup_string(value);
priv->file_path = g_value_dup_string(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
@ -55,12 +55,12 @@ set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* ps
static void
get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
{
ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object);
ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor);
ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object);
ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor);
switch (prop_id) {
case PROP_FILE_PATH:
g_value_set_string(value, private->file_path);
g_value_set_string(value, priv->file_path);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
@ -94,14 +94,14 @@ zathura_filemonitor_class_init(ZathuraFileMonitorClass* class)
static void
zathura_filemonitor_init(ZathuraFileMonitor* file_monitor)
{
ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor);
private->file_path = NULL;
ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor);
priv->file_path = NULL;
}
const char* zathura_filemonitor_get_filepath(ZathuraFileMonitor* file_monitor)
{
ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor);
return private->file_path;
ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor);
return priv->file_path;
}
void zathura_filemonitor_start(ZathuraFileMonitor* file_monitor)