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
41fce3e1
Commit
41fce3e1
authored
Nov 29, 2015
by
Laurent Montel
😁
Browse files
Astyle kdelibs
parent
499a136c
Changes
11
Hide whitespace changes
Inline
Side-by-side
akonadi-contact/src/contactsearchjob.cpp
View file @
41fce3e1
...
...
@@ -67,7 +67,7 @@ static Akonadi::SearchTerm::Condition matchType(ContactSearchJob::Match match)
void
ContactSearchJob
::
setQuery
(
Criterion
criterion
,
const
QString
&
value
,
Match
match
)
{
Akonadi
::
SearchQuery
query
(
SearchTerm
::
RelOr
)
;
Akonadi
::
SearchQuery
query
(
SearchTerm
::
RelOr
);
if
(
criterion
==
Name
)
{
query
.
addTerm
(
ContactSearchTerm
(
ContactSearchTerm
::
Name
,
value
,
matchType
(
match
)));
...
...
akonadi-contact/src/contactviewer.cpp
View file @
41fce3e1
...
...
@@ -95,9 +95,9 @@ public:
QImage
image
;
KIO
::
TransferJob
*
job
=
KIO
::
get
(
QUrl
(
mCurrentContact
.
photo
().
url
()),
KIO
::
NoReload
);
QObject
::
connect
(
job
,
&
KIO
::
TransferJob
::
data
,
[
&
imageData
](
KIO
::
Job
*
,
const
QByteArray
&
data
)
{
imageData
.
append
(
data
);
});
[
&
imageData
](
KIO
::
Job
*
,
const
QByteArray
&
data
)
{
imageData
.
append
(
data
);
});
if
(
job
->
exec
())
{
if
(
image
.
loadFromData
(
imageData
))
{
mBrowser
->
document
()
->
addResource
(
QTextDocument
::
ImageResource
,
...
...
@@ -129,9 +129,9 @@ public:
QImage
image
;
KIO
::
TransferJob
*
job
=
KIO
::
get
(
QUrl
(
mCurrentContact
.
logo
().
url
()),
KIO
::
NoReload
);
QObject
::
connect
(
job
,
&
KIO
::
TransferJob
::
data
,
[
&
imageData
](
KIO
::
Job
*
,
const
QByteArray
&
data
)
{
imageData
.
append
(
data
);
});
[
&
imageData
](
KIO
::
Job
*
,
const
QByteArray
&
data
)
{
imageData
.
append
(
data
);
});
if
(
job
->
exec
())
{
if
(
image
.
loadFromData
(
imageData
))
{
mBrowser
->
document
()
->
addResource
(
QTextDocument
::
ImageResource
,
...
...
akonadi-contact/src/editor/addresseditwidget.cpp
View file @
41fce3e1
...
...
@@ -53,7 +53,7 @@
struct
LocaleAwareLessThan
:
std
::
binary_function
<
QString
,
QString
,
bool
>
{
bool
operator
()(
const
QString
&
s1
,
const
QString
&
s2
)
const
{
return
QString
::
localeAwareCompare
(
s1
,
s2
)
<
0
;
return
QString
::
localeAwareCompare
(
s1
,
s2
)
<
0
;
}
};
...
...
@@ -512,8 +512,8 @@ void AddressEditDialog::editLabel()
{
bool
ok
=
false
;
const
QString
result
=
QInputDialog
::
getMultiLineText
(
this
,
KContacts
::
Address
::
labelLabel
(),
KContacts
::
Address
::
labelLabel
(),
mLabel
,
&
ok
);
KContacts
::
Address
::
labelLabel
(),
mLabel
,
&
ok
);
if
(
ok
)
{
mLabel
=
result
;
}
...
...
akonadi-contact/src/editor/customfieldeditordialog.cpp
View file @
41fce3e1
...
...
@@ -66,7 +66,7 @@ CustomFieldEditorDialog::CustomFieldEditorDialog(QWidget *parent)
mTitle
->
setFocus
();
QDialogButtonBox
*
btnBox
=
new
QDialogButtonBox
(
QDialogButtonBox
::
Ok
|
QDialogButtonBox
::
Cancel
,
this
);
QDialogButtonBox
::
Cancel
,
this
);
btnBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setShortcut
(
Qt
::
CTRL
|
Qt
::
Key_Return
);
connect
(
btnBox
,
&
QDialogButtonBox
::
accepted
,
this
,
&
QDialog
::
accept
);
...
...
akonadi-contact/src/editor/imagewidget.cpp
View file @
41fce3e1
...
...
@@ -77,9 +77,9 @@ QImage ImageLoader::loadImage(const QUrl &url, bool *ok, bool selectPictureSize)
QByteArray
imageData
;
KIO
::
TransferJob
*
job
=
KIO
::
get
(
url
,
KIO
::
NoReload
);
QObject
::
connect
(
job
,
&
KIO
::
TransferJob
::
data
,
[
&
imageData
](
KIO
::
Job
*
,
const
QByteArray
&
data
)
{
imageData
.
append
(
data
);
});
[
&
imageData
](
KIO
::
Job
*
,
const
QByteArray
&
data
)
{
imageData
.
append
(
data
);
});
if
(
job
->
exec
())
{
if
(
image
.
loadFromData
(
imageData
))
{
(
*
ok
)
=
true
;
...
...
@@ -148,7 +148,7 @@ void ImageWidget::loadContact(const KContacts::Addressee &contact)
mPicture
=
(
mType
==
Photo
?
contact
.
photo
()
:
contact
.
logo
());
if
(
mPicture
.
isIntern
()
&&
!
mPicture
.
data
().
isNull
())
{
mHasImage
=
true
;
}
else
if
(
!
mPicture
.
isIntern
()
&&
!
mPicture
.
url
().
isEmpty
()){
}
else
if
(
!
mPicture
.
isIntern
()
&&
!
mPicture
.
url
().
isEmpty
())
{
mHasImage
=
true
;
}
...
...
akonadi-contact/src/editor/phoneeditwidget.cpp
View file @
41fce3e1
...
...
@@ -400,7 +400,7 @@ KContacts::PhoneNumber::Type PhoneTypeDialog::type() const
KContacts
::
PhoneNumber
::
Type
type
=
0
;
for
(
int
i
=
0
;
i
<
mGroup
->
buttons
().
count
();
++
i
)
{
QCheckBox
*
box
=
qobject_cast
<
QCheckBox
*>
(
mGroup
->
buttons
().
at
(
i
))
;
QCheckBox
*
box
=
qobject_cast
<
QCheckBox
*>
(
mGroup
->
buttons
().
at
(
i
));
if
(
box
&&
box
->
isChecked
())
{
type
|=
mTypeList
[
i
];
}
...
...
akonadi-contact/src/editor/soundeditwidget.cpp
View file @
41fce3e1
...
...
@@ -80,7 +80,7 @@ QByteArray SoundLoader::loadSound(const QUrl &url, bool *ok)
KJobWidgets
::
setWindow
(
job
,
mParent
);
if
(
job
->
exec
())
{
sound
=
job
->
data
();
(
*
ok
)
=
true
;
(
*
ok
)
=
true
;
}
}
...
...
akonadi-contact/src/emailaddressselectionwidget.cpp
View file @
41fce3e1
...
...
@@ -186,7 +186,7 @@ EmailAddressSelectionWidget::EmailAddressSelectionWidget(QAbstractItemModel *mod
EmailAddressSelectionWidget
::
EmailAddressSelectionWidget
(
bool
showOnlyContactWithEmail
,
QAbstractItemModel
*
model
,
QWidget
*
parent
)
:
QWidget
(
parent
)
,
d
(
new
Private
(
showOnlyContactWithEmail
,
this
,
model
))
,
d
(
new
Private
(
showOnlyContactWithEmail
,
this
,
model
))
{
}
...
...
akonadi-contact/src/selectaddressbookdialog.cpp
View file @
41fce3e1
...
...
@@ -67,7 +67,6 @@ void SelectAddressBookDialogPrivate::writeConfig()
group
.
sync
();
}
SelectAddressBookDialog
::
SelectAddressBookDialog
(
QWidget
*
parent
)
:
Akonadi
::
CollectionDialog
(
parent
),
d
(
new
Akonadi
::
SelectAddressBookDialogPrivate
(
this
))
...
...
akonadi-contact/src/standardcontactformatter.cpp
View file @
41fce3e1
...
...
@@ -198,7 +198,7 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
// Note
QString
notes
;
if
(
!
rawContact
.
note
().
isEmpty
())
{
notes
=
rowFmtStr1
.
arg
(
i18n
(
"Notes"
)).
arg
(
rawContact
.
note
().
toHtmlEscaped
().
replace
(
QLatin1Char
(
'\n'
),
QLatin1String
(
"<br>"
)))
;
notes
=
rowFmtStr1
.
arg
(
i18n
(
"Notes"
)).
arg
(
rawContact
.
note
().
toHtmlEscaped
().
replace
(
QLatin1Char
(
'\n'
),
QLatin1String
(
"<br>"
)));
}
// Custom Data
...
...
akonadi-contact/src/standardcontactgroupformatter.cpp
View file @
41fce3e1
...
...
@@ -86,7 +86,7 @@ QString StandardContactGroupFormatter::toHtml(HtmlForm form) const
if
(
data
.
email
().
isEmpty
())
{
strGroup
.
append
(
QStringLiteral
(
"<tr><td align=
\"
right
\"
width=
\"
50%
\"
><b><font color=
\"
grey
\"
>%1</font></b></td>"
"<td width=
\"
50%
\"
></td></tr>"
)
"<td width=
\"
50%
\"
></td></tr>"
)
.
arg
(
data
.
name
()));
}
else
{
KContacts
::
Addressee
contact
;
...
...
@@ -96,7 +96,7 @@ QString StandardContactGroupFormatter::toHtml(HtmlForm form) const
const
QString
fullEmail
=
QLatin1String
(
"<a href=
\"
mailto:"
)
+
QString
::
fromLatin1
(
QUrl
::
toPercentEncoding
(
contact
.
fullEmail
()))
+
QStringLiteral
(
"
\"
>%1</a>"
).
arg
(
contact
.
preferredEmail
());
strGroup
.
append
(
QStringLiteral
(
"<tr><td align=
\"
right
\"
width=
\"
50%
\"
><b><font color=
\"
grey
\"
>%1</font></b></td>"
"<td valign=
\"
bottom
\"
align=
\"
left
\"
width=
\"
50%
\"
><font><%2></font></td></tr>"
)
"<td valign=
\"
bottom
\"
align=
\"
left
\"
width=
\"
50%
\"
><font><%2></font></td></tr>"
)
.
arg
(
contact
.
realName
())
.
arg
(
fullEmail
));
}
...
...
@@ -104,7 +104,7 @@ QString StandardContactGroupFormatter::toHtml(HtmlForm form) const
foreach
(
const
QVariantMap
&
map
,
additionalFields
())
{
strGroup
.
append
(
QStringLiteral
(
"<tr><td colspan=
\"
2
\"
> </td></tr><tr><td align=
\"
right
\"
width=
\"
30%
\"
><b><font color=
\"
grey
\"
>%1</font></b></td>"
"<td valign=
\"
bottom
\"
align=
\"
left
\"
width=
\"
50%
\"
><font>%2</font></td></tr>"
)
"<td valign=
\"
bottom
\"
align=
\"
left
\"
width=
\"
50%
\"
><font>%2</font></td></tr>"
)
.
arg
(
map
.
value
(
QStringLiteral
(
"title"
)).
toString
())
.
arg
(
map
.
value
(
QStringLiteral
(
"value"
)).
toString
()));
}
...
...
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