From b13cc326060a7fdd97fadbfc6a2ba32464f04198 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Sat, 31 Aug 2013 14:15:16 +0300 Subject: [PATCH] xbmc: fix 'remove safely' with udevil --- ...context-menu-remove-safely-selection.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 packages/mediacenter/xbmc/patches/xbmc-AML-XB9295c3f-04-fixed-context-menu-remove-safely-selection.patch diff --git a/packages/mediacenter/xbmc/patches/xbmc-AML-XB9295c3f-04-fixed-context-menu-remove-safely-selection.patch b/packages/mediacenter/xbmc/patches/xbmc-AML-XB9295c3f-04-fixed-context-menu-remove-safely-selection.patch new file mode 100644 index 0000000000..bdb266bbd0 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/xbmc-AML-XB9295c3f-04-fixed-context-menu-remove-safely-selection.patch @@ -0,0 +1,66 @@ +From 35400b9a93e5c2c9aa6dc389736af293fc623a5b Mon Sep 17 00:00:00 2001 +From: davilla +Date: Thu, 3 Jan 2013 11:20:22 -0500 +Subject: [PATCH] [aml] fixed context menu 'remove safely' selection + +--- + xbmc/linux/PosixMountProvider.cpp | 10 ++++++++++ + xbmc/linux/PosixMountProvider.h | 2 +- + xbmc/storage/linux/UDevProvider.cpp | 7 ++++++- + 3 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/xbmc/linux/PosixMountProvider.cpp b/xbmc/linux/PosixMountProvider.cpp +index 2420491..27d639e 100644 +--- a/xbmc/linux/PosixMountProvider.cpp ++++ b/xbmc/linux/PosixMountProvider.cpp +@@ -127,6 +127,16 @@ void CPosixMountProvider::GetDrives(VECSOURCES &drives) + return result; + } + ++bool CPosixMountProvider::Eject(CStdString mountpath) ++{ ++ // just go ahead and try to umount the disk ++ // if it does umount, life is good, if not, no loss. ++ std::string cmd = "umount " + mountpath; ++ system(cmd.c_str()); ++ ++ return true; ++} ++ + bool CPosixMountProvider::PumpDriveChangeEvents(IStorageEventsCallback *callback) + { + VECSOURCES drives; +diff --git a/xbmc/linux/PosixMountProvider.h b/xbmc/linux/PosixMountProvider.h +index da0506c..02ff302 100644 +--- a/xbmc/linux/PosixMountProvider.h ++++ b/xbmc/linux/PosixMountProvider.h +@@ -34,7 +34,7 @@ class CPosixMountProvider : public IStorageProvider + + virtual std::vector GetDiskUsage(); + +- virtual bool Eject(CStdString mountpath) { return false; } ++ virtual bool Eject(CStdString mountpath); + + virtual bool PumpDriveChangeEvents(IStorageEventsCallback *callback); + private: +diff --git a/xbmc/storage/linux/UDevProvider.cpp b/xbmc/storage/linux/UDevProvider.cpp +index 21b6b50..d9e6a4f 100644 +--- a/xbmc/storage/linux/UDevProvider.cpp ++++ b/xbmc/storage/linux/UDevProvider.cpp +@@ -179,7 +179,12 @@ void CUDevProvider::GetRemovableDrives(VECSOURCES &removableDrives) + + bool CUDevProvider::Eject(CStdString mountpath) + { +- return false; ++ // just go ahead and try to umount the disk ++ // if it does umount, life is good, if not, no loss. ++ std::string cmd = "umount " + mountpath; ++ system(cmd.c_str()); ++ ++ return true; + } + + std::vector CUDevProvider::GetDiskUsage() +-- +1.8.4 +