summaryrefslogtreecommitdiff
path: root/noncore/settings/sshkeys
authorzecke <zecke>2004-03-14 16:01:52 (UTC)
committer zecke <zecke>2004-03-14 16:01:52 (UTC)
commitf12af18557c8f376f0c6c30e80a85737ff6c592e (patch) (side-by-side diff)
treed60806f34f4ff6af82491579e80c9ef72cd4071e /noncore/settings/sshkeys
parent13aeeabab5f2a6262b33de83cc9559a49365e325 (diff)
downloadopie-f12af18557c8f376f0c6c30e80a85737ff6c592e.zip
opie-f12af18557c8f376f0c6c30e80a85737ff6c592e.tar.gz
opie-f12af18557c8f376f0c6c30e80a85737ff6c592e.tar.bz2
Make use of ODP
Diffstat (limited to 'noncore/settings/sshkeys') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/sshkeys/sshkeys.cpp15
-rw-r--r--noncore/settings/sshkeys/sshkeys.h10
2 files changed, 13 insertions, 12 deletions
diff --git a/noncore/settings/sshkeys/sshkeys.cpp b/noncore/settings/sshkeys/sshkeys.cpp
index e76fd6b..31f6b85 100644
--- a/noncore/settings/sshkeys/sshkeys.cpp
+++ b/noncore/settings/sshkeys/sshkeys.cpp
@@ -24,41 +24,42 @@
#include <qmultilineedit.h>
#include <qpushbutton.h>
#include <qlistview.h>
#include <qcombobox.h>
#include <sys/types.h>
#include <sys/stat.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" };
SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl )
: SSHKeysBase( parent, name, fl )
{
char *home = getenv("HOME");
unsigned i;
connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton()));
connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton()));
connect(RemoveAllButton, SIGNAL(clicked()), this, SLOT(doRemoveAllButton()));
- connect(&addprocess, SIGNAL(receivedStdout(OProcess*,char*,int)),
+ connect(&addprocess, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
this, SLOT(log_sshadd_output(OProcess*,char*,int)));
- connect(&addprocess, SIGNAL(receivedStderr(OProcess*,char*,int)),
+ connect(&addprocess, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
this, SLOT(log_sshadd_stderr(OProcess*,char*,int)));
- connect(&addprocess, SIGNAL(processExited(OProcess*)),
+ connect(&addprocess, SIGNAL(processExited(Opie::Core::OProcess*)),
this, SLOT(ssh_add_exited(OProcess*)));
connect(KeyFileName, SIGNAL(textChanged(const QString&)),
this, SLOT(add_text_changed(const QString&)));
if (home) {
for (i = 0; i < sizeof(keynames)/sizeof(keynames[0]); i++) {
char thiskeyname[32];
thiskeyname[31] = 0;
snprintf(thiskeyname, 31, "%s/.ssh/%s", home, keynames[i]);
if (!access(thiskeyname, R_OK)) {
@@ -77,27 +78,27 @@ SSHKeysApp::~SSHKeysApp()
void SSHKeysApp::doRefreshListButton()
{
OProcess sshadd_process;
QListViewItem *t = KeyList->firstChild();
while(t) {
QListViewItem *next = t->nextSibling();
KeyList->takeItem(t);
delete(t);
t = next;
}
- connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)),
+ connect(&sshadd_process, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
this, SLOT(get_list_keys_output(OProcess*,char*,int)));
- connect(&sshadd_process, SIGNAL(receivedStderr(OProcess*,char*,int)),
+ connect(&sshadd_process, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
this, SLOT(log_sshadd_stderr(OProcess*,char*,int)));
keystate = KeySize;
incoming_keyname="";
incoming_keysize="";
incoming_keyfingerprint="";
// log_text("Running ssh-add -l");
sshadd_process << "ssh-add" << "-l";
bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput);
if (!ret) {
log_text(tr("Error running ssh-add"));
@@ -268,26 +269,26 @@ void SSHKeysApp::doAddButton()
}
void SSHKeysApp::log_text(const char *text)
{
TextOutput->append(text);
TextOutput->setCursorPosition(TextOutput->numLines()+1, 0, FALSE);
}
void SSHKeysApp::doRemoveAllButton()
{
OProcess sshadd_process;
- connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)),
+ connect(&sshadd_process, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
this, SLOT(log_sshadd_output(OProcess*,char*,int)));
- connect(&sshadd_process, SIGNAL(receivedStderr(OProcess*,char*,int)),
+ connect(&sshadd_process, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
this, SLOT(log_sshadd_stderr(OProcess*,char*,int)));
// log_text(tr("Running ssh-add -D"));
sshadd_process << "ssh-add" << "-D";
bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput);
if (!ret) {
log_text(tr("Error running ssh-add"));
}
flush_sshadd_output();
doRefreshListButton();
}
diff --git a/noncore/settings/sshkeys/sshkeys.h b/noncore/settings/sshkeys/sshkeys.h
index 7483bbc..519f540 100644
--- a/noncore/settings/sshkeys/sshkeys.h
+++ b/noncore/settings/sshkeys/sshkeys.h
@@ -34,28 +34,28 @@ class SSHKeysApp : public SSHKeysBase
SSHKeysApp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~SSHKeysApp();
private:
void log_text(const char *text);
void flush_sshadd_output(void);
enum { Noise, KeyName, KeySize, KeyFingerprint } keystate;
QString incoming_keyname;
QString incoming_keysize;
QString incoming_keyfingerprint;
QString incoming_noise;
- OProcess addprocess;
+ Opie::Core::OProcess addprocess;
QString pending_stdout;
QString pending_stderr;
private slots:
void doAddButton();
void doRefreshListButton();
void doRemoveAllButton();
- void get_list_keys_output(OProcess *proc, char *buffer, int buflen);
- void log_sshadd_output(OProcess *proc, char *buffer, int buflen);
- void log_sshadd_stderr(OProcess *proc, char *buffer, int buflen);
- void ssh_add_exited(OProcess *proc);
+ void get_list_keys_output(Opie::Core::OProcess *proc, char *buffer, int buflen);
+ void log_sshadd_output(Opie::Core::OProcess *proc, char *buffer, int buflen);
+ void log_sshadd_stderr(Opie::Core::OProcess *proc, char *buffer, int buflen);
+ void ssh_add_exited(Opie::Core::OProcess *proc);
void add_text_changed(const QString &text);
};
#endif