aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2018-05-10 20:25:01 +0200
committerMichael Buesch <m@bues.ch>2018-05-11 19:29:31 +0200
commita6104834201fb0bde72f0c9f0845d3a1b9848d66 (patch)
treea702690cbe2814a34493983248e8d14fd8ae392f
parent954f4b88fdbf470ed2746965ba8c80b1b5de4620 (diff)
downloadawlsim-gui-projecttree.tar.xz
awlsim-gui-projecttree.zip
gui/projecttree: Only use clipboard selection, if it is availablegui-projecttree
Signed-off-by: Michael Buesch <m@bues.ch>
-rw-r--r--awlsim/gui/projecttreewidget.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/awlsim/gui/projecttreewidget.py b/awlsim/gui/projecttreewidget.py
index 2d19d926..d42c7193 100644
--- a/awlsim/gui/projecttreewidget.py
+++ b/awlsim/gui/projecttreewidget.py
@@ -487,7 +487,8 @@ class ProjectTreeModel(QAbstractItemModel):
if not clipboard:
return False
clipboard.setMimeData(mimeData, QClipboard.Clipboard)
- clipboard.setMimeData(mimeData, QClipboard.Selection)
+ if clipboard.supportsSelection():
+ clipboard.setMimeData(mimeData, QClipboard.Selection)
return True
def entryClipboardCut(self, index, parentWidget=None):
@@ -507,6 +508,8 @@ class ProjectTreeModel(QAbstractItemModel):
if not clipboard:
return None
mimeData = clipboard.mimeData(QClipboard.Clipboard)
+ if not mimeData:
+ return None
parentIdxIdBase, parentIdxId, parentItemNr = self.indexToId(parentIndex)
if parentIdxIdBase == 0:
bues.ch cgit interface