Hi,
I'm a longtime (10+ year) user of MythTv, but I think this is my first
attempt at submitting a patch. The video library code currently ignores
the 'The|A|An' prefixes when sorting video names, but it doesn't do so
when sorting directory names. This is most noticeable for me in the TV
section of my video library where the files are all grouped into
folders by show name and season. I have a couple of line patch to 0.28
that adds support for ignoring common prefixes on directories. I wanted
to run it past this list to see if its acceptable before creating a
Trac entry. Thanks.
David
diff --git a/mythtv/programs/mythfrontend/videolist.cpp
b/mythtv/programs/mythfrontend/videolist.cpp
index 7bcbda0..926c0a8 100644
--- a/mythtv/programs/mythfrontend/videolist.cpp
+++ b/mythtv/programs/mythfrontend/videolist.cpp
@@ -195,8 +195,9 @@ struct metadata_path_sort
Â
     bool sort(const QString &lhs, const QString &rhs)
     {
-Â Â Â Â Â Â Â Â QString lhs_comp(lhs);
-Â Â Â Â Â Â Â Â QString rhs_comp(rhs);
+Â Â Â Â Â Â Â Â const QRegExp prefixes = QRegExp(QObject::tr("^(The |A |An
)"));
+Â Â Â Â Â Â Â Â QString lhs_comp = QString(lhs).remove(prefixes);
+Â Â Â Â Â Â Â Â QString rhs_comp = QString(rhs).remove(prefixes);
         if (m_ignore_case)
         {
             lhs_comp = lhs_comp.toLower();
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
I'm a longtime (10+ year) user of MythTv, but I think this is my first
attempt at submitting a patch. The video library code currently ignores
the 'The|A|An' prefixes when sorting video names, but it doesn't do so
when sorting directory names. This is most noticeable for me in the TV
section of my video library where the files are all grouped into
folders by show name and season. I have a couple of line patch to 0.28
that adds support for ignoring common prefixes on directories. I wanted
to run it past this list to see if its acceptable before creating a
Trac entry. Thanks.
David
diff --git a/mythtv/programs/mythfrontend/videolist.cpp
b/mythtv/programs/mythfrontend/videolist.cpp
index 7bcbda0..926c0a8 100644
--- a/mythtv/programs/mythfrontend/videolist.cpp
+++ b/mythtv/programs/mythfrontend/videolist.cpp
@@ -195,8 +195,9 @@ struct metadata_path_sort
Â
     bool sort(const QString &lhs, const QString &rhs)
     {
-Â Â Â Â Â Â Â Â QString lhs_comp(lhs);
-Â Â Â Â Â Â Â Â QString rhs_comp(rhs);
+Â Â Â Â Â Â Â Â const QRegExp prefixes = QRegExp(QObject::tr("^(The |A |An
)"));
+Â Â Â Â Â Â Â Â QString lhs_comp = QString(lhs).remove(prefixes);
+Â Â Â Â Â Â Â Â QString rhs_comp = QString(rhs).remove(prefixes);
         if (m_ignore_case)
         {
             lhs_comp = lhs_comp.toLower();
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org