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
KMail
Commits
7dab10df
Commit
7dab10df
authored
Mar 04, 2022
by
Laurent Montel
😁
Browse files
Fix dnd on subject lineedit. When it's an url we don't want to
copy url we want to attach it
parent
7c51f6dc
Pipeline
#145008
failed with stage
in 3 minutes and 44 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/editor/kmcomposerwin.cpp
View file @
7dab10df
...
...
@@ -335,6 +335,9 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg,
mEdtSubject
=
new
SubjectLineEditWithAutoCorrection
(
mHeadersArea
,
QStringLiteral
(
"kmail2rc"
));
mEdtSubject
->
installEventFilter
(
this
);
mEdtSubject
->
setAutocorrection
(
KMKernel
::
self
()
->
composerAutoCorrection
());
connect
(
mEdtSubject
,
&
SubjectLineEditWithAutoCorrection
::
handleMimeData
,
this
,
[
this
](
const
QMimeData
*
mimeData
)
{
insertFromMimeData
(
mimeData
,
false
);
});
mLblIdentity
=
new
QLabel
(
i18n
(
"&Identity:"
),
mHeadersArea
);
mDictionaryLabel
=
new
QLabel
(
i18n
(
"&Dictionary:"
),
mHeadersArea
);
mLblFcc
=
new
QLabel
(
i18n
(
"&Sent-Mail folder:"
),
mHeadersArea
);
...
...
src/editor/subjectlineeditwithautocorrection.cpp
View file @
7dab10df
...
...
@@ -6,6 +6,8 @@
#include "subjectlineeditwithautocorrection.h"
#include <KLocalizedString>
#include <QDropEvent>
#include <QMimeData>
SubjectLineEditWithAutoCorrection
::
SubjectLineEditWithAutoCorrection
(
QWidget
*
parent
,
const
QString
&
configFile
)
:
PimCommon
::
LineEditWithAutoCorrection
(
parent
,
configFile
)
...
...
@@ -17,3 +19,14 @@ SubjectLineEditWithAutoCorrection::SubjectLineEditWithAutoCorrection(QWidget *pa
SubjectLineEditWithAutoCorrection
::~
SubjectLineEditWithAutoCorrection
()
{
}
void
SubjectLineEditWithAutoCorrection
::
dropEvent
(
QDropEvent
*
event
)
{
const
QMimeData
*
mimeData
=
event
->
mimeData
();
if
(
mimeData
->
hasUrls
())
{
Q_EMIT
handleMimeData
(
mimeData
);
event
->
accept
();
return
;
}
PimCommon
::
LineEditWithAutoCorrection
::
dropEvent
(
event
);
}
src/editor/subjectlineeditwithautocorrection.h
View file @
7dab10df
...
...
@@ -14,4 +14,10 @@ class KMAILTESTS_TESTS_EXPORT SubjectLineEditWithAutoCorrection : public PimComm
public:
explicit
SubjectLineEditWithAutoCorrection
(
QWidget
*
parent
,
const
QString
&
configFile
);
~
SubjectLineEditWithAutoCorrection
()
override
;
protected:
void
dropEvent
(
QDropEvent
*
event
)
override
;
Q_SIGNALS:
void
handleMimeData
(
const
QMimeData
*
mimeData
);
};
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