added SNAPSHOT_EXTENSION constant

This commit is contained in:
stojce 2014-02-13 20:05:59 +01:00
parent fe6f5a341c
commit 08c8f47cd4
3 changed files with 4 additions and 2 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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;
}