author | zecke <zecke> | 2005-02-20 13:06:59 (UTC) |
---|---|---|
committer | zecke <zecke> | 2005-02-20 13:06:59 (UTC) |
commit | cc00ea4b5def00b6664bd5d9c5e5d59f5ce62732 (patch) (unidiff) | |
tree | 23c51eb79b9d81519b6cd50221b0bbb051415634 /noncore/net/opietooth/blue-pin/pindlg.cc | |
parent | bdbe220d0096667f26c8c25c1e1011c32fc54524 (diff) | |
download | opie-cc00ea4b5def00b6664bd5d9c5e5d59f5ce62732.zip opie-cc00ea4b5def00b6664bd5d9c5e5d59f5ce62732.tar.gz opie-cc00ea4b5def00b6664bd5d9c5e5d59f5ce62732.tar.bz2 |
-Use own main method
-Remove default c'tor and use the remaining one as default
-QString() -> QString::null (for Qt4 we will do the opposite)
-use qApp->quit() and exit to be sure to really exit
Still open: do not use the depcreated latin1 c'tor of QString,
it is safe to use it here though (we only get IN/OUT and a mac address)
Diffstat (limited to 'noncore/net/opietooth/blue-pin/pindlg.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/blue-pin/pindlg.cc | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/noncore/net/opietooth/blue-pin/pindlg.cc b/noncore/net/opietooth/blue-pin/pindlg.cc index 96be1e5..e40fe33 100644 --- a/noncore/net/opietooth/blue-pin/pindlg.cc +++ b/noncore/net/opietooth/blue-pin/pindlg.cc | |||
@@ -15,18 +15,6 @@ | |||
15 | 15 | ||
16 | using namespace OpieTooth; | 16 | using namespace OpieTooth; |
17 | 17 | ||
18 | PinDlg::PinDlg( const QString& status, | ||
19 | const QString& mac, QWidget* parent, | ||
20 | const char* name ) | ||
21 | : PinDlgBase( parent, name, WType_Modal ) | ||
22 | { | ||
23 | m_mac = mac; | ||
24 | test( mac ); | ||
25 | txtStatus->setText(status); | ||
26 | if(!m_mac.isEmpty()) | ||
27 | QPEApplication::showDialog( this ); | ||
28 | } | ||
29 | |||
30 | PinDlg::PinDlg(QWidget* parent, | 18 | PinDlg::PinDlg(QWidget* parent, |
31 | const char* name, | 19 | const char* name, |
32 | Qt::WFlags f ) | 20 | Qt::WFlags f ) |
@@ -38,13 +26,13 @@ PinDlg::PinDlg(QWidget* parent, | |||
38 | { | 26 | { |
39 | // can't obtain MAC | 27 | // can't obtain MAC |
40 | printf("ERR\n"); | 28 | printf("ERR\n"); |
41 | qApp->quit(); | 29 | ::exit(0); |
42 | } | 30 | } |
43 | else | 31 | else |
44 | { | 32 | { |
45 | test( m_mac ); | 33 | test( m_mac ); |
46 | txtStatus->setText(makeTextFromArgs()); | 34 | txtStatus->setText(makeTextFromArgs()); |
47 | QPEApplication::showDialog( this ) ; | 35 | QPEApplication::showDialog( this , true) ; |
48 | } | 36 | } |
49 | } | 37 | } |
50 | 38 | ||
@@ -68,12 +56,7 @@ void PinDlg::test( const QString& mac ) | |||
68 | Config cfg("bluepin"); | 56 | Config cfg("bluepin"); |
69 | cfg.setGroup(mac); | 57 | cfg.setGroup(mac); |
70 | lnePin->setText(cfg.readEntryCrypt("pin", QString::null ) ); | 58 | lnePin->setText(cfg.readEntryCrypt("pin", QString::null ) ); |
71 | if ( !lnePin->text().isEmpty() ) | ||
72 | { | ||
73 | //QTimer::singleShot(100, this, SLOT(accept() ) ); | ||
74 | } | ||
75 | } | 59 | } |
76 | |||
77 | } | 60 | } |
78 | 61 | ||
79 | QString PinDlg::makeTextFromArgs() | 62 | QString PinDlg::makeTextFromArgs() |
@@ -100,13 +83,13 @@ QString PinDlg::makeTextFromArgs() | |||
100 | return status ; | 83 | return status ; |
101 | } | 84 | } |
102 | else | 85 | else |
103 | return QString(); | 86 | return QString::null; |
104 | } | 87 | } |
105 | 88 | ||
106 | QString PinDlg::makeMacFromArgs() | 89 | QString PinDlg::makeMacFromArgs() |
107 | { | 90 | { |
108 | if(qApp->argc() < 3) | 91 | if(qApp->argc() < 3) |
109 | return QString(); | 92 | return QString::null; |
110 | else | 93 | else |
111 | return qApp->argv()[2] ; | 94 | return qApp->argv()[2] ; |
112 | } | 95 | } |
@@ -122,4 +105,5 @@ void PinDlg::accept() | |||
122 | printf("PIN:%s\n", lnePin->text().latin1()); | 105 | printf("PIN:%s\n", lnePin->text().latin1()); |
123 | QDialog::accept(); | 106 | QDialog::accept(); |
124 | qApp->quit(); | 107 | qApp->quit(); |
108 | ::exit(0); | ||
125 | } | 109 | } |