diff options
author | Alan Fitton <ajf@eth0.org.uk> | 2011-11-24 16:30:34 +0000 |
---|---|---|
committer | Alan Fitton <ajf@eth0.org.uk> | 2011-11-24 16:30:34 +0000 |
commit | 4ac5eb6e2e1fe3fa1b6aef89ea6ae865434a783d (patch) | |
tree | 0f484e8311a27124c3d18e53eb6fae39ce5b4200 | |
parent | 4bb1831158320d8fe3543153482f523c4fe7a82d (diff) |
give labels precedence over "Default" when shortening directory names
-rw-r--r-- | src/trg-torrent-model.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/trg-torrent-model.c b/src/trg-torrent-model.c index 79ce396..b5d7d4c 100644 --- a/src/trg-torrent-model.c +++ b/src/trg-torrent-model.c @@ -261,9 +261,6 @@ gchar *shorten_download_dir(TrgClient *tc, const gchar *downloadDir) { const gchar *defaultDownloadDir = session_get_download_dir(session); gchar *shortDownloadDir = NULL; - if (!g_strcmp0(defaultDownloadDir, downloadDir)) - return g_strdup(_("Default")); - if (labels) { GList *labelsList = json_array_get_elements(labels); if (labelsList) { @@ -287,6 +284,9 @@ gchar *shorten_download_dir(TrgClient *tc, const gchar *downloadDir) { if (shortDownloadDir) { return shortDownloadDir; } else { + if (!g_strcmp0(defaultDownloadDir, downloadDir)) + return g_strdup(_("Default")); + if (g_str_has_prefix(downloadDir, defaultDownloadDir)) { int offset = strlen(defaultDownloadDir); if (*(downloadDir + offset) == '/') |