mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont allow drag and drop from library view to itself
This commit is contained in:
parent
7d0b7aab8c
commit
5e0869feb4
@ -425,8 +425,10 @@ class BooksView(QTableView): # {{{
|
|||||||
Accept a drop event and return a list of paths that can be read from
|
Accept a drop event and return a list of paths that can be read from
|
||||||
and represent files with extensions.
|
and represent files with extensions.
|
||||||
'''
|
'''
|
||||||
if event.mimeData().hasFormat('text/uri-list'):
|
md = event.mimeData()
|
||||||
urls = [unicode(u.toLocalFile()) for u in event.mimeData().urls()]
|
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)]
|
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):
|
def drag_icon(self, cover, multiple):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user