From 193af441a127a0daabbd17c512e34817ddbcadfd Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Sat, 16 Mar 2002 23:10:52 +0000 Subject: - ncpd now works with both Series 3 and Series 5 - ncpd now has autobaud feature (default on), which cycles baudrate - lib: added getSpeed() for retrieving current speed of connection - plpftp: Use getSpeed() - plpbackup: Ongoing work - configure stuff: removed several entries from acconfig.h comments now defined as 3rd arg to AC_DEFINE... --- kde2/kpsion/kpsion.cpp | 71 +++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 30 deletions(-) (limited to 'kde2') diff --git a/kde2/kpsion/kpsion.cpp b/kde2/kpsion/kpsion.cpp index e6a8d4d..6ba36a7 100644 --- a/kde2/kpsion/kpsion.cpp +++ b/kde2/kpsion/kpsion.cpp @@ -864,37 +864,49 @@ doBackup() { u_int32_t handle; kapp->processEvents(); - res = plpRfsv->fopen(plpRfsv->opMode(rfsv::PSI_O_RDONLY), fn, - handle); - if (res != rfsv::E_PSI_GEN_NONE) { - if (KMessageBox::warningYesNo(this, i18n("Could not open
%1
").arg(fn)) == KMessageBox::No) { - badBackup = true; - break; - } else { - e.setName("!"); - continue; - } - } - unsigned char *buff = new unsigned char[RFSV_SENDLEN]; - u_int32_t len; + bool tryLoop = true; do { - if ((res = plpRfsv->fread(handle, buff, RFSV_SENDLEN, len)) == - rfsv::E_PSI_GEN_NONE) { - os.writeRawBytes((char *)buff, len); - updateProgress(len); + res = plpRfsv->fopen(plpRfsv->opMode(rfsv::PSI_O_RDONLY), fn, + handle); + if (res == rfsv::E_PSI_GEN_NONE) { + unsigned char *buff = new unsigned char[RFSV_SENDLEN]; + u_int32_t len; + do { + if ((res = plpRfsv->fread(handle, buff, RFSV_SENDLEN, + len)) == rfsv::E_PSI_GEN_NONE) { + os.writeRawBytes((char *)buff, len); + updateProgress(len); + } + } while ((len > 0) && (res == rfsv::E_PSI_GEN_NONE)); + delete[]buff; + plpRfsv->fclose(handle); } - } while ((len > 0) && (res == rfsv::E_PSI_GEN_NONE)); - delete[]buff; - plpRfsv->fclose(handle); - if (res != rfsv::E_PSI_GEN_NONE) { - if (KMessageBox::warningYesNo(this, i18n("Could not read
%1
").arg(fn)) == KMessageBox::No) { - badBackup = true; - break; + if (res != rfsv::E_PSI_GEN_NONE) { + switch (KMessageBox::warningYesNoCancel( + this, i18n( + "Could not backup
%1
" + "%2
" + ).arg(fn).arg((const char *)res), + QString::null, i18n("Retry"), i18n("Ignore"))) { + case KMessageBox::Cancel: + badBackup = true; + tryLoop = false; + break; + case KMessageBox::No: + e.setName("!"); + tryLoop = false; + break; + case KMessageBox::Yes: + break; + } } else { - e.setName("!"); - continue; + tryLoop = false; } - } + } while (tryLoop); + if (badBackup) + break; + if (res != rfsv::E_PSI_GEN_NONE) + continue; backupTgz->writeFile(unixname, "root", "root", ba.size(), ba.data()); } @@ -915,7 +927,7 @@ doBackup() { kapp->processEvents(); res = plpRfsv->fsetattr(fn, 0, rfsv::PSI_A_ARCHIVE); if (res != rfsv::E_PSI_GEN_NONE) { - if (KMessageBox::warningYesNo(this, i18n("Could not set attributes of
%1
").arg(fn)) == KMessageBox::No) { + if (KMessageBox::warningYesNo(this, i18n("Could not set attributes of
%1
%2
Continue?
").arg(fn)) == KMessageBox::No) { break; } } @@ -998,7 +1010,6 @@ removeOldBackups(QStringList &drives) { QFileInfoListIterator it(*fil); QFileInfo *fi; ArchList alist; - Barchive *a; // Build a list of full-backups sorted by date while ((fi = it.current())) { @@ -1637,7 +1648,7 @@ killSave() { "Could not stop all processes.
" "Please stop running programs manually on the Psion, " "then klick Ok.")); - time_t tstart = time(0) + 5; + tstart = time(0) + 5; } } return; -- cgit v1.2.3