Ticket #5698: mythgallery-defects.patch

File mythgallery-defects.patch, 2.3 KB (added by Erik Hovland <erik@…>, 11 years ago)

fixes some defects in mythgallery

  • mythplugins/mythgallery/mythgallery/glsingleview.cpp

    item should be checked before dereferencing
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     .../mythgallery/mythgallery/glsingleview.cpp       |    2 +-
     mythplugins/mythgallery/mythgallery/iconview.cpp   |    9 ++-------
     mythplugins/mythgallery/mythgallery/singleview.cpp |    2 +-
     3 files changed, 4 insertions(+), 9 deletions(-)
    
    diff --git a/mythplugins/mythgallery/mythgallery/glsingleview.cpp b/mythplugins/mythgallery/mythgallery/glsingleview.cpp
    index 1483b2a..61f1b80 100644
    a b void GLSingleView::paintGL(void) 
    209209                cmd = "Internal";
    210210                gContext->GetMainWindow()->HandleMedia(cmd, item->GetPath());
    211211            }
    212             else
     212            else if (item)
    213213            {
    214214                QString path = QString("\"%1\"").arg(item->GetPath());
    215215
  • mythplugins/mythgallery/mythgallery/iconview.cpp

    diff --git a/mythplugins/mythgallery/mythgallery/iconview.cpp b/mythplugins/mythgallery/mythgallery/iconview.cpp
    index c1d9ba9..f26dbb4 100644
    a b using namespace std; 
    5757class FileCopyThread: public QThread
    5858{
    5959  public:
    60     FileCopyThread(IconView *parent, bool move);
     60    FileCopyThread(IconView *parent, bool move)
     61        : m_move(move), m_parent(parent), m_progress(0) {}
    6162    virtual void run();
    6263    int GetProgress(void) { return m_progress; }
    6364
    class FileCopyThread: public QThread 
    6768    volatile int m_progress;
    6869};
    6970
    70 FileCopyThread::FileCopyThread(IconView *parent, bool move)
    71 {
    72     m_move = move;
    73     m_parent = parent;
    74 }
    75 
    7671void FileCopyThread::run()
    7772{
    7873    QStringList::iterator it;
  • mythplugins/mythgallery/mythgallery/singleview.cpp

    diff --git a/mythplugins/mythgallery/mythgallery/singleview.cpp b/mythplugins/mythgallery/mythgallery/singleview.cpp
    index 505b441..9fd2f1b 100644
    a b void SingleView::paintEvent(QPaintEvent *) 
    193193                cmd = "Internal";
    194194                gContext->GetMainWindow()->HandleMedia(cmd, item->GetPath());
    195195            }
    196             else
     196            else if (item)
    197197            {
    198198                QString path = QString("\"%1\"").arg(item->GetPath());
    199199