Dear list,<br><br><br>How can i copy files between applications on GNOME/Unity desktop(with Nautilus file manager)?<br><br>The below code works fine on KDE & Mac OS X(Finder), but not work on GNOME/Unity-based desktop.<br>
The section marked with <b>bold</b> were the part i used for copy & paster files. (Paste the files i copied from my PyQt app to somewhere on the filesystem, /home/myuser/, etc.)<br clear="all"><br><br> def buildContextMenu(self):<br>
self.contextMenu = QMenu(self)<br> copyAction = QAction(self.trUtf8('Copy'), self)<br> self.contextMenu.addAction(copyAction)<br><br> self.connect(copyAction, SIGNAL('triggered()'), self.copy2clipboard)<br>
<br> def copy2clipboard(self):<br> selectedList = self.selectedIndexes()<br> if selectedList:<br> paths = []<br> for i in selectedList:<br> p = unicode(i.model().filePath(i))<br>
if p not in paths:<br> paths.append(p)<br><b><br> urls = [QUrl.fromLocalFile(i) for i in paths]<br><br> mime_data = QMimeData()<br> mime_data.setUrls(urls)<br>
<br> clipboard = QApplication.clipboard()<br> clipboard.setMimeData(mime_data)</b><br><br><br>Any help would be appreciated.<br>