From cc00ea4b5def00b6664bd5d9c5e5d59f5ce62732 Mon Sep 17 00:00:00 2001 From: zecke Date: Sun, 20 Feb 2005 13:06:59 +0000 Subject: -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) --- diff --git a/noncore/net/opietooth/blue-pin/main.cc b/noncore/net/opietooth/blue-pin/main.cc index dbe5b41..90d42e0 100644 --- a/noncore/net/opietooth/blue-pin/main.cc +++ b/noncore/net/opietooth/blue-pin/main.cc @@ -7,5 +7,10 @@ #include "pindlg.h" -using namespace Opie::Core; -OPIE_EXPORT_APP( OApplicationFactory ) +int main(int argc, char *argv[]) { + QPEApplication oapp(argc, argv); + + OpieTooth::PinDlg dlg; + return oapp.exec(); +} + 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 @@ 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 ) @@ -38,13 +26,13 @@ PinDlg::PinDlg(QWidget* parent, { // 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) ; } } @@ -68,12 +56,7 @@ void PinDlg::test( const QString& mac ) 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() @@ -100,13 +83,13 @@ QString PinDlg::makeTextFromArgs() 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] ; } @@ -122,4 +105,5 @@ void PinDlg::accept() printf("PIN:%s\n", lnePin->text().latin1()); QDialog::accept(); qApp->quit(); + ::exit(0); } diff --git a/noncore/net/opietooth/blue-pin/pindlg.h b/noncore/net/opietooth/blue-pin/pindlg.h index 5f7dc55..8623274 100644 --- a/noncore/net/opietooth/blue-pin/pindlg.h +++ b/noncore/net/opietooth/blue-pin/pindlg.h @@ -10,14 +10,7 @@ namespace OpieTooth { Q_OBJECT public: - PinDlg(const QString& text="", - const QString& mac="", - QWidget* parent = 0, - const char* name= 0 ); - - PinDlg(QWidget* parent, - const char* name, - Qt::WFlags f ); + PinDlg(QWidget* parent = 0,const char* name = 0, Qt::WFlags f = 0); ~PinDlg(); void setMac( const QString& ); diff --git a/noncore/net/opietooth/blue-pin/pindlgbase.ui b/noncore/net/opietooth/blue-pin/pindlgbase.ui index 6784de7..a79bb49 100644 --- a/noncore/net/opietooth/blue-pin/pindlgbase.ui +++ b/noncore/net/opietooth/blue-pin/pindlgbase.ui @@ -12,15 +12,15 @@ 0 0 - 254 - 245 + 267 + 161 caption Please enter pin - + margin 11 @@ -29,28 +29,7 @@ spacing 6 - - - name - Spacer4_2 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - + QLabel name @@ -65,7 +44,7 @@ RichText - + QLayoutWidget name @@ -153,28 +132,7 @@ - - - name - Spacer5 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - + QLayoutWidget name @@ -255,7 +213,7 @@ - + -- cgit v0.9.0.2