Bug 318560 - drag-and-drop file on canvas : 'Replace current document' crash krita
Summary: drag-and-drop file on canvas : 'Replace current document' crash krita
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-18 16:14 UTC by David REVOY
Modified: 2013-05-17 07:15 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David REVOY 2013-04-18 16:14:21 UTC
Reproducible : always
- Open a file ( can be a *.kra, *.ora or flat ) 
- take an image file from Dolphin 
- drag-and-drop the file on canvas 
- choose 'Replace current document'
- Krita crash

Crash info output ( I saved 2 : http://www.pasteall.org/41495/raw ) 
http://www.pasteall.org/41495/raw
Comment 1 Halla Rempt 2013-04-19 17:59:21 UTC
Thread 1 (Thread 0x7f643ebac780 (LWP 3300)):
[KCrash Handler]
#6  parent (this=0x2e74ab0) at ../../src/corelib/kernel/qobject.h:273
#7  parentWidget (this=0x2e74ab0) at ../../src/gui/kernel/qwidget.h:1033
#8  QWidget::window (this=0x2e74ac0) at kernel/qwidget.cpp:4350
#9  0x00007f643cd0caa9 in KoView::shell (this=<optimized out>) at /home/boud/kde/src/calligra/libs/main/KoView.cpp:590
#10 0x00007f643d8961bc in KisView2::dropEvent (this=0x2e74ac0, event=<optimized out>) at /home/boud/kde/src/calligra/krita/ui/kis_view2.cpp:576
#11 0x00007f6436b032fc in QWidget::event (this=0x2e74ac0, event=0x7fff4475fb10) at kernel/qwidget.cpp:8576
#12 0x00007f6436ab386c in QApplicationPrivate::notify_helper (this=this@entry=0x128dfd0, receiver=receiver@entry=0x2e74ac0, e=e@entry=0x7fff4475fb10) at kernel/qapplication.cpp:4562
#13 0x00007f6436ab8693 in QApplication::notify (this=<optimized out>, receiver=0x414d300, e=0x7fff4475fb10) at kernel/qapplication.cpp:4348
#14 0x00007f643cc9dd98 in KoApplication::notify (this=<optimized out>, receiver=0x414d300, event=0x7fff4475fb10) at /home/boud/kde/src/calligra/libs/main/KoApplication.cpp:558
#15 0x00007f643e079c9e in QCoreApplication::notifyInternal (this=0x7fff44760490, receiver=0x414d300, event=0x7fff4475fb10) at kernel/qcoreapplication.cpp:946
#16 0x00007f6436b38161 in sendEvent (event=0x7fff4475fb10, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:231
#17 QX11Data::xdndHandleDrop (this=<optimized out>, xe=<optimized out>, passive=<optimized out>) at kernel/qdnd_x11.cpp:1181
#18 0x00007f6436b2fa45 in QApplication::x11ClientMessage (this=<optimized out>, w=0x2747c50, event=<optimized out>, passive_only=<optimized out>) at kernel/qapplication_x11.cpp:3217
#19 0x00007f6436b2e172 in QApplication::x11ProcessEvent (this=0x7fff44760490, event=0x7fff44760170) at kernel/qapplication_x11.cpp:3789
#20 0x00007f6436b549d9 in QEventDispatcherX11::processEvents (this=0x108bc30, flags=...) at kernel/qeventdispatcher_x11.cpp:132
#21 0x00007f643e0789ef in QEventLoop::processEvents (this=this@entry=0x7fff447603e0, flags=...) at kernel/qeventloop.cpp:149
#22 0x00007f643e078c78 in QEventLoop::exec (this=0x7fff447603e0, flags=...) at kernel/qeventloop.cpp:204
#23 0x00007f643e07d918 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#24 0x00007f643e5bf672 in kdemain (argc=<optimized out>, argv=<optimized out>) at /home/boud/kde/src/calligra/krita/main.cc:79
#25 0x00007f643538fa15 in __libc_start_main () from /lib64/libc.so.6
#26 0x0000000000400a11 in _start () at ../sysdeps/x86_64/start.S:123
Comment 2 vanyossi 2013-04-19 18:07:14 UTC
Thanks for the report.
I can reproduce it as well. Any file dropped with "replace current document" triggers the crash.
Comment 3 Dmitry Kazakov 2013-04-22 15:53:32 UTC
Git commit c49444def062bc37435992fb7546c944c754f6b6 by Dmitry Kazakov.
Committed on 22/04/2013 at 17:52.
Pushed by dkazakov into branch 'krita-testing-kazakov'.

Fixed Drag & Drop of URL's

Now you can D&D images from Firefox, from Dolphin and there is no crash! =)
Tested the following usecases:

1) Add as layer (local and remote files)
2) Add new Document (local and remote files)
3) Replace Document (local and remote files)

4) Add Multiple Layers (local)
5) Add Multiple Documents (local)

M  +18   -2    krita/ui/kis_import_catcher.cc
M  +6    -0    krita/ui/kis_import_catcher.h
M  +9    -4    krita/ui/kis_view2.cpp
M  +1    -0    libs/main/KoMainWindow.cpp
M  +6    -0    libs/main/KoMainWindow.h

http://commits.kde.org/calligra/c49444def062bc37435992fb7546c944c754f6b6
Comment 4 David REVOY 2013-04-23 09:12:18 UTC
@Dmitry : I switched to your branch, and it works perfectly now.  Thanks ! I'll keep 'krita-testing-kazakov' for the moment :)
Btw, I couldn't found the option :
>> 4) Add Multiple Layers (local) 
>> 5) Add Multiple Documents (local)
And I'm really interrested. Are they supposed to show up on the pop-up menu after a drag and drop on canvas ?
Comment 5 Dmitry Kazakov 2013-04-23 11:50:54 UTC
You just need to select several files in Dolphin and drop all of them into Krita. Then the option appears.
Comment 6 David REVOY 2013-04-23 12:49:39 UTC
@Dmitry : Oh, I get it. I thought it was also appearing when draging a *.ora or a *.kra file with multiple layer inside ; to not append a flat composited layer of all the file, but append all the layer of the files. 

I tested : 
- multiple files D&D
- firefox D&D 
- and other variations.

It works really great. Thanks ! 

A little cool user friendly polishing would be to not have all the path as a name for the layer : it doesn't look good, and not informative : http://i.imgur.com/gEDf3WH.jpg
I would prefer only 
>> filename.extension 
instead of  
>> protocol://full/path/to/the/files/filename.extension
I just opened a [wish] here Bug 318764 about it.
Comment 7 Dmitry Kazakov 2013-05-01 10:00:34 UTC
Git commit 6abbaee644a9fd79f56b98839904172775dc1cf9 by Dmitry Kazakov.
Committed on 22/04/2013 at 17:52.
Pushed by dkazakov into branch 'calligra/2.7'.

Fixed Drag & Drop of URL's

Now you can D&D images from Firefox, from Dolphin and there is no crash! =)
Tested the following usecases:

1) Add as layer (local and remote files)
2) Add new Document (local and remote files)
3) Replace Document (local and remote files)

4) Add Multiple Layers (local)
5) Add Multiple Documents (local)

M  +18   -2    krita/ui/kis_import_catcher.cc
M  +6    -0    krita/ui/kis_import_catcher.h
M  +9    -4    krita/ui/kis_view2.cpp
M  +1    -0    libs/main/KoMainWindow.cpp
M  +6    -0    libs/main/KoMainWindow.h

http://commits.kde.org/calligra/6abbaee644a9fd79f56b98839904172775dc1cf9
Comment 8 Siddharth 2013-05-17 07:15:18 UTC
Git commit 9ad5bffd580a4b945949c704d4ae687b81b0b5ac by Siddharth Sharma, on behalf of Dmitry Kazakov.
Committed on 22/04/2013 at 17:52.
Pushed by siddharthsharma into branch 'krita-psd-plugin-siddharth'.

Fixed Drag & Drop of URL's

Now you can D&D images from Firefox, from Dolphin and there is no crash! =)
Tested the following usecases:

1) Add as layer (local and remote files)
2) Add new Document (local and remote files)
3) Replace Document (local and remote files)

4) Add Multiple Layers (local)
5) Add Multiple Documents (local)

M  +18   -2    krita/ui/kis_import_catcher.cc
M  +6    -0    krita/ui/kis_import_catcher.h
M  +9    -4    krita/ui/kis_view2.cpp
M  +1    -0    libs/main/KoMainWindow.cpp
M  +6    -0    libs/main/KoMainWindow.h

http://commits.kde.org/calligra/9ad5bffd580a4b945949c704d4ae687b81b0b5ac