--- openssh-askpass-qt-0.2/askpassqt.cpp +++ openssh-askpass-qt-0.2/askpassqt.cpp @@ -24,7 +24,7 @@ #include "askpassqt.h" AskPassQt::AskPassQt( QWidget* parent, const char* name, bool modal, WFlags fl ) - : AskPassQtBase( parent, name, modal, fl ) + : AskPassQtBase( parent, name, modal, fl ), status( 1 ) { } @@ -33,5 +33,11 @@ AskPassQt::~AskPassQt() { /* NOOP */ } void AskPassQt::okSlot() { puts( lePasswd->text() ); + status = 0; close(); } + +void AskPassQt::quitWithStatus() +{ + exit(status); +} --- openssh-askpass-qt-0.2/askpassqt.h +++ openssh-askpass-qt-0.2/askpassqt.h @@ -28,5 +28,8 @@ public: ~AskPassQt(); public slots: void okSlot(); + void quitWithStatus(); +private: + int status; }; --- openssh-askpass-qt-0.2/main.cpp +++ openssh-askpass-qt-0.2/main.cpp @@ -29,6 +29,6 @@ int main( int argc, char ** argv ) QApplication a( argc, argv ); AskPassQt w; w.show(); - a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); + a.connect( &a, SIGNAL( lastWindowClosed() ), &w, SLOT( quitWithStatus() ) ); return a.exec(); }