Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > by-pkgid > facf40330f4ff19942d625bbc4c62af9 > files > 1

openssh-askpass-qt-0.2-3mdv2008.1.src.rpm

--- 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();
 }