What is the best way to deal with the change to the QFileDialog.getOpenFileName method?
PyQt4 used to return a single
filepath but PyQt5 returns 2 strings (
filepath, filter). I don't need the
filter part of the result so I've temporarily solved it like this:
Code:
fd = QFileDialog()
if hasattr(fd, 'getOpenFileNameAndFilter'):
# PyQt4
ans = fd.getOpenFileNameAndFilter(self, mycaption, mydir, myfilter)
else:
# PyQt5
ans = fd.getOpenFileName(self, mycaption, mydir, myfilter)
selfile = unicode(ans[0])
Is there a better calibre-way of doing this? I fully admit that this particular personal plugin started life completely external to calibre so uses less calibre special functionality than it might. I tend to only fix things if they break.
I have quite a few other questions (mainly to do with SIGNAL) but ... one thing at a time.