Ticket #3837: mythgallery-mount-fail.patch

File mythgallery-mount-fail.patch, 3.4 KB (added by dburr@…, 18 years ago)

Check the return value of the call to mount()

  • configure

     
    1818news="yes"
    1919phone="yes"
    2020browser="yes"
     21books="yes"
    2122controls="yes"
    2223flix="yes"
    2324archive="yes"
     
    7273MythBrowser related options:
    7374  --enable-mythbrowser     build the mythbrowser plugin [$browser]
    7475
     76MythBooks related options:
     77  --enable-mythbooks       build the mythbooks plugin [$books]
     78
    7579MythControls related options:
    7680  --enable-mythcontrols    build the mythcontrols plugin [$controls]
    7781
     
    200204  ;;
    201205  --disable-mythbrowser) browser="no"
    202206  ;;
     207  --enable-mythbooks) books="yes"
     208  ;;
     209  --disable-mythbooks) books="no"
     210  ;;
    203211  --enable-mythzoneminder) zoneminder="yes"
    204212  ;;
    205213  --disable-mythzoneminder) zoneminder="no"
     
    259267                 news="yes";
    260268                 phone="yes";
    261269                 browser="yes";
     270                 books="yes";
    262271                 zoneminder="yes";
    263272                 controls="yes";
    264273                 flix="yes";
     
    283292                 news="no";
    284293                 phone="no";
    285294                 browser="no";
     295                 books="no";
    286296                 zoneminder="no";
    287297                 controls="no";
    288298                 flix="no";
     
    607617  echo "        MythBrowser    plugin will not be built"
    608618fi
    609619
     620if test "$books" = "yes" ; then
     621  echo "        MythBooks      plugin will be built"
     622  echo "SUBDIRS += mythbooks" >> ./config.pro
     623else
     624  echo "        MythBooks      plugin will not be built"
     625fi
     626
    610627if test "$controls" = "yes" ; then
    611628  echo "        MythControls   plugin will be built"
    612629  echo "SUBDIRS += mythcontrols" >> ./config.pro
  • settings.pro

     
    3737
    3838QMAKE_CFLAGS += $$ARCHFLAGS
    3939QMAKE_CFLAGS_SHLIB = -DPIC -fPIC
    40 QMAKE_CFLAGS_RELEASE = $${QMAKE_CXXFLAGS_RELEASE}
     40QMAKE_CFLAGS_RELEASE = -O2 -pipe -fomit-frame-pointer -march=athlon64 -msse3
    4141QMAKE_CFLAGS += $$ECFLAGS
    4242
    4343# figure out defines
  • mythgallery/mythgallery/iconview.cpp

     
    138138    MediaMonitor *mon = MediaMonitor::GetMediaMonitor();
    139139    if (m_currDevice && mon && mon->ValidateAndLock(m_currDevice))
    140140    {
    141         if (!m_currDevice->isMounted(true))
    142             m_currDevice->mount();
     141        bool mounted = m_currDevice->isMounted(true);
     142        if (!mounted) mounted = m_currDevice->mount();
    143143
    144         connect(m_currDevice,
     144        if(mounted) {
     145            connect(m_currDevice,
    145146                SIGNAL(statusChanged(MediaStatus, MythMediaDevice*)),
    146147                SLOT(mediaStatusChanged(MediaStatus, MythMediaDevice*)));
    147148
    148         LoadDirectory(m_currDevice->getMountPath(), true);
     149            LoadDirectory(m_currDevice->getMountPath(), true);
    149150
    150         mon->Unlock(m_currDevice);
     151            mon->Unlock(m_currDevice);
     152            return;
     153        } else {
     154            mon->Unlock(m_currDevice);
     155        }
    151156    }
    152     else
    153     {
    154         m_currDevice = NULL;
    155         LoadDirectory(m_galleryDir, true);
    156     }
     157    m_currDevice = NULL;
     158    LoadDirectory(m_galleryDir, true);
    157159#endif // _WIN32
    158160}
    159161