summaryrefslogtreecommitdiff
authorzecke <zecke>2004-11-15 15:25:22 (UTC)
committer zecke <zecke>2004-11-15 15:25:22 (UTC)
commitef26112d97cd5573642a0f00fd54347229857402 (patch) (unidiff)
treecb62b1e2a6a6a5ccd301fcbb0faac535ff865ee1
parent3b935c93d5576e6590ed89c75066983124e2c628 (diff)
downloadopie-ef26112d97cd5573642a0f00fd54347229857402.zip
opie-ef26112d97cd5573642a0f00fd54347229857402.tar.gz
opie-ef26112d97cd5573642a0f00fd54347229857402.tar.bz2
-Remove char cast for homedir but use QFile::encodeName
-Make it quicklaunchable
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sshkeys/main.cpp28
-rw-r--r--noncore/settings/sshkeys/opie-sshkeys.control2
-rw-r--r--noncore/settings/sshkeys/sshkeys.cpp16
-rw-r--r--noncore/settings/sshkeys/sshkeys.h1
-rw-r--r--noncore/settings/sshkeys/sshkeys.pro4
5 files changed, 20 insertions, 31 deletions
diff --git a/noncore/settings/sshkeys/main.cpp b/noncore/settings/sshkeys/main.cpp
index 9f19d0f..d0c0e2b 100644
--- a/noncore/settings/sshkeys/main.cpp
+++ b/noncore/settings/sshkeys/main.cpp
@@ -1,2 +1,2 @@
1/* 1/*
2 * ssh-agent key manipulation utility 2 * ssh-agent key manipulation utility
@@ -21,29 +21,7 @@
21 21
22#include <qpe/qpeapplication.h> 22#include <opie2/oapplicationfactory.h>
23#include "sshkeys.h" 23#include "sshkeys.h"
24#include <stdio.h>
25#include <sys/types.h>
26#include <sys/stat.h>
27#include <fcntl.h>
28#include <sys/ioctl.h>
29#include <unistd.h>
30 24
31int main(int argc, char *argv[]) 25OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<SSHKeysApp> )
32{
33 QPEApplication a(argc, argv);
34 SSHKeysApp app;
35 int fd;
36 26
37 /* If we had a controlling TTY, detach from it.
38 This is to ensure that SSH uses ssh-askpass */
39 fd = open("/dev/tty", O_RDONLY);
40 if (fd != -1) {
41 ioctl(fd, TIOCNOTTY, NULL);
42 close(fd);
43 }
44
45 a.showMainWidget(&app);
46
47 return a.exec();
48}
49 27
diff --git a/noncore/settings/sshkeys/opie-sshkeys.control b/noncore/settings/sshkeys/opie-sshkeys.control
index 08e3508..1f2a1fc 100644
--- a/noncore/settings/sshkeys/opie-sshkeys.control
+++ b/noncore/settings/sshkeys/opie-sshkeys.control
@@ -1,3 +1,3 @@
1Package: opie-sshkeys 1Package: opie-sshkeys
2Files: bin/sshkeys apps/Settings/sshkeys.desktop pics/sshkeys/sshkeys.png 2Files: plugins/applications/libsshkeys.so* bin/sshkeys apps/Settings/sshkeys.desktop pics/sshkeys/sshkeys.png
3Priority: optional 3Priority: optional
diff --git a/noncore/settings/sshkeys/sshkeys.cpp b/noncore/settings/sshkeys/sshkeys.cpp
index cebc845..d8b1014 100644
--- a/noncore/settings/sshkeys/sshkeys.cpp
+++ b/noncore/settings/sshkeys/sshkeys.cpp
@@ -23,2 +23,4 @@
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <qdir.h>
25#include <qfile.h>
24#include <qmultilineedit.h> 26#include <qmultilineedit.h>
@@ -30,2 +32,4 @@
30#include <sys/stat.h> 32#include <sys/stat.h>
33#include <fcntl.h>
34#include <sys/ioctl.h>
31#include <stdlib.h> 35#include <stdlib.h>
@@ -41,3 +45,11 @@ SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl )
41{ 45{
42 char *home = getenv("HOME"); 46 /* If we had a controlling TTY, detach from it.
47 This is to ensure that SSH uses ssh-askpass */
48 int fd = open("/dev/tty", O_RDONLY);
49 if (fd != -1) {
50 ioctl(fd, TIOCNOTTY, NULL);
51 close(fd);
52 }
53
54 QCString home = QFile::encodeName( QDir::homeDirPath() );
43 unsigned i; 55 unsigned i;
@@ -63,3 +75,3 @@ SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl )
63 thiskeyname[31] = 0; 75 thiskeyname[31] = 0;
64 snprintf(thiskeyname, 31, "%s/.ssh/%s", home, keynames[i]); 76 snprintf(thiskeyname, 31, "%s/.ssh/%s", home.data(), keynames[i]);
65 if (!access(thiskeyname, R_OK)) { 77 if (!access(thiskeyname, R_OK)) {
diff --git a/noncore/settings/sshkeys/sshkeys.h b/noncore/settings/sshkeys/sshkeys.h
index 519f540..0807f74 100644
--- a/noncore/settings/sshkeys/sshkeys.h
+++ b/noncore/settings/sshkeys/sshkeys.h
@@ -35,2 +35,3 @@ class SSHKeysApp : public SSHKeysBase
35 ~SSHKeysApp(); 35 ~SSHKeysApp();
36 static QString appName() { return QString::fromLatin1( QUICKAPP_NAME); }
36 37
diff --git a/noncore/settings/sshkeys/sshkeys.pro b/noncore/settings/sshkeys/sshkeys.pro
index 87d5ce9..0910d29 100644
--- a/noncore/settings/sshkeys/sshkeys.pro
+++ b/noncore/settings/sshkeys/sshkeys.pro
@@ -1,3 +1,2 @@
1TEMPLATE = app 1CONFIG += qt quick-app
2CONFIG += qt warn_on
3HEADERS = sshkeys.h 2HEADERS = sshkeys.h
@@ -9,3 +8,2 @@ DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe -lopiecore2 8LIBS += -lqpe -lopiecore2
10DESTDIR = $(OPIEDIR)/bin
11 9