summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehardwaredevices.h
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-03-31 18:15:57 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-03-31 18:15:57 -0500
commit667932498f664c6f602fe5d0515434026cc0770d (patch)
treedbd0d0ce6f1e33805ef9facec0f20ce2404d9c57 /tdecore/tdehardwaredevices.h
parent9dff87031ae97e12b6b35e74b894b9af89f15975 (diff)
downloadtdelibs-667932498f664c6f602fe5d0515434026cc0770d.tar.gz
tdelibs-667932498f664c6f602fe5d0515434026cc0770d.zip
Add proper mount monitoring to TDE hardware library
The media kioslave backend based on this library can now mount/unmount simple flash drives
Diffstat (limited to 'tdecore/tdehardwaredevices.h')
-rw-r--r--tdecore/tdehardwaredevices.h34
1 files changed, 27 insertions, 7 deletions
diff --git a/tdecore/tdehardwaredevices.h b/tdecore/tdehardwaredevices.h
index 2b145b9e9..0da239663 100644
--- a/tdecore/tdehardwaredevices.h
+++ b/tdecore/tdehardwaredevices.h
@@ -369,25 +369,36 @@ class TDECORE_EXPORT TDEStorageDevice : public TDEGenericDevice
* Mounts the device if not encrypted
*
* @param a TQString containing a requested mount name under /media, if desired
+ * @param a TQString containing any mount options for pmount, if desired
+ * @param a pointer to a TQString which will be populated with any error messages from pmount, if desired
+ * @param a pointer to an integer which will be populated with the return code from pmount, if desired
+ *
* @return a TQString with the mount path, if successful
*/
- TQString mountDevice(TQString mediaName=TQString::null);
+ TQString mountDevice(TQString mediaName=TQString::null, TQString mountOptions=TQString::null, TQString* errRet=0, int* retcode=0);
/**
* Mounts the encrypted device if the correct passphrase is given
*
* @param a TQString containing the passphrase
* @param a TQString containing a requested mount name under /media, if desired
+ * @param a TQString containing any mount options for pmount, if desired
+ * @param a pointer to a TQString which will be populated with any error messages from pmount, if desired
+ * @param a pointer to an integer which will be populated with the return code from pmount, if desired
+ *
* @return a TQString with the mount path, if successful
*/
- TQString mountEncryptedDevice(TQString passphrase, TQString mediaName=TQString::null);
+ TQString mountEncryptedDevice(TQString passphrase, TQString mediaName=TQString::null, TQString mountOptions=TQString::null, TQString* errRet=0, int* retcode=0);
/**
* Unmounts the device
*
+ * @param a pointer to a TQString which will be populated with any error messages from pmount, if desired
+ * @param a pointer to an integer which will be populated with the return code from pmount, if desired
+ *
* @return TRUE if unmount was successful
*/
- bool unmountDevice();
+ bool unmountDevice(TQString* errRet, int* retcode=0);
/**
* @return a TQString with the mount path, if mounted
@@ -421,7 +432,7 @@ typedef TQPtrList<TDEGenericDevice> TDEGenericHardwareList;
class TQSocketNotifier;
-class TDECORE_EXPORT TDEHardwareDevices : TQObject
+class TDECORE_EXPORT TDEHardwareDevices : public TQObject
{
Q_OBJECT
@@ -461,14 +472,21 @@ class TDECORE_EXPORT TDEHardwareDevices : TQObject
TDEGenericDevice* findBySystemPath(TQString syspath);
/**
+ * Return the device with device node @arg devnode, or 0 if no device exists at that node
+ * @return TDEGenericDevice
+ */
+ TDEGenericDevice* findByDeviceNode(TQString devnode);
+
+ /**
* Return the storage device with unique ID @arg uid, or 0 if no device exists for that uid
* @return TDEGenericDevice
*/
TDEStorageDevice* findDiskByUID(TQString uid);
signals:
- void hardwareAdded(TDEGenericDevice);
- void hardwareRemoved(TDEGenericDevice);
+ void hardwareAdded(TDEGenericDevice*);
+ void hardwareRemoved(TDEGenericDevice*);
+ void hardwareUpdated(TDEGenericDevice*);
void mountTableModified();
private slots:
@@ -476,7 +494,7 @@ class TDECORE_EXPORT TDEHardwareDevices : TQObject
void processModifiedMounts();
private:
- TDEGenericDevice *classifyUnknownDevice(udev_device* dev);
+ TDEGenericDevice *classifyUnknownDevice(udev_device* dev, TDEGenericDevice* existingdevice=0);
struct udev *m_udevStruct;
struct udev_monitor *m_udevMonitorStruct;
@@ -485,6 +503,8 @@ class TDECORE_EXPORT TDEHardwareDevices : TQObject
TQSocketNotifier* m_devScanNotifier;
TQSocketNotifier* m_mountScanNotifier;
+
+ TQStringList m_mountTable;
};
#endif \ No newline at end of file