From 0d5b9141a5bda1406c513d174dbce95eb5ed0a97 Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 15 Nov 2004 15:37:47 +0000 Subject: Move the method out --- (limited to 'noncore/settings') 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 @@ -38,11 +38,10 @@ #include 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); @@ -50,6 +49,14 @@ SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl ) 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; -- cgit v0.9.0.2