Darrell Anderson 12 years ago
commit 26a59d1ea7

@ -859,7 +859,7 @@ TQPixmap TDEStorageDevice::icon(TDEIcon::StdSizes size) {
return ret; return ret;
} }
unsigned long TDEStorageDevice::deviceSize() { unsigned long long TDEStorageDevice::deviceSize() {
TQString bsnodename = systemPath(); TQString bsnodename = systemPath();
bsnodename.append("/queue/physical_block_size"); bsnodename.append("/queue/physical_block_size");
TQFile bsfile( bsnodename ); TQFile bsfile( bsnodename );
@ -870,7 +870,7 @@ unsigned long TDEStorageDevice::deviceSize() {
bsfile.close(); bsfile.close();
} }
else { else {
// Drat, I can't get a gauranteed block size. Assume a block size of 512, as everything I have read indicates that /sys/block/<dev>/size is given in terms of a 512 byte block... // Drat, I can't get a guaranteed block size. Assume a block size of 512, as everything I have read indicates that /sys/block/<dev>/size is given in terms of a 512 byte block...
blocksize = "512"; blocksize = "512";
} }
@ -884,7 +884,7 @@ unsigned long TDEStorageDevice::deviceSize() {
dsfile.close(); dsfile.close();
} }
return (blocksize.toULong()*devicesize.toULong()); return ((unsigned long long)blocksize.toULong()*(unsigned long long)devicesize.toULong());
} }
TQString TDEStorageDevice::deviceFriendlySize() { TQString TDEStorageDevice::deviceFriendlySize() {

@ -613,7 +613,7 @@ class TDECORE_EXPORT TDEStorageDevice : public TDEGenericDevice
/** /**
* @return an unsigned long with the device size in bytes * @return an unsigned long with the device size in bytes
*/ */
unsigned long deviceSize(); unsigned long long deviceSize();
/** /**
* @return a TQString with the device size in human readable form * @return a TQString with the device size in human readable form

Loading…
Cancel
Save