Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Pim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Unmaintained
KDE Pim
Commits
3364444c
Commit
3364444c
authored
Jun 17, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new Akonadi::Search::PIM::IndexedItems
parent
6587747f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
22 deletions
+34
-22
kmail/src/CMakeLists.txt
kmail/src/CMakeLists.txt
+1
-0
kmail/src/search/checkindexingjob.cpp
kmail/src/search/checkindexingjob.cpp
+7
-19
kmail/src/search/checkindexingjob.h
kmail/src/search/checkindexingjob.h
+12
-2
kmail/src/search/checkindexingmanager.cpp
kmail/src/search/checkindexingmanager.cpp
+3
-1
kmail/src/search/checkindexingmanager.h
kmail/src/search/checkindexingmanager.h
+11
-0
No files found.
kmail/src/CMakeLists.txt
View file @
3364444c
...
...
@@ -300,6 +300,7 @@ target_link_libraries(kmailprivate
KF5::Completion
KF5::Ldap
KF5::AkonadiSearchDebug
KF5::AkonadiSearchPIM
KF5::WebEngineViewer
)
target_include_directories
(
kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MessageList,INTERFACE_INCLUDE_DIRECTORIES>
)
...
...
kmail/src/search/checkindexingjob.cpp
View file @
3364444c
...
...
@@ -19,6 +19,7 @@
#include "checkindexingjob.h"
#include "kmail_debug.h"
#include <AkonadiSearch/PIM/indexeditems.h>
#include <AkonadiCore/CollectionFetchJob>
#include <AkonadiCore/CollectionFetchScope>
...
...
@@ -29,8 +30,9 @@
#include <QDBusInterface>
#include <QDebug>
CheckIndexingJob
::
CheckIndexingJob
(
QObject
*
parent
)
:
QObject
(
parent
)
CheckIndexingJob
::
CheckIndexingJob
(
Akonadi
::
Search
::
PIM
::
IndexedItems
*
indexedItems
,
QObject
*
parent
)
:
QObject
(
parent
),
mIndexedItems
(
indexedItems
)
{
}
...
...
@@ -75,23 +77,9 @@ void CheckIndexingJob::slotCollectionPropertiesFinished(KJob *job)
}
mCollection
=
fetch
->
collections
().
first
();
PimCommon
::
CollectionIndexStatusJob
*
indexerJob
=
new
PimCommon
::
CollectionIndexStatusJob
(
Akonadi
::
Collection
::
List
()
<<
mCollection
,
this
);
connect
(
indexerJob
,
&
PimCommon
::
CollectionIndexStatusJob
::
finished
,
this
,
&
CheckIndexingJob
::
indexerStatsFetchFinished
);
indexerJob
->
start
();
}
void
CheckIndexingJob
::
indexerStatsFetchFinished
(
KJob
*
job
)
{
if
(
job
->
error
())
{
qCWarning
(
KMAIL_LOG
)
<<
"CheckIndexingJob::indexerStatsFetchFinished error :"
<<
job
->
errorString
();
askForNextCheck
(
-
1
);
return
;
}
QMap
<
qint64
,
qint64
>
stats
=
qobject_cast
<
PimCommon
::
CollectionIndexStatusJob
*>
(
job
)
->
resultStats
();
//qDebug()<<" stats "<< stats;
qCDebug
(
KMAIL_LOG
)
<<
" mCollection.statistics().count() "
<<
mCollection
.
statistics
().
count
()
<<
"stats.value(mCollection.id())"
<<
stats
.
value
(
mCollection
.
id
());
if
(
mCollection
.
statistics
().
count
()
!=
stats
.
value
(
mCollection
.
id
()))
{
const
qlonglong
result
=
mIndexedItems
->
indexedItems
(
mCollection
.
id
());
qCDebug
(
KMAIL_LOG
)
<<
" mCollection.statistics().count() "
<<
mCollection
.
statistics
().
count
()
<<
"stats.value(mCollection.id())"
<<
result
;
if
(
mCollection
.
statistics
().
count
()
!=
result
)
{
QDBusInterface
interfaceBalooIndexer
(
PimCommon
::
indexerServiceName
(),
QStringLiteral
(
"/"
),
QStringLiteral
(
"org.freedesktop.Akonadi.Indexer"
));
if
(
interfaceBalooIndexer
.
isValid
())
{
qCDebug
(
KMAIL_LOG
)
<<
"Reindex collection :"
<<
mCollection
.
id
()
<<
"name :"
<<
mCollection
.
name
();
...
...
kmail/src/search/checkindexingjob.h
View file @
3364444c
...
...
@@ -22,12 +22,22 @@
#include <QObject>
#include <AkonadiCore/Collection>
namespace
Akonadi
{
namespace
Search
{
namespace
PIM
{
class
IndexedItems
;
}
}
}
class
KJob
;
class
CheckIndexingJob
:
public
QObject
{
Q_OBJECT
public:
explicit
CheckIndexingJob
(
QObject
*
parent
=
Q_NULLPTR
);
explicit
CheckIndexingJob
(
Akonadi
::
Search
::
PIM
::
IndexedItems
*
indexedItems
,
QObject
*
parent
=
Q_NULLPTR
);
~
CheckIndexingJob
();
void
setCollection
(
const
Akonadi
::
Collection
&
col
);
...
...
@@ -39,10 +49,10 @@ Q_SIGNALS:
private
Q_SLOTS
:
void
slotCollectionPropertiesFinished
(
KJob
*
job
);
void
indexerStatsFetchFinished
(
KJob
*
job
);
private:
void
askForNextCheck
(
quint64
id
);
Akonadi
::
Collection
mCollection
;
Akonadi
::
Search
::
PIM
::
IndexedItems
*
mIndexedItems
;
};
#endif // CHECKINDEXINGJOB_H
kmail/src/search/checkindexingmanager.cpp
View file @
3364444c
...
...
@@ -27,11 +27,13 @@
#include <KConfigGroup>
#include <MailCommon/MailUtil>
#include <PimCommon/PimUtil>
#include <AkonadiSearch/PIM/indexeditems.h>
#include <QTimer>
#include <AkonadiCore/entityhiddenattribute.h>
CheckIndexingManager
::
CheckIndexingManager
(
QObject
*
parent
)
:
QObject
(
parent
),
mIndexedItems
(
new
Akonadi
::
Search
::
PIM
::
IndexedItems
(
this
)),
mIndex
(
0
),
mIsReady
(
true
)
{
...
...
@@ -74,7 +76,7 @@ void CheckIndexingManager::start(QAbstractItemModel *collectionModel)
void
CheckIndexingManager
::
createJob
()
{
CheckIndexingJob
*
job
=
new
CheckIndexingJob
(
this
);
CheckIndexingJob
*
job
=
new
CheckIndexingJob
(
mIndexedItems
,
this
);
job
->
setCollection
(
mListCollection
.
at
(
mIndex
));
connect
(
job
,
&
CheckIndexingJob
::
finished
,
this
,
&
CheckIndexingManager
::
indexingFinished
);
job
->
start
();
...
...
kmail/src/search/checkindexingmanager.h
View file @
3364444c
...
...
@@ -23,6 +23,16 @@
#include <QObject>
#include <AkonadiCore/Collection>
#include <QAbstractItemModel>
namespace
Akonadi
{
namespace
Search
{
namespace
PIM
{
class
IndexedItems
;
}
}
}
class
QTimer
;
class
CheckIndexingManager
:
public
QObject
{
...
...
@@ -41,6 +51,7 @@ private:
void
initializeCollectionList
(
QAbstractItemModel
*
model
,
const
QModelIndex
&
parentIndex
=
QModelIndex
());
void
createJob
();
Akonadi
::
Search
::
PIM
::
IndexedItems
*
mIndexedItems
;
Akonadi
::
Collection
::
List
mListCollection
;
QTimer
*
mTimer
;
QList
<
qint64
>
mCollectionsIndexed
;
...
...
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