1 /*
2 * Copyright (C) 1999-2002 Bernd Gehrmann
3 * bernd@mail.berlios.de
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20
21 #include "cvsdir.h"
22
23 #include "dirignorelist.h"
24 #include "globalignorelist.h"
25 using namespace Cervisia;
26
27
CvsDir(const QString & path)28 CvsDir::CvsDir(const QString &path)
29 : QDir( path, 0, QDir::Name,
30 QDir::TypeMask | QDir::Hidden | QDir::NoSymLinks )
31 {}
32
33
entryInfoList() const34 const QFileInfoList *CvsDir::entryInfoList() const
35 {
36 DirIgnoreList ignorelist(absolutePath());
37 const QFileInfoList& fulllist = QDir::entryInfoList();
38 if (fulllist.empty())
39 return 0;
40
41 entrylist.clear();
42
43 Q_FOREACH (const QFileInfo &info, fulllist)
44 {
45 if (!ignorelist.matches(&info) && !GlobalIgnoreList().matches(&info))
46 entrylist.append(info);
47 }
48
49 return &entrylist;
50 }
51
52
53 // Local Variables:
54 // c-basic-offset: 4
55 // End:
56