[easytag] Use g_strstrip() instead of Strip_String()
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Use g_strstrip() instead of Strip_String()
- Date: Fri, 19 Jul 2013 23:06:45 +0000 (UTC)
commit d2f6953d4f9b44ce7b688ff1a26c22393b568244
Author: David King <amigadave amigadave com>
Date: Sat Jul 20 00:04:50 2013 +0100
Use g_strstrip() instead of Strip_String()
src/cddb.c | 4 +-
src/et_core.c | 60 +++++++++++++++++++++++++++---------------------------
src/id3v24_tag.c | 2 +-
src/misc.c | 11 ---------
src/misc.h | 1 -
src/picture.c | 2 +-
6 files changed, 34 insertions(+), 46 deletions(-)
---
diff --git a/src/cddb.c b/src/cddb.c
index dea29cf..883663b 100644
--- a/src/cddb.c
+++ b/src/cddb.c
@@ -2094,7 +2094,7 @@ Cddb_Search_Album_List_From_String_Freedb (void)
return FALSE;
/* Format the string of words */
- Strip_String(string);
+ g_strstrip (string);
/* Remove the duplicated spaces */
while ((tmp=strstr(string," "))!=NULL) // Search 2 spaces
{
@@ -2408,7 +2408,7 @@ Cddb_Search_Album_List_From_String_Gnudb (void)
return FALSE;
/* Format the string of words */
- Strip_String(string);
+ g_strstrip (string);
/* Remove the duplicated spaces */
while ((tmp=strstr(string," "))!=NULL) // Search 2 spaces
{
diff --git a/src/et_core.c b/src/et_core.c
index c532298..77deb29 100644
--- a/src/et_core.c
+++ b/src/et_core.c
@@ -3385,7 +3385,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Title */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(TitleEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->title = buffer;
@@ -3397,7 +3397,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Artist */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(ArtistEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->artist = buffer;
@@ -3409,7 +3409,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Album Artist */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(AlbumArtistEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->album_artist = buffer;
@@ -3421,7 +3421,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Album */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(AlbumEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->album = buffer;
@@ -3433,7 +3433,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Disc Number */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(DiscNumberEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->disc_number = buffer;
@@ -3445,7 +3445,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Year */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(YearEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->year = buffer;
@@ -3457,7 +3457,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Track */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(TrackEntryCombo)))));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
{
@@ -3471,7 +3471,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Track Total */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(TrackTotalEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
{
@@ -3485,7 +3485,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Genre */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(GenreCombo)))));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->genre = buffer;
@@ -3500,7 +3500,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
//gtk_text_buffer_get_bounds(GTK_TEXT_BUFFER(textbuffer),&start_iter,&end_iter);
//buffer = gtk_text_buffer_get_text(GTK_TEXT_BUFFER(textbuffer),&start_iter,&end_iter,TRUE);
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(CommentEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->comment = buffer;
@@ -3512,7 +3512,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Composer */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(ComposerEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->composer = buffer;
@@ -3524,7 +3524,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Original Artist */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(OrigArtistEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->orig_artist = buffer;
@@ -3536,7 +3536,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Copyright */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(CopyrightEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->copyright = buffer;
@@ -3548,7 +3548,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* URL */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(URLEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->url = buffer;
@@ -3560,7 +3560,7 @@ ET_Save_File_Tag_From_UI (File_Tag *FileTag)
/* Encoded by */
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(EncodedByEntry)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if ( g_utf8_strlen(buffer, -1) > 0 )
FileTag->encoded_by = buffer;
@@ -3620,7 +3620,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->title && g_utf8_strlen(FileTagCur->title, -1)>0 )
{
FileTag->title = g_strdup(FileTagCur->title);
- Strip_String(FileTag->title);
+ g_strstrip (FileTag->title);
} else
{
FileTag->title = NULL;
@@ -3630,7 +3630,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->artist && g_utf8_strlen(FileTagCur->artist, -1)>0 )
{
FileTag->artist = g_strdup(FileTagCur->artist);
- Strip_String(FileTag->artist);
+ g_strstrip (FileTag->artist);
} else
{
FileTag->artist = NULL;
@@ -3640,7 +3640,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->album_artist && g_utf8_strlen(FileTagCur->album_artist, -1)>0 )
{
FileTag->album_artist = g_strdup(FileTagCur->album_artist);
- Strip_String(FileTag->album_artist);
+ g_strstrip (FileTag->album_artist);
} else
{
FileTag->album_artist = NULL;
@@ -3651,7 +3651,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->album && g_utf8_strlen(FileTagCur->album, -1)>0 )
{
FileTag->album = g_strdup(FileTagCur->album);
- Strip_String(FileTag->album);
+ g_strstrip (FileTag->album);
} else
{
FileTag->album = NULL;
@@ -3662,7 +3662,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->disc_number && g_utf8_strlen(FileTagCur->disc_number, -1)>0 )
{
FileTag->disc_number = g_strdup(FileTagCur->disc_number);
- Strip_String(FileTag->disc_number);
+ g_strstrip (FileTag->disc_number);
} else
{
FileTag->disc_number = NULL;
@@ -3673,7 +3673,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->year && g_utf8_strlen(FileTagCur->year, -1)>0 )
{
FileTag->year = g_strdup(FileTagCur->year);
- Strip_String(FileTag->year);
+ g_strstrip (FileTag->year);
} else
{
FileTag->year = NULL;
@@ -3691,7 +3691,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
tmp_str = FileTag->track;
while (isdigit((guchar)*tmp_str)) tmp_str++;
*tmp_str = 0;
- Strip_String(FileTag->track);
+ g_strstrip (FileTag->track);
} else
{
FileTag->track = NULL;
@@ -3702,7 +3702,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->track_total && g_utf8_strlen(FileTagCur->track_total, -1)>0 )
{
FileTag->track_total = et_track_number_to_string (atoi (FileTagCur->track_total));
- Strip_String(FileTag->track_total);
+ g_strstrip (FileTag->track_total);
} else
{
FileTag->track_total = NULL;
@@ -3713,7 +3713,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->genre && g_utf8_strlen(FileTagCur->genre, -1)>0 )
{
FileTag->genre = g_strdup(FileTagCur->genre);
- Strip_String(FileTag->genre);
+ g_strstrip (FileTag->genre);
} else
{
FileTag->genre = NULL;
@@ -3724,7 +3724,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->comment && g_utf8_strlen(FileTagCur->comment, -1)>0 )
{
FileTag->comment = g_strdup(FileTagCur->comment);
- Strip_String(FileTag->comment);
+ g_strstrip (FileTag->comment);
} else
{
FileTag->comment = NULL;
@@ -3735,7 +3735,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->composer && g_utf8_strlen(FileTagCur->composer, -1)>0 )
{
FileTag->composer = g_strdup(FileTagCur->composer);
- Strip_String(FileTag->composer);
+ g_strstrip (FileTag->composer);
} else
{
FileTag->composer = NULL;
@@ -3746,7 +3746,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->orig_artist && g_utf8_strlen(FileTagCur->orig_artist, -1)>0 )
{
FileTag->orig_artist = g_strdup(FileTagCur->orig_artist);
- Strip_String(FileTag->orig_artist);
+ g_strstrip (FileTag->orig_artist);
} else
{
FileTag->orig_artist = NULL;
@@ -3757,7 +3757,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->copyright && g_utf8_strlen(FileTagCur->copyright, -1)>0 )
{
FileTag->copyright = g_strdup(FileTagCur->copyright);
- Strip_String(FileTag->copyright);
+ g_strstrip (FileTag->copyright);
} else
{
FileTag->copyright = NULL;
@@ -3768,7 +3768,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->url && g_utf8_strlen(FileTagCur->url, -1)>0 )
{
FileTag->url = g_strdup(FileTagCur->url);
- Strip_String(FileTag->url);
+ g_strstrip (FileTag->url);
} else
{
FileTag->url = NULL;
@@ -3779,7 +3779,7 @@ ET_Save_File_Tag_Internal (ET_File *ETFile, File_Tag *FileTag)
if ( FileTagCur->encoded_by && g_utf8_strlen(FileTagCur->encoded_by, -1)>0 )
{
FileTag->encoded_by = g_strdup(FileTagCur->encoded_by);
- Strip_String(FileTag->encoded_by);
+ g_strstrip (FileTag->encoded_by);
} else
{
FileTag->encoded_by = NULL;
diff --git a/src/id3v24_tag.c b/src/id3v24_tag.c
index 3b8f849..5482e5b 100644
--- a/src/id3v24_tag.c
+++ b/src/id3v24_tag.c
@@ -243,7 +243,7 @@ gboolean Id3tag_Read_File_Tag (gchar *filename, File_Tag *FileTag)
update |= libid3tag_Get_Frame_Str(frame, ~0, &string1);
if ( string1 )
{
- Strip_String(string1);
+ g_strstrip (string1);
FileTag->year = string1;
}
}
diff --git a/src/misc.c b/src/misc.c
index 284ea4e..dfa7d5f 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1110,17 +1110,6 @@ Get_File_Size (const gchar *filename)
return statbuf.st_size;
}
-/*
- * Delete spaces at the end and the beginning of the string
- */
-void
-Strip_String (gchar *string)
-{
- g_return_if_fail (string != NULL);
-
- string = g_strstrip (string);
-}
-
/*******************************
diff --git a/src/misc.h b/src/misc.h
index afc6016..1844e0a 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -91,7 +91,6 @@ gchar *Convert_Duration (gulong duration);
off_t Get_File_Size (const gchar *filename);
-void Strip_String (gchar *string);
gint Combo_Alphabetic_Sort (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data);
void File_Selection_Window_For_File (GtkWidget *entry);
diff --git a/src/picture.c b/src/picture.c
index 3dc2adb..170aa25 100644
--- a/src/picture.c
+++ b/src/picture.c
@@ -598,7 +598,7 @@ void Picture_Properties_Button_Clicked (GObject *object)
pic->type = t;
buffer = g_strdup(gtk_entry_get_text(GTK_ENTRY(desc)));
- Strip_String(buffer);
+ g_strstrip (buffer);
if (pic->description)
g_free(pic->description);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]