summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index b1c7709..b597a6a 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1959,48 +1959,54 @@ void MainWindow::syncRemote( KSyncProfile* prof, bool ask)
//
qDebug("KO: Remote copy result(0 = okay): %d ",result );
if ( result != 0 ) {
int len = maxlen;
while ( len < command.length() ) {
command.insert( len , "\n" );
len += maxlen +2;
}
question = i18n("Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n").arg (command) ;
QMessageBox::information( this, i18n("KO/Pi Sync - ERROR"),
question,
i18n("Okay!")) ;
setCaption ("KO/Pi");
return;
}
setCaption ( i18n( "Copying succeed." ) );
//qDebug(" file **%s** ",prof->getLocalTempFile().latin1() );
if ( syncWithFile( prof->getLocalTempFile(), true ) ) {
// Event* e = mView->getLastSyncEvent();
// e->setReadOnly( false );
// e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]);
// e->setReadOnly( true );
if ( KOPrefs::instance()->mWriteBackFile ) {
command = prof->getPostSyncCommand();
+ int fi;
+ if ( (fi = command.find("$PWD$")) > 0 ) {
+ QString pwd = getPassword();
+ command = command.left( fi )+ pwd + command.mid( fi+5 );
+
+ }
setCaption ( i18n( "Writing back file ..." ) );
result = system ( command );
qDebug("KO: Writing back file result: %d ", result);
if ( result != 0 ) {
setCaption ( i18n( "Writing back file result: " )+QString::number( result ) );
return;
} else {
setCaption ( i18n( "Syncronization sucessfully completed" ) );
}
}
}
return;
}
void MainWindow::syncSSH()
{
// not used anymore
QTime timer;
timer.start();
//qDebug("MainWindow::syncssh() ");
KOPrefs *p = KOPrefs::instance();
QString localFile = p->mLocalTempFile;
QString remoteIP = p->mRemoteIP;
QString remoteUser = p->mRemoteUser;
QString remoteFile = p->mRemoteFile;