Sort by full title alphabetically.

This commit is contained in:
Don Honerbrink 2015-03-11 17:01:48 -05:00
parent f0604c1789
commit 0ecad71d2e
3 changed files with 10 additions and 1 deletions

View File

@ -91,7 +91,7 @@ std::vector<Item *> *CollectionInfo::GetItems()
bool CollectionInfo::ItemIsLess(Item const *lhs, Item const *rhs)
{
return lhs->GetLCTitle() < rhs->GetLCTitle();
return lhs->GetLCFullTitle() < rhs->GetLCFullTitle();
}
void CollectionInfo::SortItems()

View File

@ -114,6 +114,11 @@ const std::string& Item::GetLCTitle() const
return LCTitle;
}
const std::string& Item::GetLCFullTitle() const
{
return LCFullTitle;
}
void Item::SetTitle(const std::string& title)
{
Title = title;
@ -149,6 +154,8 @@ const std::string& Item::GetFullTitle() const
void Item::SetFullTitle(const std::string& fulltitle)
{
FullTitle = fulltitle;
LCFullTitle = fulltitle;
std::transform(LCFullTitle.begin(), LCFullTitle.end(), LCFullCTitle.begin(), ::tolower);
}
const std::string& Item::GetCloneOf() const

View File

@ -45,6 +45,7 @@ public:
bool IsLeaf() const;
void SetIsLeaf(bool leaf);
const std::string& GetFullTitle() const;
const std::string& GetLCFullTitle() const;
void SetFullTitle(const std::string& fulltitle);
const std::string& GetCloneOf() const;
void SetCloneOf(const std::string& cloneOf);
@ -56,6 +57,7 @@ private:
std::string Title;
std::string LCTitle;
std::string FullTitle;
std::string LCFullTitle;
std::string Year;
std::string Manufacturer;
std::string Genre;