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
Unmaintained
KDE Pim
Commits
66f74360
Commit
66f74360
authored
Feb 01, 2013
by
Laurent Montel
😁
Browse files
Fix Bug 314221 - composer attaches directory without confirmation if
also a file is selected FIXED-IN: 4.10.1 BUG: 314221
parent
05f704ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
messagecomposer/attachmentcontrollerbase.cpp
View file @
66f74360
...
...
@@ -774,24 +774,19 @@ void AttachmentControllerBase::showAddAttachmentDialog()
if
(
dialog
->
exec
()
==
KDialog
::
Accepted
&&
dialog
)
{
const
KUrl
::
List
files
=
dialog
->
selectedUrls
();
const
QString
encoding
=
MessageViewer
::
NodeHelper
::
fixEncoding
(
dialog
->
selectedEncoding
()
);
if
(
files
.
count
()
==
1
)
{
const
KUrl
url
=
files
.
at
(
0
);
KUrl
urlWithEncoding
=
url
;
urlWithEncoding
.
setFileEncoding
(
encoding
);
if
(
KMimeType
::
findByUrl
(
urlWithEncoding
)
->
name
()
==
QLatin1String
(
"inode/directory"
)
)
{
int
rc
=
KMessageBox
::
warningYesNo
(
d
->
wParent
,
i18n
(
"Do you really want to attach this directory
\"
%1
\"
?"
,
url
.
toLocalFile
()
),
i18n
(
"Attach directory"
)
);
if
(
rc
==
KMessageBox
::
Yes
)
{
addAttachment
(
urlWithEncoding
);
}
}
else
{
addAttachment
(
urlWithEncoding
);
}
}
else
{
foreach
(
const
KUrl
&
url
,
files
)
{
const
int
numberOfFiles
(
files
.
count
());
for
(
int
i
=
0
;
i
<
numberOfFiles
;
++
i
)
{
const
KUrl
url
=
files
.
at
(
i
);
KUrl
urlWithEncoding
=
url
;
urlWithEncoding
.
setFileEncoding
(
encoding
);
addAttachment
(
urlWithEncoding
);
}
if
(
KMimeType
::
findByUrl
(
urlWithEncoding
)
->
name
()
==
QLatin1String
(
"inode/directory"
)
)
{
const
int
rc
=
KMessageBox
::
warningYesNo
(
d
->
wParent
,
i18n
(
"Do you really want to attach this directory
\"
%1
\"
?"
,
url
.
toLocalFile
()
),
i18n
(
"Attach directory"
)
);
if
(
rc
==
KMessageBox
::
Yes
)
{
addAttachment
(
urlWithEncoding
);
}
}
else
{
addAttachment
(
urlWithEncoding
);
}
}
emit
fileAttached
();
}
...
...
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