some fixes for non-unicode locales
This commit is contained in:
@@ -385,6 +385,7 @@ void Browser::GetDirectory(string dir, string subdir)
|
|||||||
parent.song = (Song *) 1; // in that way we assume that's really parent dir
|
parent.song = (Song *) 1; // in that way we assume that's really parent dir
|
||||||
parent.name = slash != string::npos ? dir.substr(0, slash) : "/";
|
parent.name = slash != string::npos ? dir.substr(0, slash) : "/";
|
||||||
parent.type = itDirectory;
|
parent.type = itDirectory;
|
||||||
|
utf_to_locale(parent.name);
|
||||||
w->AddOption(parent);
|
w->AddOption(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -977,7 +977,7 @@ int main(int argc, char *argv[])
|
|||||||
else if (Keypressed(input, Key.UpdateDB))
|
else if (Keypressed(input, Key.UpdateDB))
|
||||||
{
|
{
|
||||||
if (myScreen == myBrowser)
|
if (myScreen == myBrowser)
|
||||||
Mpd->UpdateDirectory(myBrowser->CurrentDir());
|
Mpd->UpdateDirectory(locale_to_utf_cpy(myBrowser->CurrentDir()));
|
||||||
# ifdef HAVE_TAGLIB_H
|
# ifdef HAVE_TAGLIB_H
|
||||||
else if (myScreen == myTagEditor && !Config.albums_in_tag_editor)
|
else if (myScreen == myTagEditor && !Config.albums_in_tag_editor)
|
||||||
Mpd->UpdateDirectory(myTagEditor->CurrentDir());
|
Mpd->UpdateDirectory(myTagEditor->CurrentDir());
|
||||||
@@ -1077,7 +1077,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
Mpd->UpdateDirectory(FindSharedDir(list));
|
Mpd->UpdateDirectory(locale_to_utf_cpy(FindSharedDir(list)));
|
||||||
ShowMessage("Tags updated succesfully!");
|
ShowMessage("Tags updated succesfully!");
|
||||||
}
|
}
|
||||||
FreeSongList(list);
|
FreeSongList(list);
|
||||||
@@ -1098,7 +1098,7 @@ int main(int argc, char *argv[])
|
|||||||
(*myLibrary->Songs)[i].Localize();
|
(*myLibrary->Songs)[i].Localize();
|
||||||
ShowMessage("Updating tags in '%s'...", (*myLibrary->Songs)[i].GetName().c_str());
|
ShowMessage("Updating tags in '%s'...", (*myLibrary->Songs)[i].GetName().c_str());
|
||||||
string path = Config.mpd_music_dir + (*myLibrary->Songs)[i].GetFile();
|
string path = Config.mpd_music_dir + (*myLibrary->Songs)[i].GetFile();
|
||||||
TagLib::FileRef f(path.c_str());
|
TagLib::FileRef f(locale_to_utf_cpy(path).c_str());
|
||||||
if (f.isNull())
|
if (f.isNull())
|
||||||
{
|
{
|
||||||
ShowMessage("Error opening file '%s'!", (*myLibrary->Songs)[i].GetFile().c_str());
|
ShowMessage("Error opening file '%s'!", (*myLibrary->Songs)[i].GetFile().c_str());
|
||||||
@@ -1115,7 +1115,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
Mpd->UpdateDirectory(FindSharedDir(myLibrary->Songs));
|
Mpd->UpdateDirectory(locale_to_utf_cpy(FindSharedDir(myLibrary->Songs)));
|
||||||
ShowMessage("Tags updated succesfully!");
|
ShowMessage("Tags updated succesfully!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1169,7 +1169,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
ShowMessage("'%s' renamed to '%s'", old_dir.c_str(), new_dir.c_str());
|
ShowMessage("'%s' renamed to '%s'", old_dir.c_str(), new_dir.c_str());
|
||||||
if (!Config.local_browser)
|
if (!Config.local_browser)
|
||||||
Mpd->UpdateDirectory(FindSharedDir(old_dir, new_dir));
|
Mpd->UpdateDirectory(locale_to_utf_cpy(FindSharedDir(old_dir, new_dir)));
|
||||||
myBrowser->GetDirectory(myBrowser->CurrentDir());
|
myBrowser->GetDirectory(myBrowser->CurrentDir());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -422,6 +422,7 @@ void TagEditor::Update()
|
|||||||
Mpd->GetAlbums("", list);
|
Mpd->GetAlbums("", list);
|
||||||
for (TagList::const_iterator it = list.begin(); it != list.end(); it++)
|
for (TagList::const_iterator it = list.begin(); it != list.end(); it++)
|
||||||
{
|
{
|
||||||
|
|
||||||
SongList l;
|
SongList l;
|
||||||
Mpd->StartSearch(1);
|
Mpd->StartSearch(1);
|
||||||
Mpd->AddSearch(MPD_TAG_ITEM_ALBUM, *it);
|
Mpd->AddSearch(MPD_TAG_ITEM_ALBUM, *it);
|
||||||
@@ -662,7 +663,7 @@ void TagEditor::EnterPressed()
|
|||||||
w->Refresh();
|
w->Refresh();
|
||||||
w = LeftColumn;
|
w = LeftColumn;
|
||||||
LeftColumn->HighlightColor(Config.active_column_color);
|
LeftColumn->HighlightColor(Config.active_column_color);
|
||||||
Mpd->UpdateDirectory(FindSharedDir(Tags));
|
Mpd->UpdateDirectory(locale_to_utf_cpy(FindSharedDir(Tags)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Tags->Clear(0);
|
Tags->Clear(0);
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ class TagEditor : public Screen<Window>
|
|||||||
Menu<std::string> *TagTypes;
|
Menu<std::string> *TagTypes;
|
||||||
Menu<MPD::Song> *Tags;
|
Menu<MPD::Song> *Tags;
|
||||||
|
|
||||||
|
/// NOTICE: this string is always in utf8, no need to convert it
|
||||||
const std::string &CurrentDir() { return itsBrowsedDir; }
|
const std::string &CurrentDir() { return itsBrowsedDir; }
|
||||||
|
|
||||||
static void ReadTags(mpd_Song *);
|
static void ReadTags(mpd_Song *);
|
||||||
|
|||||||
Reference in New Issue
Block a user