summaryrefslogtreecommitdiffstats
path: root/redhat/tdebase/tdebase-14.0.0-suspend_unmount.patch
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2013-07-19 20:47:36 +0200
committerFrançois Andriot <albator78@libertysurf.fr>2013-07-19 20:47:36 +0200
commit81cfe3de65065da2e9693971b05ee35cca6bf483 (patch)
treefa557dc984def90bd9bcbc44e8c98c65923ecd94 /redhat/tdebase/tdebase-14.0.0-suspend_unmount.patch
parent04dea0b400cc28566c4a09214a332a2360f8ed3b (diff)
downloadtde-packaging-81cfe3de65065da2e9693971b05ee35cca6bf483.tar.gz
tde-packaging-81cfe3de65065da2e9693971b05ee35cca6bf483.zip
RPM Packaging: more updates
Diffstat (limited to 'redhat/tdebase/tdebase-14.0.0-suspend_unmount.patch')
-rw-r--r--redhat/tdebase/tdebase-14.0.0-suspend_unmount.patch151
1 files changed, 151 insertions, 0 deletions
diff --git a/redhat/tdebase/tdebase-14.0.0-suspend_unmount.patch b/redhat/tdebase/tdebase-14.0.0-suspend_unmount.patch
new file mode 100644
index 000000000..01d9e479b
--- /dev/null
+++ b/redhat/tdebase/tdebase-14.0.0-suspend_unmount.patch
@@ -0,0 +1,151 @@
+--- ./tdeioslave/media/libmediacommon/medium.cpp.ori 2013-05-08 22:57:09.317384423 +0200
++++ ./tdeioslave/media/libmediacommon/medium.cpp 2013-05-08 22:57:36.730837358 +0200
+@@ -46,6 +46,7 @@
+ loadUserLabel();
+
+ m_halmounted = false;
++ m_isHotplug = false;
+ }
+
+ Medium::Medium()
+@@ -69,6 +70,7 @@
+ m_properties+= "false"; /* HIDDEN */
+
+ m_halmounted = false;
++ m_isHotplug = false;
+ }
+
+ const Medium Medium::create(const TQStringList &properties)
+--- ./tdeioslave/media/libmediacommon/medium.h.ORI 2013-05-08 22:59:10.772959829 +0200
++++ ./tdeioslave/media/libmediacommon/medium.h 2013-05-08 22:59:56.602044404 +0200
+@@ -92,6 +92,9 @@
+ void setHalMounted(bool flag) const { m_halmounted = flag; }
+ bool halMounted() const { return m_halmounted; }
+
++ void setIsHotplug( bool state ) { m_isHotplug = state; }
++ bool isHotplug() const { return m_isHotplug; }
++
+ //private:
+ Medium();
+
+@@ -100,6 +103,8 @@
+
+ TQStringList m_properties;
+ mutable bool m_halmounted;
++
++ bool m_isHotplug;
+
+ friend class TQValueListNode<const Medium>;
+ };
+--- ./tdeioslave/media/mediamanager/mediamanager.cpp.ori 2013-05-08 23:00:39.673183801 +0200
++++ ./tdeioslave/media/mediamanager/mediamanager.cpp 2013-05-08 23:04:47.639224260 +0200
+@@ -354,6 +354,57 @@
+ emit mediumChanged(name);
+ }
+
++TQString MediaManager::unmountAllSuspend()
++{
++ TQPtrList<Medium> list = m_mediaList.list();
++
++ TQPtrList<Medium>::const_iterator it = list.begin();
++ TQPtrList<Medium>::const_iterator end = list.end();
++
++ TQString result;
++
++ for (; it!=end; ++it)
++ {
++ if ( (*it)->isMounted() && (*it)->isHotplug() )
++ {
++ TQString tmp = unmount( (*it)->id() );
++ if ( !tmp.isEmpty() ) { // umount failed
++ result = tmp;
++ } else {
++ m_suspendResumeMountList.append( (*it)->id() );
++ }
++ }
++ }
++
++ // return last error
++ return result;
++}
++
++TQString MediaManager::remountAllResume()
++{
++ TQString result;
++
++ for (TQStringList::const_iterator it = m_suspendResumeMountList.begin();
++ it != m_suspendResumeMountList.end();
++ ++it)
++ {
++ const Medium *m = m_mediaList.findById(*it);
++
++ if ( m && m->needMounting() )
++ {
++ TQString tmp = mount( *it );
++ if ( !tmp.isEmpty() ) { // mount failed
++ result = tmp;
++ }
++ }
++ }
++
++ m_suspendResumeMountList.clear();
++
++ // return last error
++ return result;
++}
++
+
+ extern "C" {
+ KDE_EXPORT KDEDModule *create_mediamanager(const TQCString &obj)
+--- ./tdeioslave/media/mediamanager/mediamanager.h.ORI 2013-05-08 23:05:36.250251036 +0200
++++ ./tdeioslave/media/mediamanager/mediamanager.h 2013-05-08 23:07:27.650019601 +0200
+@@ -60,6 +60,20 @@
+ bool removableUnplug(const TQString &devNode);
+ bool removableCamera(const TQString &devNode);
+
++ /**
++ * Unmount manually all partitions when going to suspend
++ *
++ * @return last error if any
++ */
++ TQString unmountAllSuspend();
++
++ /**
++ * Remount previously unmounted partitions in unmountAllSuspend()
++ *
++ * @return last error if any
++ */
++ TQString remountAllResume();
++
+ k_dcop_signals:
+ void mediumAdded(const TQString &name, bool allowNotification);
+ void mediumRemoved(const TQString &name, bool allowNotification);
+@@ -89,6 +103,7 @@
+ TDEBackend *m_tdebackend;
+ MediaDirNotify m_dirNotify;
+ FstabBackend *m_fstabbackend;
++ TQStringList m_suspendResumeMountList;
+ };
+
+ #endif
+--- ./tdeioslave/media/mediamanager/halbackend.cpp.ori 2013-05-08 23:08:12.196126863 +0200
++++ ./tdeioslave/media/mediamanager/halbackend.cpp 2013-05-08 23:08:51.096347073 +0200
+@@ -541,6 +541,7 @@
+ libhal_volume_is_mounted(halVolume) ); /* Mounted ? */
+ }
+
++ medium->setIsHotplug( libhal_drive_is_hotpluggable(halDrive) );
+
+ char* name = libhal_volume_policy_compute_display_name(halDrive, halVolume, m_halStoragePolicy);
+ TQString volume_name = TQString::fromUtf8(name);
+--- ./tdeioslave/media/mediamanager/halbackend.h.ORI 2013-05-08 23:09:35.761451488 +0200
++++ ./tdeioslave/media/mediamanager/halbackend.h 2013-05-08 23:10:21.608531952 +0200
+@@ -89,6 +89,8 @@
+ TQString decrypt(const TQString &id, const TQString &password);
+ TQString undecrypt(const TQString &id);
+
++ static bool isHotplug( const TQString & id );
++
+ private:
+ /**
+ * Append a device in the media list. This function will check if the device