Mercurial > octave-dspies
comparison libgui/qterminal/libqterminal/unix/TerminalView.cpp @ 18651:992b6354c8c6 gui-release
GUI: implement file drag and drop to command and edit window (Bug #41443)
* libgui/src/m-editor/file-editor.h, ibgui/src/m-editor/file-editor.cpp
(file_editor::file_editor): call setAcceptDrops.
(file_editor::dragEnterEvent): New function.
(file_editor::dropEvent): New function.
* libgui/qterminal/libqterminal/unix/TerminalView.cpp
(TerminalView::dropEvent): get URL names on drop event.
author | John Donoghue |
---|---|
date | Wed, 16 Apr 2014 16:19:45 -0400 |
parents | 2d5d0d86432e |
children | 8b566ad1f88a |
comparison
equal
deleted
inserted
replaced
18639:7cb98e81ecd1 | 18651:992b6354c8c6 |
---|---|
2618 void TerminalView::dropEvent(QDropEvent* event) | 2618 void TerminalView::dropEvent(QDropEvent* event) |
2619 { | 2619 { |
2620 // KUrl::List urls = KUrl::List::fromMimeData(event->mimeData()); | 2620 // KUrl::List urls = KUrl::List::fromMimeData(event->mimeData()); |
2621 | 2621 |
2622 QString dropText; | 2622 QString dropText; |
2623 | |
2624 if (event->mimeData ()->hasUrls ()) | |
2625 { | |
2626 foreach (QUrl url, event->mimeData ()->urls ()) | |
2627 { | |
2628 if(dropText.length () > 0) | |
2629 dropText += "\n"; | |
2630 dropText += url.toLocalFile (); | |
2631 } | |
2632 } | |
2633 | |
2623 /* if (!urls.isEmpty()) | 2634 /* if (!urls.isEmpty()) |
2624 { | 2635 { |
2625 for ( int i = 0 ; i < urls.count() ; i++ ) | 2636 for ( int i = 0 ; i < urls.count() ; i++ ) |
2626 { | 2637 { |
2627 KUrl url = KIO::NetAccess::mostLocalUrl( urls[i] , 0 ); | 2638 KUrl url = KIO::NetAccess::mostLocalUrl( urls[i] , 0 ); |