Ticket #12424: 0006-MediaMonitor-Support-ejection-of-specific-device.patch

File 0006-MediaMonitor-Support-ejection-of-specific-device.patch, 1.4 KB (added by Roger Siddons <dizygotheca@…>, 5 years ago)
  • mythtv/libs/libmyth/mythmediamonitor.cpp

    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) 
    240240    AttemptEject(selected);
    241241}
    242242
     243
     244void MediaMonitor::EjectMedia(const QString &path)
     245{
     246    MythMediaDevice *device = GetMedia(path);
     247    if (device)
     248        AttemptEject(device);
     249}
     250
     251
    243252void MediaMonitor::AttemptEject(MythMediaDevice *device)
    244253{
    245254    QString  dev = DevName(device);
  • mythtv/libs/libmyth/mythmediamonitor.h

    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 
    4646    virtual void StartMonitoring(void);
    4747    void StopMonitoring(void);
    4848    void ChooseAndEjectMedia(void);
     49    void EjectMedia(const QString &path);
    4950
    5051    static MediaMonitor *GetMediaMonitor(void);
    5152    static QString GetMountPath(const QString& devPath);