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
KDE PIM Add-ons
Commits
b2c97f35
Commit
b2c97f35
authored
Oct 06, 2020
by
Laurent Montel
😁
Browse files
const'ify, clean up code
parent
fd9480a0
Pipeline
#36581
canceled with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
korganizer/plugins/picoftheday/picoftheday.cpp
View file @
b2c97f35
...
...
@@ -31,9 +31,8 @@ Picoftheday::~Picoftheday()
void
Picoftheday
::
configure
(
QWidget
*
parent
)
{
QPointer
<
ConfigDialog
>
dlg
=
new
ConfigDialog
(
parent
);
dlg
->
exec
();
delete
dlg
;
ConfigDialog
dlg
(
parent
);
dlg
.
exec
();
}
QString
Picoftheday
::
info
()
const
...
...
plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp
View file @
b2c97f35
...
...
@@ -156,8 +156,8 @@ public:
}
private:
MimeTreeParser
::
MessagePartPtr
mBodyPart
;
KCalendarCore
::
MemoryCalendar
::
Ptr
mCalendar
;
const
MimeTreeParser
::
MessagePartPtr
mBodyPart
;
const
KCalendarCore
::
MemoryCalendar
::
Ptr
mCalendar
;
};
class
Formatter
:
public
MessageViewer
::
MessagePartRendererBase
...
...
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp
View file @
b2c97f35
...
...
@@ -43,30 +43,32 @@ bool partHasMimeType(KMime::Content *part, const char *mt)
MessagePart
::
Ptr
ApplicationGnuPGWKSFormatter
::
process
(
BodyPart
&
part
)
const
{
const
auto
ct
=
part
.
content
()
->
contentType
(
false
);
if
(
ct
&&
ct
->
isMimeType
(
"multipart/mixed"
))
{
const
auto
subParts
=
part
.
content
()
->
contents
();
if
(
subParts
.
size
()
==
2
&&
partHasMimeType
(
subParts
[
0
],
"text/plain"
)
&&
partHasMimeType
(
subParts
[
1
],
"application/vnd.gnupg.wks"
))
{
return
MimeMessagePart
::
Ptr
(
new
MimeMessagePart
(
part
.
objectTreeParser
(),
subParts
.
at
(
1
),
false
));
}
else
{
return
MimeMessagePart
::
Ptr
(
new
MimeMessagePart
(
part
.
objectTreeParser
(),
subParts
.
at
(
0
),
false
));
if
(
ct
)
{
if
(
ct
->
isMimeType
(
"multipart/mixed"
))
{
const
auto
subParts
=
part
.
content
()
->
contents
();
if
(
subParts
.
size
()
==
2
&&
partHasMimeType
(
subParts
[
0
],
"text/plain"
)
&&
partHasMimeType
(
subParts
[
1
],
"application/vnd.gnupg.wks"
))
{
return
MimeMessagePart
::
Ptr
(
new
MimeMessagePart
(
part
.
objectTreeParser
(),
subParts
.
at
(
1
),
false
));
}
else
{
return
MimeMessagePart
::
Ptr
(
new
MimeMessagePart
(
part
.
objectTreeParser
(),
subParts
.
at
(
0
),
false
));
}
}
}
if
(
ct
&&
ct
->
isMimeType
(
"application/vnd.gnupg.wks"
))
{
const
auto
content
=
part
.
content
()
->
decodedContent
();
if
(
content
.
startsWith
(
"-----BEGIN PGP MESSAGE"
))
{
auto
decrypt
=
QGpgME
::
openpgp
()
->
decryptJob
();
QByteArray
plainText
;
auto
result
=
decrypt
->
exec
(
part
.
content
()
->
decodedContent
(),
plainText
);
if
(
result
.
error
())
{
qCWarning
(
GNUPGWKS_LOG
)
<<
"Decryption failed!"
<<
result
.
error
().
asString
();
return
{};
if
(
ct
->
isMimeType
(
"application/vnd.gnupg.wks"
))
{
const
auto
content
=
part
.
content
()
->
decodedContent
();
if
(
content
.
startsWith
(
"-----BEGIN PGP MESSAGE"
))
{
auto
decrypt
=
QGpgME
::
openpgp
()
->
decryptJob
();
QByteArray
plainText
;
auto
result
=
decrypt
->
exec
(
part
.
content
()
->
decodedContent
(),
plainText
);
if
(
result
.
error
())
{
qCWarning
(
GNUPGWKS_LOG
)
<<
"Decryption failed!"
<<
result
.
error
().
asString
();
return
{};
}
part
.
content
()
->
setBody
(
plainText
);
}
part
.
content
()
->
setBody
(
plainText
);
return
MessagePart
::
Ptr
(
new
GnuPGWKSMessagePart
(
&
part
)
);
}
return
MessagePart
::
Ptr
(
new
GnuPGWKSMessagePart
(
&
part
));
}
return
{};
...
...
plugins/messageviewer/bodypartformatter/itinerary/itinerarykdeconnecthandler.cpp
View file @
b2c97f35
...
...
@@ -48,7 +48,7 @@ QVector<ItineraryKDEConnectHandler::Device> ItineraryKDEConnectHandler::devices(
void
ItineraryKDEConnectHandler
::
sendToDevice
(
const
QString
&
fileName
,
const
QString
&
deviceId
)
{
QDBusInterface
remoteApp
(
QStringLiteral
(
"org.kde.kdeconnect"
),
QStringLiteral
(
"/MainApplication"
),
QStringLiteral
(
"org.qtproject.Qt.QCoreApplication"
));
const
QDBusInterface
remoteApp
(
QStringLiteral
(
"org.kde.kdeconnect"
),
QStringLiteral
(
"/MainApplication"
),
QStringLiteral
(
"org.qtproject.Qt.QCoreApplication"
));
QVersionNumber
kdeconnectVersion
=
QVersionNumber
::
fromString
(
remoteApp
.
property
(
"applicationVersion"
).
toString
());
QString
method
;
...
...
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