mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
67 lines
2.1 KiB
Diff
67 lines
2.1 KiB
Diff
From 35400b9a93e5c2c9aa6dc389736af293fc623a5b Mon Sep 17 00:00:00 2001
|
|
From: davilla <davilla@4pi.com>
|
|
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<CStdString> 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<CStdString> CUDevProvider::GetDiskUsage()
|
|
--
|
|
1.8.4
|
|
|