summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index f2e1bf8..ebe761a 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1918,48 +1918,50 @@ void MainWindow::enableQuick()
qApp->processEvents();
KOPrefs::instance()->mPassiveSyncPort = retfile;
bool ok;
Q_UINT16 port = retfile.toUInt(&ok);
if ( ! ok ) {
qDebug("no valid port ");
return;
}
qDebug("port %d ", port);
mServerSocket = new KServerSocket ( port ,1 );
qDebug("connected ");
if ( !mServerSocket->ok() ) {
qWarning("Failed to bind to port %d", port);
delete mServerSocket;
mServerSocket = 0;
return;
}
connect( mServerSocket, SIGNAL ( sendFile(QSocket*) ), this, SLOT ( sendFile(QSocket*) ) );
connect( mServerSocket, SIGNAL ( getFile(QSocket*) ), this, SLOT ( getFile(QSocket*) ) );
}
void MainWindow::sendFile(QSocket* socket)
{
setCaption( i18n("Received request for file") );
qDebug("MainWindow::sendFile(QSocket* s) ");
+ if ( mSyncActionDialog )
+ delete mSyncActionDialog;
mSyncActionDialog = new QDialog ( this, "input-dialog", true );
mSyncActionDialog->setCaption(i18n("KO/Pi - WARNING"));
QLabel* label = new QLabel( i18n("Synchronizing...\nDo not use\nthis application!\n"), mSyncActionDialog );
QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog );
lay->addWidget( label);
lay->setMargin(7);
lay->setSpacing(7);
mSyncActionDialog->setFixedSize( 200,100 );
mSyncActionDialog->show();
qApp->processEvents();
qDebug("saving ... ");
save();
QString fileName = defaultFileName();
QFile file( fileName );
if (!file.open( IO_ReadOnly ) ) {
setCaption( i18n("Error open file") );
delete mSyncActionDialog;
mSyncActionDialog = 0;
qDebug("error open cal file ");
return ;
}
setCaption( i18n("Sending file...") );
QTextStream ts( &file );