mirror of
https://github.com/pulb/mailnag.git
synced 2026-05-07 11:16:49 +02:00
removed evolution account import as it isn't working anymore
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user