Comment 4 for bug 1795278

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

There are no PyKDE imports anymore, only PyQt. That said, replacing `KUrl.fromPath` with just `QUrl` should resolve that.

But that's not our only issue:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/softwareproperties/qt/SoftwarePropertiesQt.py", line 713, in add_key_clicked
    filename = KFileDialog.getOpenFileName(url, 'application/pgp-keys', self.userinterface, _("Import key"))
NameError: name 'KFileDialog' is not defined

So we replace `KFileDialog` with `QFileDialog` and move some arguments around:

    filename = QFileDialog.getOpenFileName(self.userinterface, _("Import key"), url, 'application/pgp-keys')

The only other thing missing is that KFileDialog wanted a KUrl while QFileDialog wants a string. So we should cast our QUrl call:

    url = str(QUrl(home))

Maybe there's a prettier/better way to do this, but that's what I got for 10 minutes which is more progress than I can say this bug has had in the past XD If people can test those changes, it would be greatly appreciated.