diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
commit | 10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch) | |
tree | 88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /kioslave/media/libmediacommon | |
parent | 4aed2c8219774f5d797760606b8489a92ddc5163 (diff) | |
download | tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip |
Initial import of Trinity 3.5.11 to kdebase
Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes
Will need to check for commit warnings and repair as encountered
Also needs full compile test
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kioslave/media/libmediacommon')
-rw-r--r-- | kioslave/media/libmediacommon/medium.cpp | 29 | ||||
-rw-r--r-- | kioslave/media/libmediacommon/medium.h | 12 | ||||
-rw-r--r-- | kioslave/media/libmediacommon/notifieropenaction.cpp | 2 | ||||
-rw-r--r-- | kioslave/media/libmediacommon/notifiersettings.cpp | 12 |
4 files changed, 53 insertions, 2 deletions
diff --git a/kioslave/media/libmediacommon/medium.cpp b/kioslave/media/libmediacommon/medium.cpp index 5767a6c9a..4cba32aeb 100644 --- a/kioslave/media/libmediacommon/medium.cpp +++ b/kioslave/media/libmediacommon/medium.cpp @@ -38,6 +38,8 @@ Medium::Medium(const QString &id, const QString &name) m_properties+= QString::null; /* BASE_URL */ m_properties+= QString::null; /* MIME_TYPE */ m_properties+= QString::null; /* ICON_NAME */ + m_properties+= "false"; /* ENCRYPTED */ + m_properties+= QString::null; /* CLEAR_DEVICE_UDI */ loadUserLabel(); @@ -59,6 +61,8 @@ Medium::Medium() m_properties+= QString::null; /* BASE_URL */ m_properties+= QString::null; /* MIME_TYPE */ m_properties+= QString::null; /* ICON_NAME */ + m_properties+= QString::null; /* ENCRYPTED */ + m_properties+= QString::null; /* CLEAR_DEVICE_UDI */ m_halmounted = false; } @@ -82,6 +86,8 @@ const Medium Medium::create(const QStringList &properties) m.m_properties[BASE_URL] = properties[BASE_URL]; m.m_properties[MIME_TYPE] = properties[MIME_TYPE]; m.m_properties[ICON_NAME] = properties[ICON_NAME]; + m.m_properties[ENCRYPTED] = properties[ENCRYPTED]; + m.m_properties[CLEAR_DEVICE_UDI] = properties[CLEAR_DEVICE_UDI]; } return m; @@ -123,6 +129,11 @@ void Medium::setLabel(const QString &label) m_properties[LABEL] = label; } +void Medium::setEncrypted(bool state) +{ + m_properties[ENCRYPTED] = ( state ? "true" : "false" ); +} + void Medium::setUserLabel(const QString &label) { KConfig cfg("mediamanagerrc"); @@ -185,6 +196,19 @@ void Medium::mountableState(const QString &deviceNode, m_properties[MOUNTED] = ( mounted ? "true" : "false" ); } +void Medium::mountableState(const QString &deviceNode, + const QString &clearDeviceUdi, + const QString &mountPoint, + const QString &fsType, bool mounted) +{ + m_properties[MOUNTABLE] = "true"; + m_properties[DEVICE_NODE] = deviceNode; + m_properties[CLEAR_DEVICE_UDI] = clearDeviceUdi; + m_properties[MOUNT_POINT] = mountPoint; + m_properties[FS_TYPE] = fsType; + m_properties[MOUNTED] = ( mounted ? "true" : "false" ); +} + void Medium::unmountableState(const QString &baseURL) { m_properties[MOUNTABLE] = "false"; @@ -206,6 +230,11 @@ bool Medium::needMounting() const return isMountable() && !isMounted(); } +bool Medium::needDecryption() const +{ + return isEncrypted() && clearDeviceUdi().isEmpty(); +} + KURL Medium::prettyBaseURL() const { if ( !baseURL().isEmpty() ) diff --git a/kioslave/media/libmediacommon/medium.h b/kioslave/media/libmediacommon/medium.h index f94545e8e..543bdf596 100644 --- a/kioslave/media/libmediacommon/medium.h +++ b/kioslave/media/libmediacommon/medium.h @@ -41,7 +41,9 @@ public: static const uint BASE_URL = 9; static const uint MIME_TYPE = 10; static const uint ICON_NAME = 11; - static const uint PROPERTIES_COUNT = 12; + static const uint ENCRYPTED = 12; + static const uint CLEAR_DEVICE_UDI = 13; + static const uint PROPERTIES_COUNT = 14; static const QString SEPARATOR; Medium(const QString &id, const QString &name); @@ -62,19 +64,27 @@ public: QString baseURL() const { return m_properties[BASE_URL]; } QString mimeType() const { return m_properties[MIME_TYPE]; } QString iconName() const { return m_properties[ICON_NAME]; } + bool isEncrypted() const { return m_properties[ENCRYPTED]=="true"; }; + QString clearDeviceUdi() const { return m_properties[CLEAR_DEVICE_UDI]; }; bool needMounting() const; + bool needDecryption() const; KURL prettyBaseURL() const; QString prettyLabel() const; void setName(const QString &name); void setLabel(const QString &label); void setUserLabel(const QString &label); + void setEncrypted(bool state); bool mountableState(bool mounted); void mountableState(const QString &deviceNode, const QString &mountPoint, const QString &fsType, bool mounted); + void mountableState(const QString &deviceNode, + const QString &clearDeviceUdi, + const QString &mountPoint, + const QString &fsType, bool mounted); void unmountableState(const QString &baseURL = QString::null); void setMimeType(const QString &mimeType); diff --git a/kioslave/media/libmediacommon/notifieropenaction.cpp b/kioslave/media/libmediacommon/notifieropenaction.cpp index 82db14b97..2cf664cc6 100644 --- a/kioslave/media/libmediacommon/notifieropenaction.cpp +++ b/kioslave/media/libmediacommon/notifieropenaction.cpp @@ -40,6 +40,6 @@ void NotifierOpenAction::execute(KFileItem &medium) bool NotifierOpenAction::supportsMimetype( const QString &mimetype ) const { - return !mimetype.contains( "blank" ); + return !mimetype.contains( "blank" ) && !mimetype.contains( "encrypted" ); } diff --git a/kioslave/media/libmediacommon/notifiersettings.cpp b/kioslave/media/libmediacommon/notifiersettings.cpp index c7ad616a5..c7ba40e85 100644 --- a/kioslave/media/libmediacommon/notifiersettings.cpp +++ b/kioslave/media/libmediacommon/notifiersettings.cpp @@ -32,16 +32,28 @@ NotifierSettings::NotifierSettings() { m_supportedMimetypes.append( "media/removable_unmounted" ); + m_supportedMimetypes.append( "media/removable_unmounted_encrypted" ); + m_supportedMimetypes.append( "media/removable_unmounted_decrypted" ); m_supportedMimetypes.append( "media/removable_mounted" ); + m_supportedMimetypes.append( "media/removable_mounted_decrypted" ); m_supportedMimetypes.append( "media/camera_unmounted" ); m_supportedMimetypes.append( "media/camera_mounted" ); m_supportedMimetypes.append( "media/gphoto2camera" ); m_supportedMimetypes.append( "media/cdrom_unmounted" ); + m_supportedMimetypes.append( "media/cdrom_unmounted_encrypted" ); + m_supportedMimetypes.append( "media/cdrom_unmounted_decrypted" ); m_supportedMimetypes.append( "media/cdrom_mounted" ); + m_supportedMimetypes.append( "media/cdrom_mounted_decrypted" ); m_supportedMimetypes.append( "media/dvd_unmounted" ); + m_supportedMimetypes.append( "media/dvd_unmounted_encrypted" ); + m_supportedMimetypes.append( "media/dvd_unmounted_decrypted" ); m_supportedMimetypes.append( "media/dvd_mounted" ); + m_supportedMimetypes.append( "media/dvd_mounted_decrypted" ); m_supportedMimetypes.append( "media/cdwriter_unmounted" ); + m_supportedMimetypes.append( "media/cdwriter_unmounted_encrypted" ); + m_supportedMimetypes.append( "media/cdwriter_unmounted_decrypted" ); m_supportedMimetypes.append( "media/cdwriter_mounted" ); + m_supportedMimetypes.append( "media/cdwriter_mounted_decrypted" ); m_supportedMimetypes.append( "media/blankcd" ); m_supportedMimetypes.append( "media/blankdvd" ); m_supportedMimetypes.append( "media/audiocd" ); |