OpenWrt packages
Sign in or create your account | Project List | Help
OpenWrt packages Git Source Tree
Root/
| 1 | From b6a3fef3df001aecb3ae8627de52bd0979bc42d8 Mon Sep 17 00:00:00 2001 |
| 2 | From: Joshua Judson Rosen <rozzin@geekspace.com> |
| 3 | Date: Fri, 13 May 2011 21:32:29 -0400 |
| 4 | Subject: [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 | |
| 11 | diff --git a/songs.c b/songs.c |
| 12 | index 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 | -- |
| 38 | 1.7.2.5 |
| 39 | |
| 40 |
