• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Nepomuk-Core

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk-core
  • libnepomukcore
  • query
filequery.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the Nepomuk KDE project.
3  Copyright (C) 2008-2010 Sebastian Trueg <trueg@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library 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 GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18  */
19 
20 #include "filequery.h"
21 #include "query_p.h"
22 
23 Nepomuk2::Query::FileQuery::FileQuery()
24  : Query()
25 {
26  d->m_isFileQuery = true;
27 }
28 
29 
30 Nepomuk2::Query::FileQuery::FileQuery( const Term& term )
31  : Query( term )
32 {
33  d->m_isFileQuery = true;
34 }
35 
36 
37 Nepomuk2::Query::FileQuery::FileQuery( const Query& query )
38  : Query( query )
39 {
40  d->m_isFileQuery = true;
41 }
42 
43 
44 Nepomuk2::Query::FileQuery::~FileQuery()
45 {
46 }
47 
48 
49 Nepomuk2::Query::FileQuery& Nepomuk2::Query::FileQuery::operator=( const Query& query )
50 {
51  Query::operator=( query );
52  d->m_isFileQuery = true;
53  return *this;
54 }
55 
56 
57 void Nepomuk2::Query::FileQuery::addIncludeFolder( const KUrl& folder )
58 {
59  addIncludeFolder( folder, true );
60 }
61 
62 
63 void Nepomuk2::Query::FileQuery::addIncludeFolder( const KUrl& folder, bool recursive )
64 {
65  d->m_includeFolders[folder] = recursive;
66 }
67 
68 
69 void Nepomuk2::Query::FileQuery::setIncludeFolders( const KUrl::List& folders )
70 {
71  d->m_includeFolders.clear();
72  Q_FOREACH( const KUrl& url, folders ) {
73  d->m_includeFolders[url] = true;
74  }
75 }
76 
77 
78 void Nepomuk2::Query::FileQuery::setIncludeFolders( const QHash<KUrl, bool>& folders )
79 {
80  d->m_includeFolders = folders;
81 }
82 
83 
84 KUrl::List Nepomuk2::Query::FileQuery::includeFolders() const
85 {
86  return d->m_includeFolders.keys();
87 }
88 
89 
90 QHash<KUrl, bool> Nepomuk2::Query::FileQuery::allIncludeFolders() const
91 {
92  return d->m_includeFolders;
93 }
94 
95 
96 void Nepomuk2::Query::FileQuery::addExcludeFolder( const KUrl& folder )
97 {
98  d->m_excludeFolders << folder;
99 }
100 
101 
102 void Nepomuk2::Query::FileQuery::setExcludeFolders( const KUrl::List& folders )
103 {
104  d->m_excludeFolders = folders;
105 }
106 
107 
108 KUrl::List Nepomuk2::Query::FileQuery::excludeFolders() const
109 {
110  return d->m_excludeFolders;
111 }
112 
113 
114 void Nepomuk2::Query::FileQuery::setFileMode( FileMode mode )
115 {
116  d->m_fileMode = mode;
117 }
118 
119 
120 Nepomuk2::Query::FileQuery::FileMode Nepomuk2::Query::FileQuery::fileMode() const
121 {
122  return d->m_fileMode;
123 }
Nepomuk2::Query::FileQuery::addExcludeFolder
void addExcludeFolder(const KUrl &folder)
Add a folder to exclude from the search.
Definition: filequery.cpp:96
Nepomuk2::Query::FileQuery::FileQuery
FileQuery()
Create an empty invalid file query object.
Definition: filequery.cpp:23
Nepomuk2::Query::Term
The base class for all term types.
Definition: term.h:64
QHash
Nepomuk2::Query::FileQuery::excludeFolders
KUrl::List excludeFolders() const
The list of exclude folders set via addExcludeFolder() and setExcludeFolders().
Definition: filequery.cpp:108
Nepomuk2::Query::FileQuery::includeFolders
KUrl::List includeFolders() const
The list of include folders set via addIncludeFolder() and setIncludeFolders().
Definition: filequery.cpp:84
Nepomuk2::Query::FileQuery::allIncludeFolders
QHash< KUrl, bool > allIncludeFolders() const
The hash of include folders set via addIncludeFolder() and setIncludeFolders() including their recurs...
Definition: filequery.cpp:90
Nepomuk2::Query::FileQuery::operator=
FileQuery & operator=(const Query &)
Assignment operator.
Definition: filequery.cpp:49
Nepomuk2::Query::FileQuery
A Nepomuk desktop query specialized for file searches.
Definition: filequery.h:44
Nepomuk2::Query::Query
A Nepomuk desktop query.
Definition: query.h:76
Nepomuk2::Query::FileQuery::setExcludeFolders
void setExcludeFolders(const KUrl::List &folders)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: filequery.cpp:102
Nepomuk2::Query::FileQuery::~FileQuery
~FileQuery()
Destructor.
Definition: filequery.cpp:44
Nepomuk2::Query::FileQuery::setFileMode
void setFileMode(FileMode mode)
Set the file mode, i.e.
Definition: filequery.cpp:114
Nepomuk2::Query::FileQuery::addIncludeFolder
void addIncludeFolder(const KUrl &folder)
Add a folder to include in the search.
Definition: filequery.cpp:57
Nepomuk2::Query::FileQuery::setIncludeFolders
void setIncludeFolders(const KUrl::List &folders)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: filequery.cpp:69
filequery.h
Nepomuk2::Query::FileQuery::fileMode
FileMode fileMode() const
Definition: filequery.cpp:120
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal