Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libcontacts
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mer-core-attic
libcontacts
Commits
9deb603a
Commit
9deb603a
authored
Feb 21, 2019
by
chriadam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[libcontacts] Replace name group with display label group. Contributes to JB#44742
parent
7a6dfca5
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
227 deletions
+82
-227
src/seasidecache.cpp
src/seasidecache.cpp
+63
-149
src/seasidecache.h
src/seasidecache.h
+18
-23
src/seasidenamegrouper.h
src/seasidenamegrouper.h
+0
-52
src/src.pro
src/src.pro
+1
-3
No files found.
src/seasidecache.cpp
View file @
9deb603a
This diff is collapsed.
Click to expand it.
src/seasidecache.h
View file @
9deb603a
...
...
@@ -34,7 +34,6 @@
#include "contactcacheexport.h"
#include "cacheconfiguration.h"
#include "seasidenamegrouper.h"
#include <qtcontacts-extensions.h>
#include <QContactStatusFlags>
...
...
@@ -62,13 +61,13 @@
QTCONTACTS_USE_NAMESPACE
class
CONTACTCACHE_EXPORT
Seaside
Name
GroupChangeListener
class
CONTACTCACHE_EXPORT
Seaside
DisplayLabel
GroupChangeListener
{
public:
Seaside
Name
GroupChangeListener
()
{}
~
Seaside
Name
GroupChangeListener
()
{}
Seaside
DisplayLabel
GroupChangeListener
()
{}
~
Seaside
DisplayLabel
GroupChangeListener
()
{}
virtual
void
name
GroupsUpdated
(
const
QHash
<
QString
,
QSet
<
quint32
>
>
&
groups
)
=
0
;
virtual
void
displayLabel
GroupsUpdated
(
const
QHash
<
QString
,
QSet
<
quint32
>
>
&
groups
)
=
0
;
};
class
CONTACTCACHE_EXPORT
SeasideCache
:
public
QObject
...
...
@@ -200,7 +199,7 @@ public:
quint64
statusFlags
;
ContactState
contactState
;
ItemListener
*
listeners
;
QString
name
Group
;
QString
displayLabel
Group
;
QString
displayLabel
;
};
...
...
@@ -267,16 +266,14 @@ public:
static
void
registerUser
(
QObject
*
user
);
static
void
unregisterUser
(
QObject
*
user
);
static
void
register
NameGroupChangeListener
(
SeasideName
GroupChangeListener
*
listener
);
static
void
unregister
NameGroupChangeListener
(
SeasideName
GroupChangeListener
*
listener
);
static
void
register
DisplayLabelGroupChangeListener
(
SeasideDisplayLabel
GroupChangeListener
*
listener
);
static
void
unregister
DisplayLabelGroupChangeListener
(
SeasideDisplayLabel
GroupChangeListener
*
listener
);
static
void
registerChangeListener
(
ChangeListener
*
listener
);
static
void
unregisterChangeListener
(
ChangeListener
*
listener
);
static
void
unregisterResolveListener
(
ResolveListener
*
listener
);
static
void
setNameGrouper
(
SeasideNameGrouper
*
grouper
);
static
DisplayLabelOrder
displayLabelOrder
();
static
QString
sortProperty
();
static
QString
groupProperty
();
...
...
@@ -293,11 +290,9 @@ public:
static
void
ensureCompletion
(
CacheItem
*
cacheItem
);
static
void
refreshContact
(
CacheItem
*
cacheItem
);
static
QString
nameGroup
(
const
CacheItem
*
cacheItem
);
static
QString
determineNameGroup
(
const
CacheItem
*
cacheItem
);
static
QStringList
allNameGroups
();
static
QHash
<
QString
,
QSet
<
quint32
>
>
nameGroupMembers
();
static
QString
displayLabelGroup
(
const
CacheItem
*
cacheItem
);
static
QStringList
allDisplayLabelGroups
();
static
QHash
<
QString
,
QSet
<
quint32
>
>
displayLabelGroupMembers
();
static
CacheItem
*
itemByPhoneNumber
(
const
QString
&
number
,
bool
requireComplete
=
true
);
static
CacheItem
*
itemByEmailAddress
(
const
QString
&
address
,
bool
requireComplete
=
true
);
...
...
@@ -355,6 +350,7 @@ private slots:
void
contactsChanged
(
const
QList
<
QContactId
>
&
contactIds
);
void
contactsPresenceChanged
(
const
QList
<
QContactId
>
&
contactIds
);
void
contactsRemoved
(
const
QList
<
QContactId
>
&
contactIds
);
void
displayLabelGroupsChanged
(
const
QStringList
&
groups
);
void
displayLabelOrderChanged
(
CacheConfiguration
::
DisplayLabelOrder
order
);
void
sortPropertyChanged
(
const
QString
&
sortProperty
);
void
groupPropertyChanged
(
const
QString
&
groupProperty
);
...
...
@@ -396,9 +392,9 @@ private:
void
removeContactData
(
quint32
iid
,
FilterType
filter
);
void
makePopulated
(
FilterType
filter
);
void
addToContact
Name
Group
(
quint32
iid
,
const
QString
&
group
,
QSet
<
QString
>
*
modifiedGroups
=
0
);
void
removeFromContact
Name
Group
(
quint32
iid
,
const
QString
&
group
,
QSet
<
QString
>
*
modifiedGroups
=
0
);
void
notify
Name
GroupsChanged
(
const
QSet
<
QString
>
&
groups
);
void
addToContact
DisplayLabel
Group
(
quint32
iid
,
const
QString
&
group
,
QSet
<
QString
>
*
modifiedGroups
=
0
);
void
removeFromContact
DisplayLabel
Group
(
quint32
iid
,
const
QString
&
group
,
QSet
<
QString
>
*
modifiedGroups
=
0
);
void
notify
DisplayLabel
GroupsChanged
(
const
QSet
<
QString
>
&
groups
);
void
updateConstituentAggregations
(
const
QContactId
&
contactId
);
void
completeContactAggregation
(
const
QContactId
&
contact1Id
,
const
QContactId
&
contact2Id
);
...
...
@@ -421,7 +417,7 @@ private:
QHash
<
QString
,
quint32
>
m_emailAddressIds
;
QHash
<
QPair
<
QString
,
QString
>
,
quint32
>
m_onlineAccountIds
;
QHash
<
QContactId
,
QContact
>
m_contactsToSave
;
QHash
<
QString
,
QSet
<
quint32
>
>
m_contact
Name
Groups
;
QHash
<
QString
,
QSet
<
quint32
>
>
m_contact
DisplayLabel
Groups
;
QList
<
QContact
>
m_contactsToCreate
;
QHash
<
FilterType
,
QPair
<
QSet
<
QContactDetail
::
DetailType
>
,
QList
<
QContact
>
>
>
m_contactsToAppend
;
QList
<
QPair
<
QSet
<
QContactDetail
::
DetailType
>
,
QList
<
QContact
>
>
>
m_contactsToUpdate
;
...
...
@@ -435,8 +431,7 @@ private:
QList
<
QPair
<
ContactLinkRequest
,
ContactLinkRequest
>
>
m_contactPairsToLink
;
QList
<
QContactRelationship
>
m_relationshipsToSave
;
QList
<
QContactRelationship
>
m_relationshipsToRemove
;
QScopedPointer
<
SeasideNameGrouper
>
m_nameGrouper
;
QList
<
SeasideNameGroupChangeListener
*>
m_nameGroupChangeListeners
;
QList
<
SeasideDisplayLabelGroupChangeListener
*>
m_displayLabelGroupChangeListeners
;
QList
<
ChangeListener
*>
m_changeListeners
;
QList
<
ListModel
*>
m_models
[
FilterTypesCount
];
QSet
<
QObject
*>
m_users
;
...
...
@@ -490,8 +485,8 @@ private:
QElapsedTimer
m_fetchPostponed
;
static
SeasideCache
*
instancePtr
;
static
int
contact
Name
GroupCount
;
static
QStringList
allContact
Name
Groups
;
static
int
contact
DisplayLabel
GroupCount
;
static
QStringList
allContact
DisplayLabel
Groups
;
static
QTranslator
*
engEnTranslator
;
static
QTranslator
*
translator
;
...
...
src/seasidenamegrouper.h
deleted
100644 → 0
View file @
7a6dfca5
/*
* Copyright (C) 2013 Jolla Mobile <michael.brasser@jollamobile.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* "Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Nemo Mobile nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/
#ifndef SEASIDENAMEGROUPER_H
#define SEASIDENAMEGROUPER_H
#include "contactcacheexport.h"
#include <QList>
#include <QContact>
QTCONTACTS_USE_NAMESPACE
class
CONTACTCACHE_EXPORT
SeasideNameGrouper
{
public:
SeasideNameGrouper
()
{}
virtual
~
SeasideNameGrouper
()
{}
virtual
QString
nameGroupForContact
(
const
QContact
&
contact
,
const
QString
&
groupProperty
)
const
=
0
;
virtual
QStringList
allNameGroups
()
const
=
0
;
};
#endif // SEASIDENAMEGROUPER_H
src/src.pro
View file @
9deb603a
...
...
@@ -21,7 +21,7 @@ packagesExist(mlite5) {
}
else
{
warning
(
"mlite not available. Some functionality may not work as expected."
)
}
PKGCONFIG
+=
mlocale5
mce
PKGCONFIG
+=
mlocale5
mce
qtcontacts
-
sqlite
-
qt5
-
extensions
DEFINES
+=
CONTACTCACHE_BUILD
...
...
@@ -49,7 +49,6 @@ HEADERS += \
$$
PWD
/
seasideimport
.
h
\
$$
PWD
/
seasidecontactbuilder
.
h
\
$$
PWD
/
synchronizelists
.
h
\
$$
PWD
/
seasidenamegrouper
.
h
\
$$
PWD
/
seasidepropertyhandler
.
h
headers
.
files
=
\
...
...
@@ -60,7 +59,6 @@ headers.files = \
$$
PWD
/
seasideimport
.
h
\
$$
PWD
/
seasidecontactbuilder
.
h
\
$$
PWD
/
synchronizelists
.
h
\
$$
PWD
/
seasidenamegrouper
.
h
\
$$
PWD
/
seasidepropertyhandler
.
h
headers
.
path
=
$$
PREFIX
/
include
/
$$
TARGET
INSTALLS
+=
headers
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