-rw-r--r-- | noncore/settings/sshkeys/sshkeys.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/settings/sshkeys/sshkeys.cpp b/noncore/settings/sshkeys/sshkeys.cpp index 701356a..3b4dce6 100644 --- a/noncore/settings/sshkeys/sshkeys.cpp +++ b/noncore/settings/sshkeys/sshkeys.cpp | |||
@@ -59,49 +59,52 @@ void SSHKeysApp::doRefreshListButton() | |||
59 | QListViewItem *t = KeyList->firstChild(); | 59 | QListViewItem *t = KeyList->firstChild(); |
60 | 60 | ||
61 | while(t) { | 61 | while(t) { |
62 | QListViewItem *next = t->nextSibling(); | 62 | QListViewItem *next = t->nextSibling(); |
63 | KeyList->takeItem(t); | 63 | KeyList->takeItem(t); |
64 | delete(t); | 64 | delete(t); |
65 | t = next; | 65 | t = next; |
66 | } | 66 | } |
67 | 67 | ||
68 | connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)), | 68 | connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)), |
69 | this, SLOT(get_list_keys_output(OProcess*,char*,int))); | 69 | this, SLOT(get_list_keys_output(OProcess*,char*,int))); |
70 | 70 | ||
71 | keystate = KeySize; | 71 | keystate = KeySize; |
72 | incoming_keyname=""; | 72 | incoming_keyname=""; |
73 | incoming_keysize=""; | 73 | incoming_keysize=""; |
74 | incoming_keyfingerprint=""; | 74 | incoming_keyfingerprint=""; |
75 | 75 | ||
76 | //log_text("Running ssh-add -l"); | 76 | //log_text("Running ssh-add -l"); |
77 | sshadd_process << "ssh-add" << "-l"; | 77 | sshadd_process << "ssh-add" << "-l"; |
78 | bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput); | 78 | bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput); |
79 | if (!ret) { | 79 | if (!ret) { |
80 | log_text(tr("Error running ssh-add")); | 80 | log_text(tr("Error running ssh-add")); |
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | 83 | if (sshadd_process.exitStatus() == 2) { | |
84 | log_text(tr("Connection to ssh-agent failed")); | ||
85 | setEnabled(FALSE); | ||
86 | } | ||
84 | } | 87 | } |
85 | 88 | ||
86 | void SSHKeysApp::get_list_keys_output(OProcess *proc, char *buffer, int buflen) | 89 | void SSHKeysApp::get_list_keys_output(OProcess *proc, char *buffer, int buflen) |
87 | { | 90 | { |
88 | int i; | 91 | int i; |
89 | (void) proc; | 92 | (void) proc; |
90 | 93 | ||
91 | for (i=0; i<buflen; i++) { | 94 | for (i=0; i<buflen; i++) { |
92 | switch(keystate) { | 95 | switch(keystate) { |
93 | case Noise: | 96 | case Noise: |
94 | noise: | 97 | noise: |
95 | if (buffer[i] == '\n') { | 98 | if (buffer[i] == '\n') { |
96 | log_text(incoming_noise.local8Bit()); | 99 | log_text(incoming_noise.local8Bit()); |
97 | incoming_noise = ""; | 100 | incoming_noise = ""; |
98 | keystate = KeySize; | 101 | keystate = KeySize; |
99 | } else { | 102 | } else { |
100 | incoming_noise += buffer[i]; | 103 | incoming_noise += buffer[i]; |
101 | } | 104 | } |
102 | break; | 105 | break; |
103 | 106 | ||
104 | case KeySize: | 107 | case KeySize: |
105 | if (isdigit(buffer[i])) { | 108 | if (isdigit(buffer[i])) { |
106 | incoming_keysize += buffer[i]; | 109 | incoming_keysize += buffer[i]; |
107 | } else if (buffer[i] == ' ') { | 110 | } else if (buffer[i] == ' ') { |