Skip to content
Permalink
Browse files

Avoid compile warning for g_type_class_add_private

- capplet/gsm-app-dialog.c
- capplet/gsm-app-dialog.h
- capplet/gsm-properties-dialog.c
- capplet/gsm-properties-dialog.h
- capplet/gsp-app-manager.c
- capplet/gsp-app-manager.h
- capplet/gsp-app.c
- capplet/gsp-app.h
- mate-session/gsm-app.c
- mate-session/gsm-app.h
- mate-session/gsm-autostart-app.c
- mate-session/gsm-autostart-app.h
- mate-session/gsm-client.c
- mate-session/gsm-client.h
- mate-session/gsm-consolekit.c
- mate-session/gsm-consolekit.h
- mate-session/gsm-dbus-client.c
- mate-session/gsm-dbus-client.h
- mate-session/gsm-inhibit-dialog.c
- mate-session/gsm-inhibit-dialog.h
- mate-session/gsm-inhibitor.c
- mate-session/gsm-inhibitor.h
- mate-session/gsm-logout-dialog.c
- mate-session/gsm-logout-dialog.h
- mate-session/gsm-store.c
- mate-session/gsm-store.h
- mate-session/gsm-systemd.c
- mate-session/gsm-systemd.h
- mate-session/gsm-xsmp-client.c
- mate-session/gsm-xsmp-client.h
- mate-session/gsm-xsmp-server.c
- mate-session/gsm-xsmp-server.h
  • Loading branch information...
yetist authored and raveit65 committed Nov 19, 2018
1 parent bdec713 commit 6b7875b9714d5872f80b6b4012f24fb8f548aca2
@@ -35,16 +35,15 @@
#define CAPPLET_COMMENT_ENTRY_WIDGET_NAME "session_properties_comment_entry"
#define CAPPLET_BROWSE_WIDGET_NAME "session_properties_browse_button"

#define GSM_APP_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_APP_DIALOG, GsmAppDialogPrivate))

#ifdef __GNUC__
#define UNUSED_VARIABLE __attribute__ ((unused))
#else
#define UNUSED_VARIABLE
#endif

struct GsmAppDialogPrivate
struct _GsmAppDialog
{
GtkDialog parent;
GtkWidget *name_entry;
GtkWidget *command_entry;
GtkWidget *comment_entry;
@@ -56,7 +55,6 @@ struct GsmAppDialogPrivate

static void gsm_app_dialog_class_init (GsmAppDialogClass *klass);
static void gsm_app_dialog_init (GsmAppDialog *app_dialog);
static void gsm_app_dialog_finalize (GObject *object);

enum {
PROP_0,
@@ -138,7 +136,7 @@ on_browse_button_clicked (GtkWidget *widget,

g_free (text);

gtk_entry_set_text (GTK_ENTRY (dialog->priv->command_entry), uri);
gtk_entry_set_text (GTK_ENTRY (dialog->command_entry), uri);

g_free (uri);
}
@@ -191,9 +189,9 @@ setup_dialog (GsmAppDialog *dialog)
gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-cancel", GTK_RESPONSE_CANCEL);

if (dialog->priv->name == NULL
&& dialog->priv->command == NULL
&& dialog->priv->comment == NULL) {
if (dialog->name == NULL
&& dialog->command == NULL
&& dialog->comment == NULL) {
gtk_window_set_title (GTK_WINDOW (dialog), _("Add Startup Program"));
gtk_dialog_add_button (GTK_DIALOG (dialog),
"gtk-add", GTK_RESPONSE_OK);
@@ -203,37 +201,37 @@ setup_dialog (GsmAppDialog *dialog)
"gtk-save", GTK_RESPONSE_OK);
}

dialog->priv->name_entry = GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_NAME_ENTRY_WIDGET_NAME));
g_signal_connect (dialog->priv->name_entry,
dialog->name_entry = GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_NAME_ENTRY_WIDGET_NAME));
g_signal_connect (dialog->name_entry,
"activate",
G_CALLBACK (on_entry_activate),
dialog);
if (dialog->priv->name != NULL) {
gtk_entry_set_text (GTK_ENTRY (dialog->priv->name_entry), dialog->priv->name);
if (dialog->name != NULL) {
gtk_entry_set_text (GTK_ENTRY (dialog->name_entry), dialog->name);
}

dialog->priv->browse_button = GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_BROWSE_WIDGET_NAME));
g_signal_connect (dialog->priv->browse_button,
dialog->browse_button = GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_BROWSE_WIDGET_NAME));
g_signal_connect (dialog->browse_button,
"clicked",
G_CALLBACK (on_browse_button_clicked),
dialog);

dialog->priv->command_entry = GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_COMMAND_ENTRY_WIDGET_NAME));
g_signal_connect (dialog->priv->command_entry,
dialog->command_entry = GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_COMMAND_ENTRY_WIDGET_NAME));
g_signal_connect (dialog->command_entry,
"activate",
G_CALLBACK (on_entry_activate),
dialog);
if (dialog->priv->command != NULL) {
gtk_entry_set_text (GTK_ENTRY (dialog->priv->command_entry), dialog->priv->command);
if (dialog->command != NULL) {
gtk_entry_set_text (GTK_ENTRY (dialog->command_entry), dialog->command);
}

dialog->priv->comment_entry = GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_COMMENT_ENTRY_WIDGET_NAME));
g_signal_connect (dialog->priv->comment_entry,
dialog->comment_entry = GTK_WIDGET (gtk_builder_get_object (xml, CAPPLET_COMMENT_ENTRY_WIDGET_NAME));
g_signal_connect (dialog->comment_entry,
"activate",
G_CALLBACK (on_entry_activate),
dialog);
if (dialog->priv->comment != NULL) {
gtk_entry_set_text (GTK_ENTRY (dialog->priv->comment_entry), dialog->priv->comment);
if (dialog->comment != NULL) {
gtk_entry_set_text (GTK_ENTRY (dialog->comment_entry), dialog->comment);
}

if (xml != NULL) {
@@ -249,8 +247,8 @@ gsm_app_dialog_constructor (GType type,
GsmAppDialog *dialog;

dialog = GSM_APP_DIALOG (G_OBJECT_CLASS (gsm_app_dialog_parent_class)->constructor (type,
n_construct_app,
construct_app));
n_construct_app,
construct_app));

setup_dialog (dialog);

@@ -267,12 +265,12 @@ gsm_app_dialog_dispose (GObject *object)

dialog = GSM_APP_DIALOG (object);

g_free (dialog->priv->name);
dialog->priv->name = NULL;
g_free (dialog->priv->command);
dialog->priv->command = NULL;
g_free (dialog->priv->comment);
dialog->priv->comment = NULL;
g_free (dialog->name);
dialog->name = NULL;
g_free (dialog->command);
dialog->command = NULL;
g_free (dialog->comment);
dialog->comment = NULL;

G_OBJECT_CLASS (gsm_app_dialog_parent_class)->dispose (object);
}
@@ -283,9 +281,9 @@ gsm_app_dialog_set_name (GsmAppDialog *dialog,
{
g_return_if_fail (GSM_IS_APP_DIALOG (dialog));

g_free (dialog->priv->name);
g_free (dialog->name);

dialog->priv->name = g_strdup (name);
dialog->name = g_strdup (name);
g_object_notify (G_OBJECT (dialog), "name");
}

@@ -295,9 +293,9 @@ gsm_app_dialog_set_command (GsmAppDialog *dialog,
{
g_return_if_fail (GSM_IS_APP_DIALOG (dialog));

g_free (dialog->priv->command);
g_free (dialog->command);

dialog->priv->command = g_strdup (name);
dialog->command = g_strdup (name);
g_object_notify (G_OBJECT (dialog), "command");
}

@@ -307,31 +305,31 @@ gsm_app_dialog_set_comment (GsmAppDialog *dialog,
{
g_return_if_fail (GSM_IS_APP_DIALOG (dialog));

g_free (dialog->priv->comment);
g_free (dialog->comment);

dialog->priv->comment = g_strdup (name);
dialog->comment = g_strdup (name);
g_object_notify (G_OBJECT (dialog), "comment");
}

const char *
gsm_app_dialog_get_name (GsmAppDialog *dialog)
{
g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), NULL);
return gtk_entry_get_text (GTK_ENTRY (dialog->priv->name_entry));
return gtk_entry_get_text (GTK_ENTRY (dialog->name_entry));
}

const char *
gsm_app_dialog_get_command (GsmAppDialog *dialog)
{
g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), NULL);
return gtk_entry_get_text (GTK_ENTRY (dialog->priv->command_entry));
return gtk_entry_get_text (GTK_ENTRY (dialog->command_entry));
}

const char *
gsm_app_dialog_get_comment (GsmAppDialog *dialog)
{
g_return_val_if_fail (GSM_IS_APP_DIALOG (dialog), NULL);
return gtk_entry_get_text (GTK_ENTRY (dialog->priv->comment_entry));
return gtk_entry_get_text (GTK_ENTRY (dialog->comment_entry));
}

static void
@@ -368,13 +366,13 @@ gsm_app_dialog_get_property (GObject *object,

switch (prop_id) {
case PROP_NAME:
g_value_set_string (value, dialog->priv->name);
g_value_set_string (value, dialog->name);
break;
case PROP_COMMAND:
g_value_set_string (value, dialog->priv->command);
g_value_set_string (value, dialog->command);
break;
case PROP_COMMENT:
g_value_set_string (value, dialog->priv->comment);
g_value_set_string (value, dialog->comment);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -391,7 +389,6 @@ gsm_app_dialog_class_init (GsmAppDialogClass *klass)
object_class->set_property = gsm_app_dialog_set_property;
object_class->constructor = gsm_app_dialog_constructor;
object_class->dispose = gsm_app_dialog_dispose;
object_class->finalize = gsm_app_dialog_finalize;

g_object_class_install_property (object_class,
PROP_NAME,
@@ -414,30 +411,12 @@ gsm_app_dialog_class_init (GsmAppDialogClass *klass)
"comment",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));

g_type_class_add_private (klass, sizeof (GsmAppDialogPrivate));
}

static void
gsm_app_dialog_init (GsmAppDialog *dialog)
{

dialog->priv = GSM_APP_DIALOG_GET_PRIVATE (dialog);
}

static void
gsm_app_dialog_finalize (GObject *object)
{
GsmAppDialog *dialog;

g_return_if_fail (object != NULL);
g_return_if_fail (GSM_IS_APP_DIALOG (object));

dialog = GSM_APP_DIALOG (object);

g_return_if_fail (dialog->priv != NULL);

G_OBJECT_CLASS (gsm_app_dialog_parent_class)->finalize (object);
}

GtkWidget *
@@ -24,31 +24,10 @@
#include <glib-object.h>
#include <gtk/gtk.h>

#ifdef __cplusplus
extern "C" {
#endif
G_BEGIN_DECLS

#define GSM_TYPE_APP_DIALOG (gsm_app_dialog_get_type ())
#define GSM_APP_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSM_TYPE_APP_DIALOG, GsmAppDialog))
#define GSM_APP_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSM_TYPE_APP_DIALOG, GsmAppDialogClass))
#define GSM_IS_APP_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSM_TYPE_APP_DIALOG))
#define GSM_IS_APP_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSM_TYPE_APP_DIALOG))
#define GSM_APP_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSM_TYPE_APP_DIALOG, GsmAppDialogClass))

typedef struct GsmAppDialogPrivate GsmAppDialogPrivate;

typedef struct
{
GtkDialog parent;
GsmAppDialogPrivate *priv;
} GsmAppDialog;

typedef struct
{
GtkDialogClass parent_class;
} GsmAppDialogClass;

GType gsm_app_dialog_get_type (void);
#define GSM_TYPE_APP_DIALOG (gsm_app_dialog_get_type ())
G_DECLARE_FINAL_TYPE (GsmAppDialog, gsm_app_dialog, GSM, APP_DIALOG, GtkDialog)

GtkWidget * gsm_app_dialog_new (const char *name,
const char *command,
@@ -63,8 +42,6 @@ const char * gsm_app_dialog_get_name (GsmAppDialog *dialog);
const char * gsm_app_dialog_get_command (GsmAppDialog *dialog);
const char * gsm_app_dialog_get_comment (GsmAppDialog *dialog);

#ifdef __cplusplus
}
#endif
G_END_DECLS

#endif /* __GSM_APP_DIALOG_H */
Oops, something went wrong.

0 comments on commit 6b7875b

Please sign in to comment.
You can’t perform that action at this time.