Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KAlarm
Commits
606c8205
Commit
606c8205
authored
Aug 17, 2015
by
Laurent Montel
Browse files
Port to QMimeData
parent
4725dc24
Changes
2
Hide whitespace changes
Inline
Side-by-side
kamail.cpp
View file @
606c8205
...
...
@@ -398,9 +398,10 @@ QString KAMail::appendBodyAttachments(KMime::Message& message, JobData& data)
content
->
setBody
(
coded
+
"
\n\n
"
);
// Set the content type
KMimeType
::
Ptr
type
=
KMimeType
::
findByUrl
(
url
);
QMimeDatabase
mimeDb
;
QString
typeName
=
mimeDb
.
mimeTypeForUrl
(
url
).
name
();
KMime
::
Headers
::
ContentType
*
ctype
=
new
KMime
::
Headers
::
ContentType
;
ctype
->
fromUnicodeString
(
type
->
n
ame
()
,
autoDetectCharset
(
type
->
n
ame
()
));
ctype
->
fromUnicodeString
(
type
N
ame
,
autoDetectCharset
(
type
N
ame
));
ctype
->
setName
(
attachment
,
"local"
);
content
->
setHeader
(
ctype
);
...
...
mainwindow.cpp
View file @
606c8205
...
...
@@ -78,6 +78,7 @@ using namespace KCalUtils;
#include
<QCloseEvent>
#include
<QDesktopWidget>
#include
<QMenu>
#include
<QMimeDatabase>
#include
<qinputdialog.h>
#include
"kalarm_debug.h"
...
...
@@ -1359,8 +1360,9 @@ void MainWindow::executeDropEvent(MainWindow* win, QDropEvent* e)
{
qCDebug
(
KALARM_LOG
)
<<
"URL"
;
// Try to find the mime type of the file, without downloading a remote file
KMimeType
::
Ptr
mimeType
=
KMimeType
::
findByUrl
(
files
[
0
]);
action
=
mimeType
->
name
().
startsWith
(
QStringLiteral
(
"audio/"
))
?
KAEvent
::
AUDIO
:
KAEvent
::
FILE
;
QMimeDatabase
mimeDb
;
const
QString
mimeTypeName
=
mimeDb
.
mimeTypeForUrl
(
files
[
0
]).
name
();
action
=
mimeTypeName
.
startsWith
(
QStringLiteral
(
"audio/"
))
?
KAEvent
::
AUDIO
:
KAEvent
::
FILE
;
alarmText
.
setText
(
files
[
0
].
prettyUrl
());
}
else
if
(
data
->
hasText
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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