[epiphany] Use g_value_dup_string where possible
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Use g_value_dup_string where possible
- Date: Fri, 15 Jun 2018 15:36:27 +0000 (UTC)
commit 1bd7a5889d3c5276cdd3f311da722e696942832f
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Fri Jun 15 10:35:18 2018 -0500
Use g_value_dup_string where possible
embed/ephy-encoding.c | 8 ++++----
lib/history/ephy-history-service.c | 2 +-
lib/safe-browsing/ephy-gsb-service.c | 2 +-
lib/safe-browsing/ephy-gsb-storage.c | 2 +-
lib/sync/ephy-history-record.c | 6 +++---
lib/sync/ephy-open-tabs-record.c | 4 ++--
lib/sync/ephy-password-record.c | 14 +++++++-------
src/bookmarks/ephy-bookmark.c | 6 +++---
8 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/embed/ephy-encoding.c b/embed/ephy-encoding.c
index fdc7d7843..6e3fa98f2 100644
--- a/embed/ephy-encoding.c
+++ b/embed/ephy-encoding.c
@@ -130,7 +130,7 @@ ephy_encoding_set_property (GObject *object,
char *elided, *collate_key, *normalised;
g_free (encoding->title);
- encoding->title = g_strdup (g_value_get_string (value));
+ encoding->title = g_value_dup_string (value);
elided = elide_underscores (encoding->title);
normalised = g_utf8_normalize (elided, -1, G_NORMALIZE_DEFAULT);
@@ -149,15 +149,15 @@ ephy_encoding_set_property (GObject *object,
}
case PROP_TITLE_ELIDED:
g_free (encoding->title_elided);
- encoding->title_elided = g_strdup (g_value_get_string (value));
+ encoding->title_elided = g_value_dup_string (value);
break;
case PROP_COLLATION_KEY:
g_free (encoding->collation_key);
- encoding->collation_key = g_strdup (g_value_get_string (value));
+ encoding->collation_key = g_value_dup_string (value);
break;
case PROP_ENCODING:
g_free (encoding->encoding);
- encoding->encoding = g_strdup (g_value_get_string (value));
+ encoding->encoding = g_value_dup_string (value);
break;
case PROP_LANGUAGE_GROUPS:
encoding->language_groups = g_value_get_int (value);
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c
index 6ce328ef0..de3fa6930 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -102,7 +102,7 @@ ephy_history_service_set_property (GObject *object, guint property_id, const GVa
switch (property_id) {
case PROP_HISTORY_FILENAME:
g_free (self->history_filename);
- self->history_filename = g_strdup (g_value_get_string (value));
+ self->history_filename = g_value_dup_string (value);
break;
case PROP_READ_ONLY:
self->read_only = g_value_get_boolean (value);
diff --git a/lib/safe-browsing/ephy-gsb-service.c b/lib/safe-browsing/ephy-gsb-service.c
index a99a6d243..fd9d84d54 100644
--- a/lib/safe-browsing/ephy-gsb-service.c
+++ b/lib/safe-browsing/ephy-gsb-service.c
@@ -333,7 +333,7 @@ ephy_gsb_service_set_property (GObject *object,
switch (prop_id) {
case PROP_API_KEY:
g_free (self->api_key);
- self->api_key = g_strdup (g_value_get_string (value));
+ self->api_key = g_value_dup_string (value);
break;
case PROP_GSB_STORAGE:
if (self->storage)
diff --git a/lib/safe-browsing/ephy-gsb-storage.c b/lib/safe-browsing/ephy-gsb-storage.c
index 05d8f27a7..a45c894f2 100644
--- a/lib/safe-browsing/ephy-gsb-storage.c
+++ b/lib/safe-browsing/ephy-gsb-storage.c
@@ -427,7 +427,7 @@ ephy_gsb_storage_set_property (GObject *object,
switch (prop_id) {
case PROP_DB_PATH:
g_free (self->db_path);
- self->db_path = g_strdup (g_value_get_string (value));
+ self->db_path = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/lib/sync/ephy-history-record.c b/lib/sync/ephy-history-record.c
index c28b9c605..a600e2654 100644
--- a/lib/sync/ephy-history-record.c
+++ b/lib/sync/ephy-history-record.c
@@ -102,15 +102,15 @@ ephy_history_record_set_property (GObject *object,
switch (prop_id) {
case PROP_ID:
g_free (self->id);
- self->id = g_strdup (g_value_get_string (value));
+ self->id = g_value_dup_string (value);
break;
case PROP_TITLE:
g_free (self->title);
- self->title = g_strdup (g_value_get_string (value));
+ self->title = g_value_dup_string (value);
break;
case PROP_URI:
g_free (self->uri);
- self->uri = g_strdup (g_value_get_string (value));
+ self->uri = g_value_dup_string (value);
break;
case PROP_VISITS:
if (self->visits)
diff --git a/lib/sync/ephy-open-tabs-record.c b/lib/sync/ephy-open-tabs-record.c
index 7e322b70f..6d89cd04e 100644
--- a/lib/sync/ephy-open-tabs-record.c
+++ b/lib/sync/ephy-open-tabs-record.c
@@ -70,11 +70,11 @@ ephy_open_tabs_record_set_property (GObject *object,
switch (prop_id) {
case PROP_ID:
g_free (self->id);
- self->id = g_strdup (g_value_get_string (value));
+ self->id = g_value_dup_string (value);
break;
case PROP_CLIENT_NAME:
g_free (self->client_name);
- self->client_name = g_strdup (g_value_get_string (value));
+ self->client_name = g_value_dup_string (value);
break;
case PROP_TABS:
g_list_free_full (self->tabs, (GDestroyNotify)json_object_unref);
diff --git a/lib/sync/ephy-password-record.c b/lib/sync/ephy-password-record.c
index 314474f61..85e25f54d 100644
--- a/lib/sync/ephy-password-record.c
+++ b/lib/sync/ephy-password-record.c
@@ -74,31 +74,31 @@ ephy_password_record_set_property (GObject *object,
switch (prop_id) {
case PROP_ID:
g_free (self->id);
- self->id = g_strdup (g_value_get_string (value));
+ self->id = g_value_dup_string (value);
break;
case PROP_ORIGIN:
g_free (self->origin);
- self->origin = g_strdup (g_value_get_string (value));
+ self->origin = g_value_dup_string (value);
break;
case PROP_TARGET_ORIGIN:
g_free (self->target_origin);
- self->target_origin = g_strdup (g_value_get_string (value));
+ self->target_origin = g_value_dup_string (value);
break;
case PROP_USERNAME:
g_free (self->username);
- self->username = g_strdup (g_value_get_string (value));
+ self->username = g_value_dup_string (value);
break;
case PROP_PASSWORD:
g_free (self->password);
- self->password = g_strdup (g_value_get_string (value));
+ self->password = g_value_dup_string (value);
break;
case PROP_USERNAME_FIELD:
g_free (self->username_field);
- self->username_field = g_strdup (g_value_get_string (value));
+ self->username_field = g_value_dup_string (value);
break;
case PROP_PASSWORD_FIELD:
g_free (self->password_field);
- self->password_field = g_strdup (g_value_get_string (value));
+ self->password_field = g_value_dup_string (value);
break;
case PROP_TIME_CREATED:
self->time_created = g_value_get_uint64 (value);
diff --git a/src/bookmarks/ephy-bookmark.c b/src/bookmarks/ephy-bookmark.c
index 390472e24..43619a4ef 100644
--- a/src/bookmarks/ephy-bookmark.c
+++ b/src/bookmarks/ephy-bookmark.c
@@ -105,15 +105,15 @@ ephy_bookmark_set_property (GObject *object,
break;
case PROP_TYPE:
g_free (self->type);
- self->type = g_strdup (g_value_get_string (value));
+ self->type = g_value_dup_string (value);
break;
case PROP_PARENT_ID:
g_free (self->parent_id);
- self->parent_id = g_strdup (g_value_get_string (value));
+ self->parent_id = g_value_dup_string (value);
break;
case PROP_PARENT_NAME:
g_free (self->parent_name);
- self->parent_name = g_strdup (g_value_get_string (value));
+ self->parent_name = g_value_dup_string (value);
break;
case PROP_LOAD_IN_SIDEBAR:
self->load_in_sidebar = g_value_get_boolean (value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]