diff --git a/Mailnag/common/accountlist.py b/Mailnag/common/accountlist.py index bb645f7..013acc2 100644 --- a/Mailnag/common/accountlist.py +++ b/Mailnag/common/accountlist.py @@ -92,12 +92,7 @@ class AccountList(list): # delete obsolete entries from Keyring self._keyring.remove(self) - - def import_from_keyring(self): - # append imported accounts to existing accounts - self.extend(self._keyring.import_accounts()) - - + def _get_account_cfg(self, cfg, section_name, option_name): if cfg.has_option(section_name, option_name): return cfg.get(section_name, option_name) diff --git a/Mailnag/common/keyring.py b/Mailnag/common/keyring.py index 77bb96a..e7593e6 100644 --- a/Mailnag/common/keyring.py +++ b/Mailnag/common/keyring.py @@ -69,39 +69,6 @@ class Keyring: return '' - def import_accounts(self): # get email accounts from Gnome-Keyring - accounts = [] - (result, ids) = GnomeKeyring.list_item_ids_sync(self._defaultKeyring) - if result == GnomeKeyring.Result.OK: - displayNameDict = {} - for identity in ids: - (result, item) = GnomeKeyring.item_get_info_sync(self._defaultKeyring, identity) - displayNameDict[item.get_display_name()] = identity - for displayName in displayNameDict: - if displayName.startswith('pop://') \ - or displayName.startswith('imap://'): - server = displayName.split('@')[1][:-1] - if displayName.startswith('imap://'): - imap = True - user = displayName.split('@')[0][7:] - else: - imap = False - user = displayName.split('@')[0][6:] - - user = user.replace('%40','@') - - if ';' in user: - user = user.split(';')[0] - - (result, item) = GnomeKeyring.item_get_info_sync(self._defaultKeyring, \ - displayNameDict[displayName]) - password = item.get_secret() - - accounts.append(Account(enabled = True, name = "%s (%s)" % (server, user), \ - server = server, user = user, password = password, imap = imap)) - return accounts - - def set(self, protocol, user, server, password): # store password in Gnome-Keyring if password != '': displayNameDict = {} diff --git a/Mailnag/configuration/configwindow.py b/Mailnag/configuration/configwindow.py index 4b114e1..1936c57 100644 --- a/Mailnag/configuration/configwindow.py +++ b/Mailnag/configuration/configwindow.py @@ -142,12 +142,6 @@ class ConfigWindow: self._accounts.load_from_cfg(self._cfg) - if len(self._accounts) == 0: - self._accounts.import_from_keyring() - if len(self._accounts) > 0 and \ - (not self._show_yesno_dialog(_("Mailnag found %s mail accounts on this computer.\n\nDo you want to import them?") % len(self._accounts))): - del self._accounts[:] - for acc in self._accounts: row = [acc, acc.enabled, acc.name] self._liststore_accounts.append(row)