diff --git a/scriptengines/javascript/simplebindings/filedialogproxy.cpp b/scriptengines/javascript/simplebindings/filedialogproxy.cpp index dc000750e..4eb6ab090 100644 --- a/scriptengines/javascript/simplebindings/filedialogproxy.cpp +++ b/scriptengines/javascript/simplebindings/filedialogproxy.cpp @@ -28,12 +28,12 @@ FileDialogProxy::FileDialogProxy(KFileDialog::OperationMode mode, QObject *paren { kDebug() << "hello beautiful"; m_dialog->setOperationMode(mode); - connect(m_dialog, SIGNAL(okClicked()), this, SLOT(dialogFinished())); + connect(m_dialog, SIGNAL(finished()), this, SLOT(dialogFinished())); } FileDialogProxy::~FileDialogProxy() { - kDebug() << "bye bye"; + kDebug() << this << "bye bye"; delete m_dialog; } @@ -126,6 +126,9 @@ void FileDialogProxy::show() void FileDialogProxy::dialogFinished() { + if (m_dialog->result() == QDialog::Accepted) { + emit accepted(this); + } emit finished(this); } diff --git a/scriptengines/javascript/simplebindings/filedialogproxy.h b/scriptengines/javascript/simplebindings/filedialogproxy.h index 8ec5a27e9..bfce066d1 100644 --- a/scriptengines/javascript/simplebindings/filedialogproxy.h +++ b/scriptengines/javascript/simplebindings/filedialogproxy.h @@ -72,6 +72,7 @@ public Q_SLOTS: void show(); Q_SIGNALS: + void accepted(FileDialogProxy *); void finished(FileDialogProxy *); private Q_SLOTS: