From 5e0869feb42c3826c92608da06f589a958cbb7e3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 3 Oct 2010 15:34:55 -0600 Subject: [PATCH] Dont allow drag and drop from library view to itself --- src/calibre/gui2/library/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/library/views.py b/src/calibre/gui2/library/views.py index 43a31500c7..40f74425c8 100644 --- a/src/calibre/gui2/library/views.py +++ b/src/calibre/gui2/library/views.py @@ -425,8 +425,10 @@ class BooksView(QTableView): # {{{ Accept a drop event and return a list of paths that can be read from and represent files with extensions. ''' - if event.mimeData().hasFormat('text/uri-list'): - urls = [unicode(u.toLocalFile()) for u in event.mimeData().urls()] + md = event.mimeData() + if md.hasFormat('text/uri-list') and not \ + md.hasFormat('application/calibre+from_library'): + urls = [unicode(u.toLocalFile()) for u in md.urls()] return [u for u in urls if os.path.splitext(u)[1] and os.access(u, os.R_OK)] def drag_icon(self, cover, multiple):