<div class="gmail_quote">On Sat, Jan 9, 2010 at 11:23 PM, PEGON Marc <span dir="ltr"><<a href="mailto:pe.marc@free.fr">pe.marc@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This small patch for krita attached corrects a bug when drag&drop from<br>
firefox : nothing happened after selecting "Insert as New Layer".<br>
The problem was a bad use of KUrl : the KUrl constructor should be used<br>
instead of url.setPath(path) to set an url, otherwise you'll get<br>
problems with non-local urls.<br>
Also changed some lines so that undo/redo works after having d&d an<br>
image from firefox.<br>
<br>
mpeg<br>
<br></blockquote></div><br>Congrats to your first Krita patch.<br>I have some remarks:<br><br>Instead of KUrl url=KUrl(filename); you can just write KUrl url(filename);<br><br>You shouldn't do this: device->convertFromQImage(importedImage->projection()->convertToQImage(0), "");<br>
By converting to and from QImage the colorspace information is lost. Instead better use the paint device directly.<br><br>For the KisNodeCommandsAdapter the inserted if clause isn't needed as it gets the correct insertion position a few lines earlier and stores it in parent.<br>
The addNode call is the same as before just with the adapter.<br><br>You don't have to call m_d->view->canvas()->update(); because setDirty will update the canvas.<br><br>