summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/blue-pin/pindlg.cc
Side-by-side diff
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.cc26
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
@@ -12,42 +12,30 @@
/* STD */
#include <stdio.h>
using namespace OpieTooth;
-PinDlg::PinDlg( const QString& status,
- const QString& mac, QWidget* parent,
- const char* name )
- : PinDlgBase( parent, name, WType_Modal )
-{
- m_mac = mac;
- test( mac );
- txtStatus->setText(status);
- if(!m_mac.isEmpty())
- QPEApplication::showDialog( this );
-}
-
PinDlg::PinDlg(QWidget* parent,
const char* name,
Qt::WFlags f )
: PinDlgBase( parent, name, f )
{
m_mac = makeMacFromArgs();
if(m_mac.isEmpty())
{
// can't obtain MAC
printf("ERR\n");
- qApp->quit();
+ ::exit(0);
}
else
{
test( m_mac );
txtStatus->setText(makeTextFromArgs());
- QPEApplication::showDialog( this ) ;
+ QPEApplication::showDialog( this , true) ;
}
}
PinDlg::~PinDlg()
{}
@@ -65,18 +53,13 @@ void PinDlg::test( const QString& mac )
{
if (!mac.isEmpty() )
{
Config cfg("bluepin");
cfg.setGroup(mac);
lnePin->setText(cfg.readEntryCrypt("pin", QString::null ) );
- if ( !lnePin->text().isEmpty() )
- {
- //QTimer::singleShot(100, this, SLOT(accept() ) );
- }
}
-
}
QString PinDlg::makeTextFromArgs()
{
if(qApp->argc() > 2)
{
@@ -97,19 +80,19 @@ QString PinDlg::makeTextFromArgs()
status += "<br>";
status += "[" + bdaddr + "]";
return status ;
}
else
- return QString();
+ return QString::null;
}
QString PinDlg::makeMacFromArgs()
{
if(qApp->argc() < 3)
- return QString();
+ return QString::null;
else
return qApp->argv()[2] ;
}
void PinDlg::accept()
{
@@ -119,7 +102,8 @@ void PinDlg::accept()
cfg.setGroup(m_mac );
cfg.writeEntryCrypt("pin", lnePin->text() );
}
printf("PIN:%s\n", lnePin->text().latin1());
QDialog::accept();
qApp->quit();
+ ::exit(0);
}