Ticket #9522: 70-gallery-mediamon.diff

File 70-gallery-mediamon.diff, 2.8 KB (added by Lawrence Rust <lvr@…>, 13 years ago)
  • mythplugins/mythgallery/mythgallery/iconview.cpp

    diff --git mythplugins/mythgallery/mythgallery/iconview.cpp mythplugins/mythgallery/mythgallery/iconview.cpp
    index da7f35b..d23f559 100644
    bool IconView::Create(void) 
    204204        m_thumbGen->setSize(thumbWidth, thumbHeight);
    205205
    206206    SetupMediaMonitor();
    207     LoadDirectory(m_galleryDir);
     207    if (!m_currDevice)
     208        LoadDirectory(m_galleryDir);
    208209
    209210    return true;
    210211}
    void IconView::LoadThumbnail(ThumbItem *item) 
    339340
    340341void IconView::SetupMediaMonitor(void)
    341342{
    342 #ifndef _WIN32
     343#ifdef _WIN32
     344    if (m_currDevice)
     345        LoadDirectory(m_currDevice->getDevicePath());
     346#else
    343347    MediaMonitor *mon = MediaMonitor::GetMediaMonitor();
    344348    if (m_currDevice && mon && mon->ValidateAndLock(m_currDevice))
    345349    {
    void IconView::SetupMediaMonitor(void) 
    370374            mon->Unlock(m_currDevice);
    371375        }
    372376    }
    373     m_currDevice = NULL;
    374377#endif // _WIN32
    375378}
    376379
    bool IconView::HandleMediaDeviceSelect(ThumbItem *item) 
    530533    {
    531534        m_currDevice = item->GetMediaDevice();
    532535
     536#ifdef _WIN32
     537        LoadDirectory(m_currDevice->getDevicePath());
     538#else
    533539        if (!m_currDevice->isMounted(false))
    534540            m_currDevice->mount();
    535541
    bool IconView::HandleMediaDeviceSelect(ThumbItem *item) 
    542548                                        MythMediaDevice*)));
    543549
    544550        LoadDirectory(m_currDevice->getMountPath());
     551#endif
    545552
    546553        mon->Unlock(m_currDevice);
    547554    }
    void IconView::HandleSettings(void) 
    10361043    MediaMonitor *mon = MediaMonitor::GetMediaMonitor();
    10371044    if (m_currDevice && mon && mon->ValidateAndLock(m_currDevice))
    10381045    {
     1046#ifdef _WIN32
     1047        LoadDirectory(m_currDevice->getDevicePath());
     1048#else
    10391049        LoadDirectory(m_currDevice->getMountPath());
     1050#endif
    10401051        mon->Unlock(m_currDevice);
    10411052    }
    10421053    else
    void IconView::HandleImport(void) 
    11161127
    11171128void IconView::HandleShowDevices(void)
    11181129{
    1119 #ifndef _WIN32
    11201130    MediaMonitor *mon = MediaMonitor::GetMediaMonitor();
     1131#ifndef _WIN32
    11211132    if (m_currDevice && mon && mon->ValidateAndLock(m_currDevice))
    11221133    {
    11231134        m_currDevice->disconnect(this);
    void IconView::HandleShowDevices(void) 
    11451156    m_itemList.append(item);
    11461157    m_itemHash.insert(item->GetName(), item);
    11471158
    1148 #ifndef _WIN32
    11491159    if (mon)
    11501160    {
    1151         QList<MythMediaDevice*> removables = mon->GetMedias(MEDIATYPE_DATA);
     1161        QList<MythMediaDevice*> removables = mon->GetMedias(MEDIATYPE_DATA|MEDIATYPE_MGALLERY);
    11521162        QList<MythMediaDevice*>::Iterator it = removables.begin();
    11531163        for (; it != removables.end(); it++)
    11541164        {
    void IconView::HandleShowDevices(void) 
    11661176            }
    11671177        }
    11681178    }
    1169 #endif
    11701179
    11711180    ThumbItem *thumbitem;
    11721181    for (int x = 0; x < m_itemList.size(); x++)