summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sshkeys/sshkeys.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/noncore/settings/sshkeys/sshkeys.cpp b/noncore/settings/sshkeys/sshkeys.cpp
index d8b1014..57118c9 100644
--- a/noncore/settings/sshkeys/sshkeys.cpp
+++ b/noncore/settings/sshkeys/sshkeys.cpp
@@ -33,28 +33,35 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
using namespace Opie::Core;
-static char *keynames[] = { "identity", "id_rsa", "id_dsa" };
+static const char *keynames[] = { "identity", "id_rsa", "id_dsa" };
-SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl )
- : SSHKeysBase( parent, name, fl )
-{
+
+static void detachTerminal() {
/* If we had a controlling TTY, detach from it.
This is to ensure that SSH uses ssh-askpass */
int fd = open("/dev/tty", O_RDONLY);
if (fd != -1) {
ioctl(fd, TIOCNOTTY, NULL);
close(fd);
}
+}
+
+
+SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl )
+ : SSHKeysBase( parent, name, fl )
+{
+ detachTerminal();
+
QCString home = QFile::encodeName( QDir::homeDirPath() );
unsigned i;
connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton()));
connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton()));
connect(RemoveAllButton, SIGNAL(clicked()), this, SLOT(doRemoveAllButton()));