From 08c8f47cd4cb2b2b9fa7cf2776ea64cd126c133a Mon Sep 17 00:00:00 2001 From: stojce Date: Thu, 13 Feb 2014 20:05:59 +0100 Subject: [PATCH] added SNAPSHOT_EXTENSION constant --- interface/src/Application.cpp | 2 +- interface/src/Application.h | 2 ++ interface/src/GLCanvas.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index eaaea9c5be..4ede4a9405 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1384,7 +1384,7 @@ void Application::dropEvent(QDropEvent *event) { QString snapshotPath; const QMimeData *mimeData = event->mimeData(); foreach (QUrl url, mimeData->urls()) { - if (url.url().toLower().endsWith("jpg")) { + if (url.url().toLower().endsWith(SNAPSHOT_EXTENSION)) { snapshotPath = url.url().remove("file://"); break; } diff --git a/interface/src/Application.h b/interface/src/Application.h index 9508c0c9a5..54a804ab72 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -93,6 +93,8 @@ static const float NODE_KILLED_RED = 1.0f; static const float NODE_KILLED_GREEN = 0.0f; static const float NODE_KILLED_BLUE = 0.0f; +static const QString SNAPSHOT_EXTENSION = ".jpg"; + class Application : public QApplication { Q_OBJECT diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index cfff3b8696..7bc79e56d8 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -75,7 +75,7 @@ void GLCanvas::wheelEvent(QWheelEvent* event) { void GLCanvas::dragEnterEvent(QDragEnterEvent* event) { const QMimeData *mimeData = event->mimeData(); foreach (QUrl url, mimeData->urls()) { - if (url.url().toLower().endsWith("jpg")) { + if (url.url().toLower().endsWith(SNAPSHOT_EXTENSION)) { event->acceptProposedAction(); break; }