~ubuntu-branches/ubuntu/quantal/kde-runtime/quantal

« back to all changes in this revision

Viewing changes to nepomuk/common/fileexcludefilters.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-06-03 21:50:00 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120603215000-vn7oarsq0ynrydj5
Tags: upstream-4.8.80
Import upstream version 4.8.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is part of the KDE Project
2
 
   Copyright (c) 2008-2010 Sebastian Trueg <trueg@kde.org>
3
 
 
4
 
   This library is free software; you can redistribute it and/or
5
 
   modify it under the terms of the GNU Library General Public
6
 
   License version 2 as published by the Free Software Foundation.
7
 
 
8
 
   This library is distributed in the hope that it will be useful,
9
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11
 
   Library General Public License for more details.
12
 
 
13
 
   You should have received a copy of the GNU Library General Public License
14
 
   along with this library; see the file COPYING.LIB.  If not, write to
15
 
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
 
   Boston, MA 02110-1301, USA.
17
 
*/
18
 
 
19
 
#include "fileexcludefilters.h"
20
 
 
21
 
namespace {
22
 
    const char* s_defaultFileExcludeFilters[] = {
23
 
        // tmp files
24
 
        "*~",
25
 
        "*.part",
26
 
 
27
 
        // temporary build files
28
 
        "*.o",
29
 
        "*.la",
30
 
        "*.lo",
31
 
        "*.loT",
32
 
        "*.moc",
33
 
        "moc_*.cpp",
34
 
        "cmake_install.cmake",
35
 
        "CMakeCache.txt",
36
 
        "CTestTestfile.cmake",
37
 
        "libtool",
38
 
        "config.status",
39
 
        "confdefs.h",
40
 
        "autom4te",
41
 
        "conftest",
42
 
        "confstat",
43
 
        "Makefile.am",
44
 
 
45
 
        // misc
46
 
        "*.csproj",
47
 
        "*.m4",
48
 
        "*.rej",
49
 
        "*.gmo",
50
 
        "*.pc",
51
 
        "*.omf",
52
 
        "*.aux",
53
 
        "*.tmp",
54
 
        "*.po",
55
 
        "*.vm*",
56
 
        "*.nvram",
57
 
        "*.rcore",
58
 
        "lzo",
59
 
        "litmain.sh",
60
 
        "*.orig",
61
 
        ".histfile.*",
62
 
        ".xsession-errors*",
63
 
 
64
 
        // Compiled files
65
 
        "*.class", // Java
66
 
        "*.pyc",   // Python
67
 
        "*.elc",   // Emacs Lisp
68
 
 
69
 
        // end of list
70
 
        0
71
 
    };
72
 
 
73
 
    const int s_defaultFileExcludeFiltersVersion = 2;
74
 
 
75
 
    const char* s_defaultFolderExcludeFilters[] = {
76
 
        "po",
77
 
 
78
 
        // VCS
79
 
        "CVS",
80
 
        ".svn",
81
 
        ".git",
82
 
        "_darcs",
83
 
        ".bzr",
84
 
        ".hg",
85
 
 
86
 
        // development
87
 
        "CMakeFiles",
88
 
        "CMakeTmp",
89
 
        "CMakeTmpQmake",
90
 
 
91
 
        //misc
92
 
        "core-dumps",
93
 
        "lost+found",
94
 
 
95
 
        // end of list
96
 
        0
97
 
    };
98
 
 
99
 
    const int s_defaultFolderExcludeFiltersVersion = 1;
100
 
}
101
 
 
102
 
 
103
 
QStringList Nepomuk::defaultExcludeFilterList()
104
 
{
105
 
    QStringList l;
106
 
    for ( int i = 0; s_defaultFileExcludeFilters[i]; ++i )
107
 
        l << QLatin1String( s_defaultFileExcludeFilters[i] );
108
 
    for ( int i = 0; s_defaultFolderExcludeFilters[i]; ++i )
109
 
        l << QLatin1String( s_defaultFolderExcludeFilters[i] );
110
 
    return l;
111
 
}
112
 
 
113
 
int Nepomuk::defaultExcludeFilterListVersion()
114
 
{
115
 
    return qMax(s_defaultFileExcludeFiltersVersion, s_defaultFolderExcludeFiltersVersion);
116
 
}