[gthumb] use _g_strset to set a string value
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] use _g_strset to set a string value
- Date: Sat, 10 Apr 2010 10:33:17 +0000 (UTC)
commit 782545c700fa9f28f4755adf3cf4140244836984
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Apr 10 12:31:49 2010 +0200
use _g_strset to set a string value
extensions/facebook/facebook-user.c | 2 -
extensions/flicker/flickr-account.c | 10 +----
extensions/flicker/flickr-photoset.c | 40 ++++---------------
extensions/flicker/flickr-user.c | 10 +----
extensions/picasaweb/picasa-web-album.c | 35 +++-------------
extensions/picasaweb/picasa-web-photo.c | 65 ++++++------------------------
extensions/picasaweb/picasa-web-user.c | 15 +------
7 files changed, 35 insertions(+), 142 deletions(-)
---
diff --git a/extensions/facebook/facebook-user.c b/extensions/facebook/facebook-user.c
index 91c9ee6..f6567dd 100644
--- a/extensions/facebook/facebook-user.c
+++ b/extensions/facebook/facebook-user.c
@@ -163,5 +163,3 @@ facebook_user_set_username (FacebookUser *self,
{
_g_strset (&self->username, value);
}
-
-
diff --git a/extensions/flicker/flickr-account.c b/extensions/flicker/flickr-account.c
index aa1fda4..926eed7 100644
--- a/extensions/flicker/flickr-account.c
+++ b/extensions/flicker/flickr-account.c
@@ -161,10 +161,7 @@ void
flickr_account_set_username (FlickrAccount *self,
const char *value)
{
- g_free (self->username);
- self->username = NULL;
- if (value != NULL)
- self->username = g_strdup (value);
+ _g_strset (&self->username, value);
}
@@ -172,10 +169,7 @@ void
flickr_account_set_token (FlickrAccount *self,
const char *value)
{
- g_free (self->token);
- self->token = NULL;
- if (value != NULL)
- self->token = g_strdup (value);
+ _g_strset (&self->token, value);
}
diff --git a/extensions/flicker/flickr-photoset.c b/extensions/flicker/flickr-photoset.c
index a2324cf..80ab85b 100644
--- a/extensions/flicker/flickr-photoset.c
+++ b/extensions/flicker/flickr-photoset.c
@@ -191,10 +191,7 @@ void
flickr_photoset_set_id (FlickrPhotoset *self,
const char *value)
{
- g_free (self->id);
- self->id = NULL;
- if (value != NULL)
- self->id = g_strdup (value);
+ _g_strset (&self->id, value);
}
@@ -202,10 +199,7 @@ void
flickr_photoset_set_title (FlickrPhotoset *self,
const char *value)
{
- g_free (self->title);
- self->title = NULL;
- if (value != NULL)
- self->title = g_strdup (value);
+ _g_strset (&self->title, value);
}
@@ -213,10 +207,7 @@ void
flickr_photoset_set_description (FlickrPhotoset *self,
const char *value)
{
- g_free (self->description);
- self->description = NULL;
- if (value != NULL)
- self->description = g_strdup (value);
+ _g_strset (&self->description, value);
}
@@ -235,10 +226,7 @@ void
flickr_photoset_set_primary (FlickrPhotoset *self,
const char *value)
{
- g_free (self->primary);
- self->primary = NULL;
- if (value != NULL)
- self->primary = g_strdup (value);
+ _g_strset (&self->primary, value);
}
@@ -246,10 +234,7 @@ void
flickr_photoset_set_secret (FlickrPhotoset *self,
const char *value)
{
- g_free (self->secret);
- self->secret = NULL;
- if (value != NULL)
- self->secret = g_strdup (value);
+ _g_strset (&self->secret, value);
}
@@ -257,10 +242,7 @@ void
flickr_photoset_set_server (FlickrPhotoset *self,
const char *value)
{
- g_free (self->server);
- self->server = NULL;
- if (value != NULL)
- self->server = g_strdup (value);
+ _g_strset (&self->server, value);
}
@@ -268,10 +250,7 @@ void
flickr_photoset_set_farm (FlickrPhotoset *self,
const char *value)
{
- g_free (self->farm);
- self->farm = NULL;
- if (value != NULL)
- self->farm = g_strdup (value);
+ _g_strset (&self->farm, value);
}
@@ -279,8 +258,5 @@ void
flickr_photoset_set_url (FlickrPhotoset *self,
const char *value)
{
- g_free (self->url);
- self->url = NULL;
- if (value != NULL)
- self->url = g_strdup (value);
+ _g_strset (&self->url, value);
}
diff --git a/extensions/flicker/flickr-user.c b/extensions/flicker/flickr-user.c
index 10b6003..12d4e05 100644
--- a/extensions/flicker/flickr-user.c
+++ b/extensions/flicker/flickr-user.c
@@ -167,10 +167,7 @@ void
flickr_user_set_id (FlickrUser *self,
const char *value)
{
- g_free (self->id);
- self->id = NULL;
- if (value != NULL)
- self->id = g_strdup (value);
+ _g_strset (&self->id, value);
}
@@ -186,10 +183,7 @@ void
flickr_user_set_username(FlickrUser *self,
const char *value)
{
- g_free (self->username);
- self->username = NULL;
- if (value != NULL)
- self->username = g_strdup (value);
+ _g_strset (&self->username, value);
}
diff --git a/extensions/picasaweb/picasa-web-album.c b/extensions/picasaweb/picasa-web-album.c
index 1bfd9ae..291c5cb 100644
--- a/extensions/picasaweb/picasa-web-album.c
+++ b/extensions/picasaweb/picasa-web-album.c
@@ -227,10 +227,7 @@ void
picasa_web_album_set_etag (PicasaWebAlbum *self,
const char *value)
{
- g_free (self->etag);
- self->etag = NULL;
- if (value != NULL)
- self->etag = g_strdup (value);
+ _g_strset (&self->etag, value);
}
@@ -238,10 +235,7 @@ void
picasa_web_album_set_id (PicasaWebAlbum *self,
const char *value)
{
- g_free (self->id);
- self->id = NULL;
- if (value != NULL)
- self->id = g_strdup (value);
+ _g_strset (&self->id, value);
}
@@ -249,10 +243,7 @@ void
picasa_web_album_set_title (PicasaWebAlbum *self,
const char *value)
{
- g_free (self->title);
- self->title = NULL;
- if (value != NULL)
- self->title = g_strdup (value);
+ _g_strset (&self->title, value);
}
@@ -260,10 +251,7 @@ void
picasa_web_album_set_summary (PicasaWebAlbum *self,
const char *value)
{
- g_free (self->summary);
- self->summary = NULL;
- if (value != NULL)
- self->summary = g_strdup (value);
+ _g_strset (&self->summary, value);
}
@@ -271,10 +259,7 @@ void
picasa_web_album_set_location (PicasaWebAlbum *self,
const char *value)
{
- g_free (self->location);
- self->location = NULL;
- if (value != NULL)
- self->location = g_strdup (value);
+ _g_strset (&self->location, value);
}
@@ -282,10 +267,7 @@ void
picasa_web_album_set_edit_url (PicasaWebAlbum *self,
const char *value)
{
- g_free (self->edit_url);
- self->edit_url = NULL;
- if (value != NULL)
- self->edit_url = g_strdup (value);
+ _g_strset (&self->edit_url, value);
}
@@ -342,8 +324,5 @@ void
picasa_web_album_set_keywords (PicasaWebAlbum *self,
const char *value)
{
- g_free (self->keywords);
- self->keywords = NULL;
- if (value != NULL)
- self->keywords = g_strdup (value);
+ _g_strset (&self->keywords, value);
}
diff --git a/extensions/picasaweb/picasa-web-photo.c b/extensions/picasaweb/picasa-web-photo.c
index 3d3016b..ee146f2 100644
--- a/extensions/picasaweb/picasa-web-photo.c
+++ b/extensions/picasaweb/picasa-web-photo.c
@@ -263,10 +263,7 @@ void
picasa_web_photo_set_etag (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->etag);
- self->etag = NULL;
- if (value != NULL)
- self->etag = g_strdup (value);
+ _g_strset (&self->etag, value);
}
@@ -274,10 +271,7 @@ void
picasa_web_photo_set_id (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->id);
- self->id = NULL;
- if (value != NULL)
- self->id = g_strdup (value);
+ _g_strset (&self->id, value);
}
@@ -285,10 +279,7 @@ void
picasa_web_photo_set_album_id (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->album_id);
- self->album_id = NULL;
- if (value != NULL)
- self->album_id = g_strdup (value);
+ _g_strset (&self->album_id, value);
}
@@ -296,10 +287,7 @@ void
picasa_web_photo_set_title (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->title);
- self->title = NULL;
- if (value != NULL)
- self->title = g_strdup (value);
+ _g_strset (&self->title, value);
}
@@ -307,10 +295,7 @@ void
picasa_web_photo_set_summary (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->summary);
- self->summary = NULL;
- if (value != NULL)
- self->summary = g_strdup (value);
+ _g_strset (&self->summary, value);
}
@@ -318,10 +303,7 @@ void
picasa_web_photo_set_uri (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->uri);
- self->uri = NULL;
- if (value != NULL)
- self->uri = g_strdup (value);
+ _g_strset (&self->uri, value);
}
@@ -329,10 +311,7 @@ void
picasa_web_photo_set_mime_type (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->mime_type);
- self->mime_type = NULL;
- if (value != NULL)
- self->mime_type = g_strdup (value);
+ _g_strset (&self->mime_type, value);
}
@@ -359,10 +338,7 @@ void
picasa_web_photo_set_credit (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->credit);
- self->credit = NULL;
- if (value != NULL)
- self->credit = g_strdup (value);
+ _g_strset (&self->credit, value);
}
@@ -370,10 +346,7 @@ void
picasa_web_photo_set_description (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->description);
- self->description = NULL;
- if (value != NULL)
- self->description = g_strdup (value);
+ _g_strset (&self->description, value);
}
@@ -381,10 +354,7 @@ void
picasa_web_photo_set_keywords (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->keywords);
- self->keywords = NULL;
- if (value != NULL)
- self->keywords = g_strdup (value);
+ _g_strset (&self->keywords, value);
}
@@ -392,10 +362,7 @@ void
picasa_web_photo_set_thumbnail_72 (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->thumbnail_72);
- self->thumbnail_72 = NULL;
- if (value != NULL)
- self->thumbnail_72 = g_strdup (value);
+ _g_strset (&self->thumbnail_72, value);
}
@@ -403,10 +370,7 @@ void
picasa_web_photo_set_thumbnail_144 (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->thumbnail_144);
- self->thumbnail_144 = NULL;
- if (value != NULL)
- self->thumbnail_144 = g_strdup (value);
+ _g_strset (&self->thumbnail_144, value);
}
@@ -414,10 +378,7 @@ void
picasa_web_photo_set_thumbnail_288 (PicasaWebPhoto *self,
const char *value)
{
- g_free (self->thumbnail_288);
- self->thumbnail_288 = NULL;
- if (value != NULL)
- self->thumbnail_288 = g_strdup (value);
+ _g_strset (&self->thumbnail_288, value);
}
diff --git a/extensions/picasaweb/picasa-web-user.c b/extensions/picasaweb/picasa-web-user.c
index 12f6c10..2e10bb7 100644
--- a/extensions/picasaweb/picasa-web-user.c
+++ b/extensions/picasaweb/picasa-web-user.c
@@ -183,10 +183,7 @@ void
picasa_web_user_set_id (PicasaWebUser *self,
const char *value)
{
- g_free (self->id);
- self->id = NULL;
- if (value != NULL)
- self->id = g_strdup (value);
+ _g_strset (&self->id, value);
}
@@ -194,10 +191,7 @@ void
picasa_web_user_set_nickname (PicasaWebUser *self,
const char *value)
{
- g_free (self->nickname);
- self->nickname = NULL;
- if (value != NULL)
- self->nickname = g_strdup (value);
+ _g_strset (&self->nickname, value);
}
@@ -205,10 +199,7 @@ void
picasa_web_user_set_icon (PicasaWebUser *self,
const char *value)
{
- g_free (self->icon);
- self->icon = NULL;
- if (value != NULL)
- self->icon = g_strdup (value);
+ _g_strset (&self->icon, value);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]