Commit b050a543 authored by Benjamin SANS's avatar Benjamin SANS

fix: segfault on new install + gnome3 complient

parent cf266b12
......@@ -148,7 +148,7 @@ cid_check_amarok_cover_exists (CidMainContainer **pCid, gchar *cURI)
gchar *cRet = g_strdup(cURI);
gchar **cCleanURI = g_strsplit (cRet,"@",0);
gchar **cSplitedURI = g_strsplit (cCleanURI[1],".",0);
if (g_strcasecmp(cSplitedURI[0],"nocover")==0)
if (g_ascii_strcasecmp(cSplitedURI[0],"nocover")==0)
{
g_free (cRet);
cRet = cid_db_search_cover (pCid,
......
......@@ -158,7 +158,7 @@ cid_check_exaile_cover_exists (gchar *cURI)
while (cCleanURI[cpt]!=NULL)
cpt++;
gchar **cSplitedURI = g_strsplit (cCleanURI[cpt-1],".",0);
if (g_strcasecmp(cSplitedURI[0],"nocover")==0)
if (g_ascii_strcasecmp(cSplitedURI[0],"nocover")==0)
{
g_free (cCleanURI);
g_free (cSplitedURI);
......@@ -195,8 +195,8 @@ getExaileSongInfos(void)
musicData.playing_track = 0;
if ((bFirstLoop && cOldArtist==NULL && cOldTitle==NULL) ||
(g_strcasecmp(cOldArtist,musicData.playing_artist)!=0 &&
g_strcasecmp(cOldTitle,musicData.playing_title)!=0))
(g_ascii_strcasecmp(cOldArtist,musicData.playing_artist)!=0 &&
g_ascii_strcasecmp(cOldTitle,musicData.playing_title)!=0))
bSongChanged = TRUE;
else
bSongChanged = FALSE;
......
......@@ -51,10 +51,10 @@ cid_get_xml_file (const gchar *artist,
cid_file_remove (DEFAULT_DOWNLOADED_IMAGE_LOCATION);
}
if (g_strcasecmp("Unknown",artist)==0
|| g_strcasecmp("Unknown",album)==0
|| g_strcasecmp("Inconnu",artist)==0
|| g_strcasecmp("Inconnu",album)==0)
if (g_ascii_strcasecmp("Unknown",artist)==0
|| g_ascii_strcasecmp("Unknown",album)==0
|| g_ascii_strcasecmp("Inconnu",artist)==0
|| g_ascii_strcasecmp("Inconnu",album)==0)
{
return FALSE;
}
......@@ -223,8 +223,8 @@ cid_db_store_cover (CidMainContainer **pCid,
&& cArtist != NULL
&& cAlbum != NULL,
NULL);
g_return_val_if_fail (g_strcasecmp (cArtist, "unknown") != 0
&& g_strcasecmp (cAlbum, "unknown") != 0,
g_return_val_if_fail (g_ascii_strcasecmp (cArtist, "unknown") != 0
&& g_ascii_strcasecmp (cAlbum, "unknown") != 0,
NULL);
CidMainContainer *cid = *pCid;
GKeyFile *pKeyFile;
......
......@@ -417,7 +417,7 @@ _cid_show_image_preview (GtkFileChooser *pFileChooser,
if (pixbuf != NULL)
{
gtk_image_set_from_pixbuf (pPreviewImage, pixbuf);
gdk_pixbuf_unref (pixbuf);
g_object_unref (pixbuf);
gtk_file_chooser_set_preview_widget_active (pFileChooser, TRUE);
}
else
......@@ -658,7 +658,7 @@ _cid_selection_changed (GtkTreeModel *model,
1);
}
gtk_image_set_from_pixbuf (pPreviewImage, pPreviewPixbuf);
gdk_pixbuf_unref (pPreviewPixbuf);
g_object_unref (pPreviewPixbuf);
if (bDistant)
{
......
......@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkscreen.h>
#include <glib-object.h>
G_BEGIN_DECLS
......
......@@ -504,7 +504,7 @@ cid_generate_ihm_from_keyfile (GKeyFile *pKeyFile,
gtk_image_set_from_pixbuf (
GTK_IMAGE (pImage),
pixbuf);
gdk_pixbuf_unref (pixbuf);
g_object_unref (pixbuf);
gtk_container_add (
GTK_CONTAINER (pLabelContainer),
pImage);
......@@ -1982,7 +1982,7 @@ cid_generate_ihm_from_keyfile (GKeyFile *pKeyFile,
if (pixbuf != NULL)
{
gtk_image_set_from_pixbuf (GTK_IMAGE (pImage), pixbuf);
gdk_pixbuf_unref (pixbuf);
g_object_unref (pixbuf);
gtk_container_add (GTK_CONTAINER (pLabelContainer),
pImage);
}
......
......@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkscreen.h>
#include <glib-object.h>
#include "../cid-struct.h"
G_BEGIN_DECLS
......
......@@ -123,7 +123,7 @@ cid_console_get_boolean_with_error_full (const gchar *cCommand,
}
pclose(pPipe);
strtok (cRead,"\n");
gboolean bRet = g_strcasecmp(cRead,"true")==0;
gboolean bRet = g_ascii_strcasecmp(cRead,"true")==0;
g_free(cRead);
return bRet;
}
......
......@@ -106,14 +106,23 @@ cid_file_remove (const gchar* cFilePath)
gboolean
cid_file_check_config_version (CidMainContainer **pCid, const gchar *f)
{
CidMainContainer *cid = *pCid;
gchar *cCommand=NULL;
gchar line_f1[80], line_f2[80];
FILE *f1, *f2;
if (cid->config->bDevMode)
return TRUE;
gchar *cOrigFile =
g_strdup_printf("%s/%s",CID_DATA_DIR, CID_CONFIG_FILE);
f1 = fopen ((const char *)cOrigFile,"r");
f2 = fopen ((const char *)f,"r");
g_free (cOrigFile);
if (!f1 || !f2)
cid_exit (pCid, 3, "couldn't read conf file, try to delete it");
if (!fgets(line_f1,80,f1) || !fgets(line_f2,80,f2))
cid_exit (pCid, 3,"couldn't read conf file, try to delete it");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment