Root/gjay/patches/0016-Set-gjay-tree_depth-based-on-the-contents-of-the-dat.patch

Source at commit 1b3135c created 9 years 10 days ago.
By Xiangfu Liu, new package: SDL-widgets: a GUI toolkit on top of the SDL libraries
1From b6a3fef3df001aecb3ae8627de52bd0979bc42d8 Mon Sep 17 00:00:00 2001
2From: Joshua Judson Rosen <rozzin@geekspace.com>
3Date: Fri, 13 May 2011 21:32:29 -0400
4Subject: [PATCH 16/17] Set gjay->tree_depth based on the contents of the database during load
5 so that it's available even when running without the GUI.
6
7---
8 songs.c | 8 ++++++++
9 1 files changed, 8 insertions(+), 0 deletions(-)
10
11diff --git a/songs.c b/songs.c
12index ea95d36..2fe010e 100644
13--- a/songs.c
14+++ b/songs.c
15@@ -37,6 +37,7 @@
16 #include "flac.h"
17 #include "ui.h"
18 #include "i18n.h"
19+#include "util.h"
20 
21 
22 typedef enum {
23@@ -646,6 +647,13 @@ void data_start_element (GMarkupParseContext *context,
24             switch(get_element((char *) attribute_names[k])) {
25             case E_PATH:
26                 path = (gchar *) attribute_values[k];
27+ {
28+ int depth = file_depth(path) - 1
29+ - file_depth(gjay->prefs->song_root_dir);
30+ if (depth > gjay->tree_depth) {
31+ gjay->tree_depth = depth;
32+ }
33+ }
34                 break;
35             case E_REPEATS:
36                 repeat_path = (gchar *) attribute_values[k];
37--
381.7.2.5
39
40

Archive Download this file



interactive