Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Akonadi Search
Commits
11bc34aa
Commit
11bc34aa
authored
Mar 11, 2022
by
Laurent Montel
😁
Browse files
const'ify + use Q_REQUIRED_RESULT
parent
3e5b0cbc
Pipeline
#148083
passed with stage
in 2 minutes and 1 second
Changes
17
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/term.h
View file @
11bc34aa
...
...
@@ -58,7 +58,7 @@ public:
Term
(
const
Term
&
lhs
,
Operation
op
,
const
Term
&
rhs
);
~
Term
();
bool
isValid
()
const
;
Q_REQUIRED_RESULT
bool
isValid
()
const
;
/**
* Negate this term. Negation only applies for Equal or Contains
...
...
@@ -66,8 +66,8 @@ public:
*/
void
setNegation
(
bool
isNegated
);
bool
negated
()
const
;
bool
isNegated
()
const
;
Q_REQUIRED_RESULT
bool
negated
()
const
;
Q_REQUIRED_RESULT
bool
isNegated
()
const
;
void
addSubTerm
(
const
Term
&
term
);
void
setSubTerms
(
const
QList
<
Term
>
&
terms
);
...
...
@@ -75,31 +75,31 @@ public:
/**
* Returns the first subTerm in the list of subTerms
*/
Term
subTerm
()
const
;
QList
<
Term
>
subTerms
()
const
;
Q_REQUIRED_RESULT
Term
subTerm
()
const
;
Q_REQUIRED_RESULT
QList
<
Term
>
subTerms
()
const
;
void
setOperation
(
Operation
op
);
Operation
operation
()
const
;
Q_REQUIRED_RESULT
Operation
operation
()
const
;
bool
isEmpty
()
const
;
bool
empty
()
const
;
Q_REQUIRED_RESULT
bool
isEmpty
()
const
;
Q_REQUIRED_RESULT
bool
empty
()
const
;
/**
* Return the property this term is targeting
*/
QString
property
()
const
;
Q_REQUIRED_RESULT
QString
property
()
const
;
void
setProperty
(
const
QString
&
property
);
QVariant
value
()
const
;
Q_REQUIRED_RESULT
QVariant
value
()
const
;
void
setValue
(
const
QVariant
&
value
);
Comparator
comparator
()
const
;
Q_REQUIRED_RESULT
Comparator
comparator
()
const
;
void
setComparator
(
Comparator
c
);
void
setUserData
(
const
QString
&
name
,
const
QVariant
&
value
);
QVariant
userData
(
const
QString
&
name
)
const
;
Q_REQUIRED_RESULT
QVariant
userData
(
const
QString
&
name
)
const
;
QVariantMap
toVariantMap
()
const
;
Q_REQUIRED_RESULT
QVariantMap
toVariantMap
()
const
;
static
Term
fromVariantMap
(
const
QVariantMap
&
map
);
bool
operator
==
(
const
Term
&
rhs
)
const
;
...
...
debug/akonadisearchdebugsearchpathcombobox.cpp
View file @
11bc34aa
...
...
@@ -18,7 +18,7 @@ AkonadiSearchDebugSearchPathComboBox::AkonadiSearchDebugSearchPathComboBox(QWidg
AkonadiSearchDebugSearchPathComboBox
::~
AkonadiSearchDebugSearchPathComboBox
()
=
default
;
QString
AkonadiSearchDebugSearchPathComboBox
::
searchPath
()
QString
AkonadiSearchDebugSearchPathComboBox
::
searchPath
()
const
{
const
int
currentPathIndex
=
currentIndex
();
if
(
currentPathIndex
>
-
1
)
{
...
...
@@ -38,7 +38,7 @@ void AkonadiSearchDebugSearchPathComboBox::initialize()
addItem
(
QStringLiteral
(
"Calendars"
),
Calendars
);
}
QString
AkonadiSearchDebugSearchPathComboBox
::
pathFromEnum
(
SearchType
type
)
QString
AkonadiSearchDebugSearchPathComboBox
::
pathFromEnum
(
SearchType
type
)
const
{
switch
(
type
)
{
case
Contacts
:
...
...
@@ -63,7 +63,7 @@ void AkonadiSearchDebugSearchPathComboBox::setSearchType(AkonadiSearchDebugSearc
}
}
QString
AkonadiSearchDebugSearchPathComboBox
::
defaultLocations
(
const
QString
&
dbName
)
const
QString
AkonadiSearchDebugSearchPathComboBox
::
defaultLocations
(
const
QString
&
dbName
)
const
{
// First look into the old location from Baloo times in ~/.local/share/baloo,
// because we don't migrate the database files automatically.
...
...
debug/akonadisearchdebugsearchpathcombobox.h
View file @
11bc34aa
...
...
@@ -24,13 +24,13 @@ public:
enum
SearchType
{
Contacts
=
0
,
ContactCompleter
,
Emails
,
Notes
,
Calendars
};
~
AkonadiSearchDebugSearchPathComboBox
()
override
;
QString
searchPath
();
Q_REQUIRED_RESULT
QString
searchPath
()
const
;
QString
pathFromEnum
(
SearchType
type
);
Q_REQUIRED_RESULT
QString
pathFromEnum
(
SearchType
type
)
const
;
void
setSearchType
(
SearchType
type
);
private:
QString
defaultLocations
(
const
QString
&
dbname
);
const
QString
defaultLocations
(
const
QString
&
dbname
)
const
;
void
initialize
();
};
}
...
...
debug/akonadisearchdebugwidget.cpp
View file @
11bc34aa
...
...
@@ -19,6 +19,10 @@ using namespace Akonadi::Search;
AkonadiSearchDebugWidget
::
AkonadiSearchDebugWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
mPlainTextEditor
(
new
QPlainTextEdit
(
this
))
,
mSearchPathComboBox
(
new
Akonadi
::
Search
::
AkonadiSearchDebugSearchPathComboBox
(
this
))
,
mLineEdit
(
new
KLineEdit
(
this
))
,
mSearchButton
(
new
QPushButton
(
QStringLiteral
(
"Search"
),
this
))
{
auto
mainLayout
=
new
QVBoxLayout
(
this
);
...
...
@@ -26,24 +30,20 @@ AkonadiSearchDebugWidget::AkonadiSearchDebugWidget(QWidget *parent)
mainLayout
->
addLayout
(
hbox
);
auto
lab
=
new
QLabel
(
QStringLiteral
(
"Item identifier:"
),
this
);
hbox
->
addWidget
(
lab
);
mLineEdit
=
new
KLineEdit
(
this
);
mLineEdit
->
setTrapReturnKey
(
true
);
mLineEdit
->
setClearButtonEnabled
(
true
);
mLineEdit
->
setObjectName
(
QStringLiteral
(
"lineedit"
));
connect
(
mLineEdit
,
&
KLineEdit
::
textChanged
,
this
,
&
AkonadiSearchDebugWidget
::
slotSearchLineTextChanged
);
hbox
->
addWidget
(
mLineEdit
);
mSearchPathComboBox
=
new
Akonadi
::
Search
::
AkonadiSearchDebugSearchPathComboBox
(
this
);
hbox
->
addWidget
(
mSearchPathComboBox
);
mSearchPathComboBox
->
setObjectName
(
QStringLiteral
(
"searchpathcombo"
));
mSearchButton
=
new
QPushButton
(
QStringLiteral
(
"Search"
),
this
);
mSearchButton
->
setObjectName
(
QStringLiteral
(
"searchbutton"
));
connect
(
mSearchButton
,
&
QPushButton
::
clicked
,
this
,
&
AkonadiSearchDebugWidget
::
slotSearch
);
hbox
->
addWidget
(
mSearchButton
);
mSearchButton
->
setEnabled
(
false
);
mPlainTextEditor
=
new
QPlainTextEdit
(
this
);
new
AkonadiSearchSyntaxHighlighter
(
mPlainTextEditor
->
document
());
mPlainTextEditor
->
setReadOnly
(
true
);
mainLayout
->
addWidget
(
mPlainTextEditor
);
...
...
debug/akonadisearchdebugwidget.h
View file @
11bc34aa
...
...
@@ -31,7 +31,7 @@ public:
void
setSearchType
(
AkonadiSearchDebugSearchPathComboBox
::
SearchType
type
);
void
doSearch
();
QString
plainText
()
const
;
Q_REQUIRED_RESULT
QString
plainText
()
const
;
private
Q_SLOTS
:
void
slotSearchLineTextChanged
(
const
QString
&
text
);
...
...
@@ -41,9 +41,9 @@ private Q_SLOTS:
private:
QPlainTextEdit
*
mPlainTextEditor
=
nullptr
;
AkonadiSearchDebugSearchPathComboBox
*
mSearchPathComboBox
=
nullptr
;
KLineEdit
*
mLineEdit
=
nullptr
;
QPushButton
*
mSearchButton
=
nullptr
;
AkonadiSearchDebugSearchPathComboBox
*
const
mSearchPathComboBox
;
KLineEdit
*
const
mLineEdit
;
QPushButton
*
const
mSearchButton
;
};
}
}
lib/collectionquery.h
View file @
11bc34aa
...
...
@@ -44,7 +44,7 @@ public:
void
pathMatches
(
const
QString
&
match
);
void
setLimit
(
int
limit
);
int
limit
()
const
;
Q_REQUIRED_RESULT
int
limit
()
const
;
/**
* Execute the query and return an iterator to fetch
...
...
lib/contactquery.h
View file @
11bc34aa
...
...
@@ -45,7 +45,7 @@ public:
ResultIterator
exec
()
override
;
int
limit
()
const
;
Q_REQUIRED_RESULT
int
limit
()
const
;
void
setLimit
(
int
limit
);
private:
...
...
lib/emailquery.h
View file @
11bc34aa
...
...
@@ -88,7 +88,7 @@ public:
void
bodyMatches
(
const
QString
&
bodyMatch
);
void
setLimit
(
int
limit
);
int
limit
()
const
;
Q_REQUIRED_RESULT
int
limit
()
const
;
/**
* Execute the query and return an iterator to fetch
...
...
lib/indexeditems.h
View file @
11bc34aa
...
...
@@ -36,12 +36,12 @@ public:
void
findIndexedInDatabase
(
QSet
<
Akonadi
::
Item
::
Id
>
&
indexed
,
Akonadi
::
Collection
::
Id
collectionId
,
const
QString
&
dbPath
);
void
findIndexed
(
QSet
<
Akonadi
::
Item
::
Id
>
&
indexed
,
Akonadi
::
Collection
::
Id
collectionId
);
QString
emailIndexingPath
()
const
;
QString
collectionIndexingPath
()
const
;
QString
calendarIndexingPath
()
const
;
QString
akonotesIndexingPath
()
const
;
QString
emailContactsIndexingPath
()
const
;
QString
contactIndexingPath
()
const
;
Q_REQUIRED_RESULT
QString
emailIndexingPath
()
const
;
Q_REQUIRED_RESULT
QString
collectionIndexingPath
()
const
;
Q_REQUIRED_RESULT
QString
calendarIndexingPath
()
const
;
Q_REQUIRED_RESULT
QString
akonotesIndexingPath
()
const
;
Q_REQUIRED_RESULT
QString
emailContactsIndexingPath
()
const
;
Q_REQUIRED_RESULT
QString
contactIndexingPath
()
const
;
private:
std
::
unique_ptr
<
IndexedItemsPrivate
>
const
d
;
...
...
lib/notequery.h
View file @
11bc34aa
...
...
@@ -35,7 +35,7 @@ public:
void
matchNote
(
const
QString
&
note
);
void
setLimit
(
int
limit
);
int
limit
()
const
;
Q_REQUIRED_RESULT
int
limit
()
const
;
ResultIterator
exec
()
override
;
...
...
runner/pimcontactsrunnerconfig.cpp
View file @
11bc34aa
...
...
@@ -17,10 +17,10 @@ K_PLUGIN_FACTORY(PIMContactsRunnerConfigFactory, registerPlugin<PIMContactsRunne
PIMContactsRunnerConfig
::
PIMContactsRunnerConfig
(
QWidget
*
parent
,
const
QVariantList
&
args
)
:
KCModule
(
parent
,
args
)
,
mQueryCompletionCheckBox
(
new
QCheckBox
(
i18n
(
"Search in contacts indexed from sent and received emails too"
),
this
))
{
auto
vbox
=
new
QVBoxLayout
(
this
);
mQueryCompletionCheckBox
=
new
QCheckBox
(
i18n
(
"Search in contacts indexed from sent and received emails too"
),
this
);
connect
(
mQueryCompletionCheckBox
,
&
QCheckBox
::
stateChanged
,
this
,
&
PIMContactsRunnerConfig
::
configChanged
);
vbox
->
addWidget
(
mQueryCompletionCheckBox
);
...
...
runner/pimcontactsrunnerconfig.h
View file @
11bc34aa
...
...
@@ -24,6 +24,6 @@ public Q_SLOTS:
private:
void
configChanged
();
QCheckBox
*
mQueryCompletionCheckBox
=
nullptr
;
QCheckBox
*
const
mQueryCompletionCheckBox
;
};
search/calendar/calendarsearchstore.h
View file @
11bc34aa
...
...
@@ -24,7 +24,7 @@ class CalendarSearchStore : public PIMSearchStore
public:
explicit
CalendarSearchStore
(
QObject
*
parent
=
nullptr
);
QStringList
types
()
override
;
Q_REQUIRED_RESULT
QStringList
types
()
override
;
};
}
}
search/contact/contactsearchstore.h
View file @
11bc34aa
...
...
@@ -24,7 +24,7 @@ class ContactSearchStore : public PIMSearchStore
public:
explicit
ContactSearchStore
(
QObject
*
parent
=
nullptr
);
QStringList
types
()
override
;
Q_REQUIRED_RESULT
QStringList
types
()
override
;
};
}
}
search/email/emailsearchstore.h
View file @
11bc34aa
...
...
@@ -24,9 +24,9 @@ class EmailSearchStore : public PIMSearchStore
public:
explicit
EmailSearchStore
(
QObject
*
parent
=
nullptr
);
QStringList
types
()
override
;
Q_REQUIRED_RESULT
QStringList
types
()
override
;
QString
text
(
int
queryId
)
override
;
QString
icon
(
int
)
override
Q_REQUIRED_RESULT
QString
icon
(
int
)
override
{
return
QStringLiteral
(
"internet-mail"
);
}
...
...
search/note/notesearchstore.h
View file @
11bc34aa
...
...
@@ -24,7 +24,7 @@ class NoteSearchStore : public PIMSearchStore
public:
explicit
NoteSearchStore
(
QObject
*
parent
=
nullptr
);
QStringList
types
()
override
;
Q_REQUIRED_RESULT
QStringList
types
()
override
;
};
}
}
xapian/xapiandatabase.h
View file @
11bc34aa
...
...
@@ -61,7 +61,7 @@ public:
* Returns true if the XapianDatabase has changes which need to
* be committed
*/
bool
haveChanges
()
const
;
Q_REQUIRED_RESULT
bool
haveChanges
()
const
;
private:
Xapian
::
Database
*
m_db
=
nullptr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment