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 Contacts
Commits
f8dadce7
Commit
f8dadce7
authored
Nov 24, 2015
by
Laurent Montel
😁
Browse files
Don't read config each time that we update item
parent
f7254507
Changes
3
Hide whitespace changes
Inline
Side-by-side
akonadi-contact/CMakeLists.txt
View file @
f8dadce7
...
...
@@ -19,7 +19,7 @@ include(ECMInstallIcons)
include
(
ECMQtDeclareLoggingCategory
)
set
(
KF5_VERSION
"5.16.0"
)
set
(
KDEPIMLIBS_VERSION
"5.1.4
1
"
)
set
(
KDEPIMLIBS_VERSION
"5.1.4
2
"
)
set
(
KCONTACTS_VERSION
"4.91.0"
)
set
(
CALENDARCORE_VERSION
"4.79.0"
)
set
(
KMIMELIB_VERSION
"4.79.0"
)
...
...
akonadi-contact/src/contactviewer.cpp
View file @
f8dadce7
...
...
@@ -60,6 +60,9 @@ public:
{
mStandardContactFormatter
=
new
StandardContactFormatter
;
mContactFormatter
=
mStandardContactFormatter
;
KConfig
config
(
QStringLiteral
(
"akonadi_contactrc"
));
KConfigGroup
group
(
&
config
,
QStringLiteral
(
"View"
));
mShowQRCode
=
group
.
readEntry
(
"QRCodes"
,
true
);
#ifdef HAVE_PRISON
mQRCode
=
new
prison
::
QRCodeBarcode
();
mDataMatrix
=
new
prison
::
DataMatrixBarcode
();
...
...
@@ -147,9 +150,7 @@ public:
defaultSmsPixmap
);
#ifdef HAVE_PRISON
KConfig
config
(
QStringLiteral
(
"akonadi_contactrc"
));
KConfigGroup
group
(
&
config
,
QStringLiteral
(
"View"
));
if
(
group
.
readEntry
(
"QRCodes"
,
true
))
{
if
(
mShowQRCode
)
{
KContacts
::
VCardConverter
converter
;
KContacts
::
Addressee
addr
(
mCurrentContact
);
addr
.
setPhoto
(
KContacts
::
Picture
());
...
...
@@ -268,6 +269,7 @@ public:
AbstractContactFormatter
*
mContactFormatter
;
AbstractContactFormatter
*
mStandardContactFormatter
;
CollectionFetchJob
*
mParentCollectionFetchJob
;
bool
mShowQRCode
;
#ifdef HAVE_PRISON
prison
::
AbstractBarcode
*
mQRCode
;
prison
::
AbstractBarcode
*
mDataMatrix
;
...
...
@@ -360,4 +362,17 @@ void ContactViewer::updateView()
itemChanged
(
d
->
mCurrentItem
);
}
void
ContactViewer
::
setShowQRCode
(
bool
b
)
{
if
(
d
->
mShowQRCode
!=
b
)
{
d
->
mShowQRCode
=
b
;
updateView
();
}
}
bool
ContactViewer
::
showQRCode
()
const
{
return
d
->
mShowQRCode
;
}
#include
"moc_contactviewer.cpp"
akonadi-contact/src/contactviewer.h
View file @
f8dadce7
...
...
@@ -119,6 +119,11 @@ public:
*/
void
updateView
();
/**
* @since 5.2
*/
void
setShowQRCode
(
bool
b
);
bool
showQRCode
()
const
;
public
Q_SLOTS
:
/**
* Sets the @p contact that shall be displayed in the viewer.
...
...
Write
Preview
Supports
Markdown
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