source: smplayer/vendor/current/src/extensions.cpp@ 163

Last change on this file since 163 was 163, checked in by Silvan Scherrer, 12 years ago

SMPlayer: update vendor to 0.8.7

File size: 2.4 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2014 Ricardo Villalba <[email protected]>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18
19#include "extensions.h"
20
21ExtensionList::ExtensionList() : QStringList()
22{
23}
24
25QString ExtensionList::forFilter() {
26 QString s;
27 for (int n=0; n < count(); n++) {
28 s = s + "*." + at(n) + " ";
29 }
30 if (!s.isEmpty()) s = " (" + s + ")";
31 return s;
32}
33
34QStringList ExtensionList::forDirFilter() {
35 QStringList l;
36 for (int n=0; n < count(); n++) {
37 QString s = "*." + at(n);
38 l << s;
39 }
40 return l;
41}
42
43QString ExtensionList::forRegExp() {
44 QString s;
45 for (int n=0; n < count(); n++) {
46 if (!s.isEmpty()) s = s + "|";
47 s = s + "^" + at(n) + "$";
48 }
49 return s;
50}