Commit fa39d5ae authored by Ziirish's avatar Ziirish

cleaning code (part 3)

parent ea63b6e5
......@@ -88,7 +88,8 @@ c . . .KMMMMMMMMM\nMMMMMMMMMMMWo dMMMMMMMWWMMMMMMMMMMMMMMMX\
. . 'NMMMMMMMM\nMMMMMMMMMMMd . ,NMMMMMMMNWMMMMMMMMMMMMMMMW\
' dMMMMMMMM\nMMMMMMMMMN: . dMMMMMMMMNWMMMMMMMMMMMMMMMM\
, :MMMMMMMM\nMMMMMMMMMO ..kMMMMMMMMNWMMMMMMMMMMMMMMMM\
, . :MMMMMMMM\nMMMMMMMMMKloxl;cKMMMMMMMNWMMMMMMMMMMMMMNXK' ...xMMMMMMMM\nMMMMMMMWKddkkkkl':kNMMMMWWMMMMMMMMMMMMM0Ok; ;\
, . :MMMMMMMM\nMMMMMMMMMKloxl;cKMMMMMMMNWMMMMMMMMMMMMMNXK' \
...xMMMMMMMM\nMMMMMMMWKddkkkkl':kNMMMMWWMMMMMMMMMMMMM0Ok; ;\
kOWMMMMMMM\nMMMNXKOdodxkkkkkd. .dXMMMMMMMMMMMMMMMN0kkkl.....\
ckOONMMMMMMM\nMMNkkkkxxkkkkkkkkd' .:XMMMMMMMMMMMMMXOxxkxoloox\
kOOkkKWMMMMM\nMMNxxkkkOOOkkkkkkxxc\
......
......@@ -45,7 +45,8 @@ gboolean
cid_get_xml_file (const gchar *artist,
const gchar *album)
{
if (g_file_test (DEFAULT_DOWNLOADED_IMAGE_LOCATION, G_FILE_TEST_EXISTS))
if (g_file_test (DEFAULT_DOWNLOADED_IMAGE_LOCATION,
G_FILE_TEST_EXISTS))
{
cid_file_remove (DEFAULT_DOWNLOADED_IMAGE_LOCATION);
}
......@@ -128,7 +129,8 @@ cid_download_missing_cover (const gchar *cURL)
fclose(fp);
curl_easy_cleanup(handle);
if (rename (DEFAULT_DOWNLOADED_IMAGE_LOCATION".tmp",DEFAULT_DOWNLOADED_IMAGE_LOCATION) == -1)
if (rename (DEFAULT_DOWNLOADED_IMAGE_LOCATION".tmp",
DEFAULT_DOWNLOADED_IMAGE_LOCATION) == -1)
{
cid_warning ("Cannot rename '%s' to '%s'",
DEFAULT_DOWNLOADED_IMAGE_LOCATION".tmp",
......@@ -174,7 +176,9 @@ cid_search_xml_xpath (const char *filename,
}
// Evaluation de l'expression XPath
//gchar *cXPath = g_strdup_printf (xpath,cid->config->iImageSize == MEDIUM_IMAGE ? "large" : "extralarge"/*TAB_IMAGE_SIZES[cid->config->iImageSize]*/);
//gchar *cXPath = g_strdup_printf (xpath,cid->config->iImageSize ==
//MEDIUM_IMAGE ? "large" :
//"extralarge"/*TAB_IMAGE_SIZES[cid->config->iImageSize]*/);
gchar *cXPath = g_strdup_vprintf (xpath, args);
xmlXPathObjectPtr xpathRes = xmlXPathEvalExpression(cXPath, ctxt);
g_free (cXPath);
......@@ -193,7 +197,8 @@ cid_search_xml_xpath (const char *filename,
for (i = 0; i < xpathRes->nodesetval->nodeNr; i++)
{
xmlNodePtr n = xpathRes->nodesetval->nodeTab[i];
if (n->type == XML_TEXT_NODE || n->type == XML_CDATA_SECTION_NODE)
if (n->type == XML_TEXT_NODE ||
n->type == XML_CDATA_SECTION_NODE)
{
*cValue = g_strdup (n->content);
}
......@@ -242,7 +247,8 @@ cid_db_store_cover (CidMainContainer **pCid,
pKeyFile = g_key_file_new ();
flags = G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS;
if (!g_file_test (cid->config->cDLPath, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE))
if (!g_file_test (cid->config->cDLPath,
G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE))
{
cid_info ("Creating path %s", cid->config->cDLPath);
g_mkdir_with_parents (cid->config->cDLPath, 7*8*8+7*8+5);
......@@ -316,7 +322,10 @@ cid_db_search_cover (CidMainContainer **pCid,
return NULL;
}
gchar *cVal = g_key_file_get_value (pKeyFile, DB_GROUP_DOWNLOAD, cKey, &error);
gchar *cVal = g_key_file_get_value (pKeyFile,
DB_GROUP_DOWNLOAD,
cKey,
&error);
if (error != NULL)
{
cid_warning ("%s",error->message);
......
This diff is collapsed.
......@@ -80,7 +80,9 @@ GtkWidget *cid_get_image_widget(gchar **imageURI);
* @param non utilisé
* @param pointeur de données (non utilisé)
*/
void cid_set_colormap (GtkWidget *widget, GdkScreen *old_screen, gpointer userdata);
void cid_set_colormap (GtkWidget *widget,
GdkScreen *old_screen,
gpointer userdata);
/**
* renvoie une image à partir d'un buffer de pixels
......@@ -96,7 +98,9 @@ cairo_surface_t *cid_get_image_from_pixbuf (GdkPixbuf **pixbuf);
* @param iHeight Hauteur.
* @return image.
*/
cairo_surface_t *cid_get_cairo_image (gchar *cImagePath, gdouble iWidth, gdouble iHeight);
cairo_surface_t *cid_get_cairo_image (gchar *cImagePath,
gdouble iWidth,
gdouble iHeight);
/**
* Fonction appelée pour dessiner la fenêtre
......@@ -104,7 +108,9 @@ cairo_surface_t *cid_get_cairo_image (gchar *cImagePath, gdouble iWidth, gdouble
* @param ?
* @param non utilisé
*/
void cid_draw_window (GtkWidget *widget, GdkEventExpose *event, gpointer *userdata);
void cid_draw_window (GtkWidget *widget,
GdkEventExpose *event,
gpointer *userdata);
/**
* On dessine l'etat du lecteur
......
......@@ -75,7 +75,12 @@ cid_log_location(const GLogLevelFlags loglevel,
if (loglevel > gLogLevel)
return;
fprintf (stdout,"%s",_cid_log_level_to_string(loglevel));
fprintf (stdout,"\033[0;37m(%s:%s:%d) \033[%cm \n ", file, func, line, s_iLogColor);
fprintf (stdout,
"\033[0;37m(%s:%s:%d) \033[%cm \n ",
file,
func,
line,
s_iLogColor);
va_start(args, format);
g_logv(G_LOG_DOMAIN, loglevel, format, args);
va_end(args);
......
......@@ -63,20 +63,40 @@ void cid_log_init(gboolean bBlackTerminal);
*/
void cid_log_set_level(GLogLevelFlags loglevel);
#define cid_error(...) \
cid_log_location(G_LOG_LEVEL_ERROR, __FILE__, __PRETTY_FUNCTION__, __LINE__,__VA_ARGS__)
#define cid_error(...) \
cid_log_location(G_LOG_LEVEL_ERROR, \
__FILE__, \
__PRETTY_FUNCTION__, \
__LINE__, \
__VA_ARGS__)
#define cid_warning(...) \
cid_log_location(G_LOG_LEVEL_WARNING, __FILE__, __PRETTY_FUNCTION__, __LINE__,__VA_ARGS__)
#define cid_warning(...) \
cid_log_location(G_LOG_LEVEL_WARNING, \
__FILE__, \
__PRETTY_FUNCTION__, \
__LINE__, \
__VA_ARGS__)
#define cid_message(...) \
cid_log_location(G_LOG_LEVEL_MESSAGE, __FILE__, __PRETTY_FUNCTION__, __LINE__,__VA_ARGS__)
#define cid_message(...) \
cid_log_location(G_LOG_LEVEL_MESSAGE, \
__FILE__, \
__PRETTY_FUNCTION__, \
__LINE__, \
__VA_ARGS__)
#define cid_debug(...) \
cid_log_location(G_LOG_LEVEL_DEBUG, __FILE__, __PRETTY_FUNCTION__, __LINE__,__VA_ARGS__)
#define cid_debug(...) \
cid_log_location(G_LOG_LEVEL_DEBUG, \
__FILE__, \
__PRETTY_FUNCTION__, \
__LINE__, \
__VA_ARGS__)
#define cid_info(...) \
cid_log_location(G_LOG_LEVEL_INFO, __FILE__, __PRETTY_FUNCTION__, __LINE__,__VA_ARGS__)
cid_log_location(G_LOG_LEVEL_INFO, \
__FILE__, \
__PRETTY_FUNCTION__, \
__LINE__, \
__VA_ARGS__)
/**
* sort du programme avec le code de retour donné
......@@ -84,7 +104,10 @@ void cid_log_set_level(GLogLevelFlags loglevel);
* @param code de retour
* @param message d'erreur à nombre variable de paramètres
*/
void cid_exit (CidMainContainer **pCid, int code, const gchar *mess, ...);
void cid_exit (CidMainContainer **pCid,
int code,
const gchar *mess,
...);
G_END_DECLS
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -46,13 +46,15 @@ typedef struct _CidVisitCard CidVisitCard;
typedef struct _CidInternalModule CidInternalModule;
///\______ Encapsulations
typedef void (* CidReadConfigFunc) (CidMainContainer **pCid, gchar *cConfFile);
typedef void (* CidReadConfigFunc) (CidMainContainer **pCid,
gchar *cConfFile);
typedef void (* CidControlFunction) (CidMainContainer **pCid);
typedef void (* CidManagePlaylistFunction) (gchar *cSong);
typedef void (* CidConnectPlayer) (gint iDelay);
typedef void (* CidDisconnectPlayer) (void);
/// Structure de données utilisée pour stocker les informations fournies par Rhythmbox et Amarok
/// Structure de données utilisée pour stocker les informations
/// fournies par Rhythmbox et Amarok
struct data {
/// URI du fichier lu
gchar *playing_uri;
......
......@@ -22,7 +22,6 @@
*
*/
//#include "cid.h"
#include "cid-callbacks.h"
#include "cid-gui-callback.h"
#include "cid-menu-factory.h"
......
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