aboutsummaryrefslogtreecommitdiffstats
path: root/kde2/kioslave
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2001-03-28 12:17:37 +0000
committerFritz Elfert <felfert@to.com>2001-03-28 12:17:37 +0000
commit882d144ec91603944906b7318da407391e1cd7c0 (patch)
tree71b4f29da854bb6c27ad7f8286b3d731518cb319 /kde2/kioslave
parentfb6e57695452dc5265a35532f74e918490880723 (diff)
downloadplptools-882d144ec91603944906b7318da407391e1cd7c0.tar.gz
plptools-882d144ec91603944906b7318da407391e1cd7c0.tar.bz2
plptools-882d144ec91603944906b7318da407391e1cd7c0.zip
Fixed backup rename on success.
Diffstat (limited to 'kde2/kioslave')
-rw-r--r--kde2/kioslave/kio_plp.cpp81
1 files changed, 42 insertions, 39 deletions
diff --git a/kde2/kioslave/kio_plp.cpp b/kde2/kioslave/kio_plp.cpp
index 2374dc3..2c03009 100644
--- a/kde2/kioslave/kio_plp.cpp
+++ b/kde2/kioslave/kio_plp.cpp
@@ -278,7 +278,7 @@ openConnection() {
for (int i = 0; i < 26; i++) {
if ((devbits & 1) != 0) {
PlpDrive drive;
- if (plpRfsv->devinfo(i + 'A', drive) == rfsv::E_PSI_GEN_NONE) {
+ if (plpRfsv->devinfo('A' + i, drive) == rfsv::E_PSI_GEN_NONE) {
string vname = drive.getName();
QString name;
@@ -815,38 +815,49 @@ get( const KURL& url ) {
if (checkConnection())
return;
kdDebug(PLP_DEBUGAREA) << "get(" << name << ")" << endl;
- if (isRoot(name) || isDrive(name)) {
- error(ERR_ACCESS_DENIED, i18n("%1: virtual directory").arg(url.path()));
- return;
- }
- convertName(name);
- Enum<rfsv::errs> res;
- u_int32_t handle;
- u_int32_t len;
- u_int32_t size;
- u_int32_t total = 0;
-
- if (emitTotalSize(name))
- return;
- res = plpRfsv->fopen(plpRfsv->opMode(rfsv::PSI_O_RDONLY), name.latin1(), handle);
- if (checkForError(res, url.path()))
- return;
-
- QByteArray a(RFSV_SENDLEN);
- do {
- if ((res = plpRfsv->fread(handle, (unsigned char *)(a.data()),
- RFSV_SENDLEN, len)) == rfsv::E_PSI_GEN_NONE) {
- if (len < RFSV_SENDLEN)
- a.resize(len);
+ if (name == "/0:_MachInfo") {
+ QByteArray a(sizeof(machInfo));
+ a.duplicate((const char *)&machInfo, sizeof(machInfo));
data(a);
- total += len;
- calcprogress(total);
+ } else {
+ if (isRoot(name) || isDrive(name)) {
+ error(ERR_ACCESS_DENIED,
+ i18n("%1: virtual directory").arg(url.path()));
+ return;
}
- } while ((len > 0) && (res == rfsv::E_PSI_GEN_NONE));
- plpRfsv->fclose(handle);
- if (checkForError(res, url.path()))
- return;
+ convertName(name);
+
+ Enum<rfsv::errs> res;
+ u_int32_t handle;
+ u_int32_t len;
+ u_int32_t size;
+ u_int32_t total = 0;
+
+ if (emitTotalSize(name))
+ return;
+ res = plpRfsv->fopen(plpRfsv->opMode(
+ rfsv::PSI_O_RDONLY), name.latin1(), handle);
+ if (checkForError(res, url.path()))
+ return;
+
+ QByteArray a(RFSV_SENDLEN);
+ do {
+ if ((res = plpRfsv->fread(handle,
+ (unsigned char *)(a.data()),
+ RFSV_SENDLEN, len)) ==
+ rfsv::E_PSI_GEN_NONE) {
+ if (len < RFSV_SENDLEN)
+ a.resize(len);
+ data(a);
+ total += len;
+ calcprogress(total);
+ }
+ } while ((len > 0) && (res == rfsv::E_PSI_GEN_NONE));
+ plpRfsv->fclose(handle);
+ if (checkForError(res, url.path()))
+ return;
+ }
data(QByteArray());
finished();
@@ -1047,7 +1058,7 @@ special(const QByteArray &a) {
PlpDrive drive;
Enum<rfsv::errs> res;
- int drv;
+ char drv;
stream >> param;
cout << "p='" << param << "'" << endl;
@@ -1183,14 +1194,6 @@ special(const QByteArray &a) {
return;
}
break;
- case 5: {
- kdDebug(PLP_DEBUGAREA) << "get machineInfo" << endl;
- QByteArray a(sizeof(machInfo));
- a.duplicate((const char *)&machInfo, sizeof(machInfo));
- data(a);
- data(QByteArray());
- }
- break;
default:
error(ERR_UNSUPPORTED_PROTOCOL, QString(i18n("Code: %1")).arg(cmd));
return;