Merge lp:~googol-deactivatedaccount/openlp/bug-791814 into lp:openlp

Proposed by Andreas Preikschat
Status: Merged
Approved by: Raoul Snyman
Approved revision: 1606
Merged at revision: 1606
Proposed branch: lp:~googol-deactivatedaccount/openlp/bug-791814
Merge into: lp:openlp
Diff against target: 12 lines (+2/-0)
1 file modified
openlp/core/utils/languagemanager.py (+2/-0)
To merge this branch: bzr merge lp:~googol-deactivatedaccount/openlp/bug-791814
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Jonathan Corwin (community) Approve
Review via email: mp+63239@code.launchpad.net

Description of the change

Hello,

Fixes bug #791814 "Windows: Language Menu shows wrong entries"

To post a comment you must log in.
Revision history for this message
Jonathan Corwin (j-corwin) wrote :

Why have you used QRegExp rather than the python re package?

review: Needs Information
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote :

> Why have you used QRegExp rather than the python re package?
Because file_names is a QStringList.

Revision history for this message
Jonathan Corwin (j-corwin) wrote :

Well now I've read up on negative lookaheads (my head hurts), I think I'm happy!

review: Approve
Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/utils/languagemanager.py'
2--- openlp/core/utils/languagemanager.py 2011-05-26 17:11:22 +0000
3+++ openlp/core/utils/languagemanager.py 2011-06-02 14:06:04 +0000
4@@ -77,6 +77,8 @@
5 AppLocation.LanguageDir))
6 file_names = trans_dir.entryList(QtCore.QStringList(u'*.qm'),
7 QtCore.QDir.Files, QtCore.QDir.Name)
8+ # Remove qm files from the list which start with "qt_".
9+ file_names = file_names.filter(QtCore.QRegExp("^(?!qt_)"))
10 for name in file_names:
11 file_names.replaceInStrings(name, trans_dir.filePath(name))
12 return file_names