comparison src/audacious/skin.c @ 3864:6cbb1a20b10b

minor cleanup
author mf0102 <0102@gmx.at>
date Sun, 28 Oct 2007 19:36:16 +0100
parents ddfe09d3cf86
children 8f8d7ac51b08
comparison
equal deleted inserted replaced
3863:dd5c459c5f2d 3864:6cbb1a20b10b
1462 1462
1463 return TRUE; 1463 return TRUE;
1464 } 1464 }
1465 1465
1466 static void 1466 static void
1467 skin_set_gtk_theme(GtkSettings * settings, Skin * skin, gboolean tmp_clean) 1467 skin_set_gtk_theme(GtkSettings * settings, Skin * skin)
1468 { 1468 {
1469 if (original_gtk_theme == NULL) 1469 if (original_gtk_theme == NULL)
1470 g_object_get(settings, "gtk-theme-name", &original_gtk_theme, NULL); 1470 g_object_get(settings, "gtk-theme-name", &original_gtk_theme, NULL);
1471
1472 /* the way GTK does things can be very broken. --nenolod */
1471 1473
1472 gchar *tmp = g_strdup_printf("%s/.themes/aud-%s", g_get_home_dir(), 1474 gchar *tmp = g_strdup_printf("%s/.themes/aud-%s", g_get_home_dir(),
1473 basename(skin->path)); 1475 basename(skin->path));
1474 1476
1475 gchar *troot = g_strdup_printf("%s/.themes", g_get_home_dir()); 1477 gchar *troot = g_strdup_printf("%s/.themes", g_get_home_dir());
1477 g_free(troot); 1479 g_free(troot);
1478 1480
1479 symlink(skin->path, tmp); 1481 symlink(skin->path, tmp);
1480 gtk_settings_set_string_property(settings, "gtk-theme-name", 1482 gtk_settings_set_string_property(settings, "gtk-theme-name",
1481 basename(tmp), "audacious"); 1483 basename(tmp), "audacious");
1482 1484 g_free(tmp);
1483 #if 0
1484 if (tmp_clean)
1485 {
1486 unlink(tmp);
1487 g_free(tmp);
1488 }
1489 #endif
1490 } 1485 }
1491 1486
1492 static gboolean 1487 static gboolean
1493 skin_load_nolock(Skin * skin, const gchar * path, gboolean force) 1488 skin_load_nolock(Skin * skin, const gchar * path, gboolean force)
1494 { 1489 {
1530 1525
1531 skin_load_cursor(skin, path); 1526 skin_load_cursor(skin, path);
1532 1527
1533 #ifndef _WIN32 1528 #ifndef _WIN32
1534 gtkrcpath = find_path_recursively(skin->path, "gtkrc"); 1529 gtkrcpath = find_path_recursively(skin->path, "gtkrc");
1535 1530 if (gtkrcpath != NULL)
1536 /* the way GTK does things can be very broken. --nenolod */ 1531 skin_set_gtk_theme(settings, skin);
1537 if (gtkrcpath != NULL) {
1538 skin_set_gtk_theme(settings, skin, FALSE);
1539 }
1540
1541 g_free(gtkrcpath); 1532 g_free(gtkrcpath);
1542 #endif 1533 #endif
1543 1534
1544 return TRUE; 1535 return TRUE;
1545 } 1536 }
1561 1552
1562 skin_load_cursor(skin, cpath); 1553 skin_load_cursor(skin, cpath);
1563 1554
1564 #ifndef _WIN32 1555 #ifndef _WIN32
1565 gtkrcpath = find_path_recursively(skin->path, "gtkrc"); 1556 gtkrcpath = find_path_recursively(skin->path, "gtkrc");
1566 1557 if (gtkrcpath != NULL)
1567 /* the way GTK does things can be very broken. --nenolod */ 1558 skin_set_gtk_theme(settings, skin);
1568 if (gtkrcpath != NULL) {
1569 skin_set_gtk_theme(settings, skin, TRUE);
1570 }
1571
1572 g_free(gtkrcpath); 1559 g_free(gtkrcpath);
1573 #endif 1560 #endif
1574 1561
1575 del_directory(cpath); 1562 del_directory(cpath);
1576 g_free(cpath); 1563 g_free(cpath);