summaryrefslogtreecommitdiffstats
path: root/kioslave/media/mediamanager
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-04-01 21:31:54 -0500
committerTimothy Pearson <[email protected]>2012-04-01 21:31:54 -0500
commit66c83e6ac5671200983f3bbe5eccf674cdaae4b7 (patch)
treec4f0691604c88650bde453e44c29f6f481254390 /kioslave/media/mediamanager
parent480a63959b1162b197260c7ee6c294563ce0845e (diff)
downloadtdebase-66c83e6ac5671200983f3bbe5eccf674cdaae4b7.tar.gz
tdebase-66c83e6ac5671200983f3bbe5eccf674cdaae4b7.zip
Add preliminary floppy drive support to TDE hardware library media backend
Diffstat (limited to 'kioslave/media/mediamanager')
-rw-r--r--kioslave/media/mediamanager/tdehardwarebackend.cpp23
-rw-r--r--kioslave/media/mediamanager/tdehardwarebackend.h2
2 files changed, 24 insertions, 1 deletions
diff --git a/kioslave/media/mediamanager/tdehardwarebackend.cpp b/kioslave/media/mediamanager/tdehardwarebackend.cpp
index dc615a146..d23e38f32 100644
--- a/kioslave/media/mediamanager/tdehardwarebackend.cpp
+++ b/kioslave/media/mediamanager/tdehardwarebackend.cpp
@@ -549,6 +549,11 @@ bool TDEBackend::setFloppyProperties(Medium* medium)
}
if (sdevice->isDiskOfType(TDEDiskDeviceType::Floppy)) {
+ setFloppyMountState(medium);
+
+ // We don't use the routine above as floppy disks are extremely slow (we don't want them accessed at all during media listing)
+ medium->mountableState(sdevice->deviceNode(), sdevice->mountPath(), sdevice->fileSystemName(), !sdevice->mountPath().isNull());
+
if (sdevice->mountPath().isNull()) {
medium->setMimeType("media/floppy_unmounted");
}
@@ -615,6 +620,24 @@ void TDEBackend::setCameraProperties(Medium* medium)
}
}
+void TDEBackend::setFloppyMountState( Medium *medium )
+{
+ KMountPoint::List mtab = KMountPoint::currentMountPoints();
+ KMountPoint::List::iterator it = mtab.begin();
+ KMountPoint::List::iterator end = mtab.end();
+
+ TQString fstype;
+ TQString mountpoint;
+ for (; it!=end; ++it) {
+ if ((*it)->mountedFrom() == medium->deviceNode() ) {
+ fstype = (*it)->mountType().isNull() ? (*it)->mountType() : "auto";
+ mountpoint = (*it)->mountPoint();
+ medium->mountableState( medium->deviceNode(), mountpoint, fstype, true );
+ return;
+ }
+ }
+}
+
TQStringList TDEBackend::mountoptions(const TQString &name)
{
const Medium* medium = m_mediaList.findById(name);
diff --git a/kioslave/media/mediamanager/tdehardwarebackend.h b/kioslave/media/mediamanager/tdehardwarebackend.h
index a794fd0fb..b497e48d2 100644
--- a/kioslave/media/mediamanager/tdehardwarebackend.h
+++ b/kioslave/media/mediamanager/tdehardwarebackend.h
@@ -127,7 +127,7 @@ private:
void setVolumeProperties(Medium* medium);
bool setFloppyProperties(Medium* medium);
-// void setFloppyMountState( Medium* medium );
+ void setFloppyMountState( Medium* medium );
// bool setFstabProperties(Medium* medium);
void setCameraProperties(Medium* medium);
TQString generateName(const TQString &devNode);