Bug 314221

Summary: composer attaches directory without confirmation if also a file is selected
Product: kmail2 Reporter: Daniel Franke <franke.daniel>
Component: composerAssignee: kdepim bugs <kdepim-bugs>
Severity: normal CC: montel
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.1

Description Daniel Franke 2013-01-31 23:26:40 UTC
Ubuntu 12.04, Kontact/KMail 4.8.5

In the "Attach File" dialog: I accidentally selected a folder (gigabytes of data, thousands of files) plus one extra file via [CTRL] and pressed "Attach". 

If only the folder is selected, a confirmation dialog pops up: "do you reallly want to attach this directory: ..., yes/no". Fair enough.

With an additional file besides the directory, or with two directories, this dialog does not appear and the directory/directories are attached without further confirmation. In above case the kmail GUI froze while trying to pack ~5GB into a mail attachment. The only way to get it back was to kill kontact and start over.

It might be good to (1) always show the confirmation dialog for every ddirectory that should be attached and (2) have a second confirmation dialog once a (configurable?) attachment limit is reached, say 10MB by default, confirm that really more files should be attached. And (3) maybe do the collecting/packing in a background worker thread instead of a GUI thread?

Reproducible: Always
Comment 1 Laurent Montel 2013-02-01 06:52:26 UTC
I confirm it.
Will fix soon.
Comment 2 Laurent Montel 2013-02-01 07:01:14 UTC
Git commit 66f74360a320177e4ac1c6d61a3d1185d4daf530 by Montel Laurent.
Committed on 01/02/2013 at 08:00.
Pushed by mlaurent into branch 'KDE/4.10'.

Fix Bug 314221 - composer attaches directory without confirmation if

also a file is selected
FIXED-IN: 4.10.1

M  +11   -16   messagecomposer/attachmentcontrollerbase.cpp