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)
|
| 209 | 209 | cmd = "Internal"; |
| 210 | 210 | gContext->GetMainWindow()->HandleMedia(cmd, item->GetPath()); |
| 211 | 211 | } |
| 212 | | else |
| | 212 | else if (item) |
| 213 | 213 | { |
| 214 | 214 | QString path = QString("\"%1\"").arg(item->GetPath()); |
| 215 | 215 | |
diff --git a/mythplugins/mythgallery/mythgallery/iconview.cpp b/mythplugins/mythgallery/mythgallery/iconview.cpp
index c1d9ba9..f26dbb4 100644
|
a
|
b
|
using namespace std;
|
| 57 | 57 | class FileCopyThread: public QThread |
| 58 | 58 | { |
| 59 | 59 | public: |
| 60 | | FileCopyThread(IconView *parent, bool move); |
| | 60 | FileCopyThread(IconView *parent, bool move) |
| | 61 | : m_move(move), m_parent(parent), m_progress(0) {} |
| 61 | 62 | virtual void run(); |
| 62 | 63 | int GetProgress(void) { return m_progress; } |
| 63 | 64 | |
| … |
… |
class FileCopyThread: public QThread
|
| 67 | 68 | volatile int m_progress; |
| 68 | 69 | }; |
| 69 | 70 | |
| 70 | | FileCopyThread::FileCopyThread(IconView *parent, bool move) |
| 71 | | { |
| 72 | | m_move = move; |
| 73 | | m_parent = parent; |
| 74 | | } |
| 75 | | |
| 76 | 71 | void FileCopyThread::run() |
| 77 | 72 | { |
| 78 | 73 | QStringList::iterator it; |
diff --git a/mythplugins/mythgallery/mythgallery/singleview.cpp b/mythplugins/mythgallery/mythgallery/singleview.cpp
index 505b441..9fd2f1b 100644
|
a
|
b
|
void SingleView::paintEvent(QPaintEvent *)
|
| 193 | 193 | cmd = "Internal"; |
| 194 | 194 | gContext->GetMainWindow()->HandleMedia(cmd, item->GetPath()); |
| 195 | 195 | } |
| 196 | | else |
| | 196 | else if (item) |
| 197 | 197 | { |
| 198 | 198 | QString path = QString("\"%1\"").arg(item->GetPath()); |
| 199 | 199 | |