2
This file is part of the Nepomuk KDE project.
3
Copyright (C) 2010 Vishesh Handa <handa.vish@gmail.com>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) version 3, or any
9
later version accepted by the membership of KDE e.V. (or its
10
successor approved by the membership of KDE e.V.), which shall
11
act as a proxy defined in Section 6 of version 3 of the license.
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library. If not, see <http://www.gnu.org/licenses/>.
24
#ifndef CHANGELOGMERGER_H
25
#define CHANGELOGMERGER_H
27
#include "resourcemerger.h"
28
#include "simpleresource.h"
29
#include "changelog.h"
30
#include "resourcelog.h"
32
#include <QtCore/QDateTime>
35
class ChangeLogMerger : public Sync::ResourceMerger
38
ChangeLogMerger( ChangeLog log );
41
void mergeChangeLog();
44
* Converts the contents of the LogFile into the MergeHash
45
* The LogFile can get rather large, so this could be a time consuming
50
QList<Soprano::Statement> multipleMergers() const;
54
QDateTime m_minDateTime;
56
QList<Sync::SimpleResource> m_jobs;
57
QList<Soprano::Statement> m_multipleMergers;
59
/// Contains all the records from the LogFile
60
ResourceLogMap m_hash;
68
* Handles the case when the Resource's metadata has been deleted from
70
* \return true if resUri was deleted, false otherwsie
72
bool handleResourceDeletion( const KUrl & resUri );
75
* Resolve conflicts for properties with multiple cardinalities. It works by locally
76
* making all the changes in the SimpleResource.
78
void resolveMultipleCardinality( const QList<ChangeLogRecord >& theirRecords, const QList<ChangeLogRecord >& ownRecords );
81
* Same as multiple Cardinality resolution, but a lot faster. It figures out which statement
82
* should be present by looking at the max time stamp.
84
void resolveSingleCardinality( const QList< Nepomuk::ChangeLogRecord >& theirRecords, const QList< Nepomuk::ChangeLogRecord >& ownRecords );
88
#endif // CHANGELOGMERGER_H