From 5895f16defa560ad23ccfec344cdc3aaba9df34d Mon Sep 17 00:00:00 2001
From: Roger Siddons <dizygotheca@ntlworld.com>
Date: Thu, 9 Jul 2015 11:49:39 +0100
Subject: [PATCH 06/15] MediaMonitor: Support ejection of specific device
Mediamonitor only supports device ejection via its own dialog.
This patch allows MM clients to eject devices directly.
diff --git a/mythtv/libs/libmyth/mythmediamonitor.cpp b/mythtv/libs/libmyth/mythmediamonitor.cpp
index fc7d305..305bf74 100644
a
|
b
|
void MediaMonitor::ChooseAndEjectMedia(void) |
240 | 240 | AttemptEject(selected); |
241 | 241 | } |
242 | 242 | |
| 243 | |
| 244 | void MediaMonitor::EjectMedia(const QString &path) |
| 245 | { |
| 246 | MythMediaDevice *device = GetMedia(path); |
| 247 | if (device) |
| 248 | AttemptEject(device); |
| 249 | } |
| 250 | |
| 251 | |
243 | 252 | void MediaMonitor::AttemptEject(MythMediaDevice *device) |
244 | 253 | { |
245 | 254 | QString dev = DevName(device); |
diff --git a/mythtv/libs/libmyth/mythmediamonitor.h b/mythtv/libs/libmyth/mythmediamonitor.h
index 6475f34..b9a3291 100644
a
|
b
|
class MPUBLIC MediaMonitor : public QObject |
46 | 46 | virtual void StartMonitoring(void); |
47 | 47 | void StopMonitoring(void); |
48 | 48 | void ChooseAndEjectMedia(void); |
| 49 | void EjectMedia(const QString &path); |
49 | 50 | |
50 | 51 | static MediaMonitor *GetMediaMonitor(void); |
51 | 52 | static QString GetMountPath(const QString& devPath); |