From 9e0c2a3c6c79f3e23165d3fce2ef605305445872 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 2 Jun 2015 14:36:34 -0700 Subject: [PATCH 1/6] fix crash in ~OffscreenGlCanvas on linux shutdown --- libraries/render-utils/src/OffscreenGlCanvas.cpp | 11 +++++++++++ libraries/render-utils/src/OffscreenGlCanvas.h | 1 + 2 files changed, 12 insertions(+) diff --git a/libraries/render-utils/src/OffscreenGlCanvas.cpp b/libraries/render-utils/src/OffscreenGlCanvas.cpp index a3025bc3f6..e41209a40c 100644 --- a/libraries/render-utils/src/OffscreenGlCanvas.cpp +++ b/libraries/render-utils/src/OffscreenGlCanvas.cpp @@ -16,6 +16,17 @@ OffscreenGlCanvas::OffscreenGlCanvas() { } +OffscreenGlCanvas::~OffscreenGlCanvas() { +#ifdef DEBUG + if (_logger) { + makeCurrent(); + delete _logger; + _logger = nullptr; + } +#endif + _context.doneCurrent(); +} + void OffscreenGlCanvas::create(QOpenGLContext* sharedContext) { if (nullptr != sharedContext) { sharedContext->doneCurrent(); diff --git a/libraries/render-utils/src/OffscreenGlCanvas.h b/libraries/render-utils/src/OffscreenGlCanvas.h index 399737ddb8..7a69e276e4 100644 --- a/libraries/render-utils/src/OffscreenGlCanvas.h +++ b/libraries/render-utils/src/OffscreenGlCanvas.h @@ -20,6 +20,7 @@ class QOpenGLDebugLogger; class OffscreenGlCanvas : public QObject { public: OffscreenGlCanvas(); + ~OffscreenGlCanvas(); void create(QOpenGLContext* sharedContext = nullptr); bool makeCurrent(); void doneCurrent(); From 57004c61c723d50f2550570737f43a0e28226d64 Mon Sep 17 00:00:00 2001 From: Niraj Venkat Date: Wed, 3 Jun 2015 14:29:39 -0700 Subject: [PATCH 2/6] Fixed snapshot bug. Snapshots now save and load ok --- interface/src/Application.cpp | 13 ++++--- interface/src/MainWindow.cpp | 21 ++++++++++ interface/src/MainWindow.h | 2 + interface/src/ui/Snapshot.cpp | 73 +++++++++++++++++++---------------- interface/src/ui/Snapshot.h | 14 ++----- 5 files changed, 73 insertions(+), 50 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 803955f02c..9beb8e7867 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1696,12 +1696,9 @@ bool Application::acceptSnapshot(const QString& urlString) { SnapshotMetaData* snapshotData = Snapshot::parseSnapshotData(snapshotPath); if (snapshotData) { - if (!snapshotData->getDomain().isEmpty()) { - DependencyManager::get()->getDomainHandler().setHostnameAndPort(snapshotData->getDomain()); - } - - _myAvatar->setPosition(snapshotData->getLocation()); - _myAvatar->setOrientation(snapshotData->getOrientation()); + if (!snapshotData->getURL().toString().isEmpty()) { + DependencyManager::get()->handleLookupString(snapshotData->getURL().toString()); + } } else { QMessageBox msgBox; msgBox.setText("No location details were found in the file " @@ -3452,6 +3449,10 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, bool billb Glower glower; // Sets alpha to 1.0 _overlays.renderWorld(true); } + + + + activeRenderingThread = nullptr; } diff --git a/interface/src/MainWindow.cpp b/interface/src/MainWindow.cpp index f60716dc48..b1522d7cbd 100644 --- a/interface/src/MainWindow.cpp +++ b/interface/src/MainWindow.cpp @@ -17,6 +17,9 @@ #include #include #include +#include +#include +#include #include "MainWindow.h" #include "Menu.h" @@ -27,6 +30,7 @@ MainWindow::MainWindow(QWidget* parent) : _windowGeometry("WindowGeometry"), _windowState("WindowState", 0) { + setAcceptDrops(true); } void MainWindow::restoreGeometry() { @@ -106,3 +110,20 @@ void MainWindow::changeEvent(QEvent* event) { } QMainWindow::changeEvent(event); } + +void MainWindow::dragEnterEvent(QDragEnterEvent* event) +{ + if (event->mimeData()) + event->acceptProposedAction(); +} + +void MainWindow::dropEvent(QDropEvent* event) +{ + /*QList urls = event->mimeData()->urls(); + foreach(QUrl url, urls) + { + qDebug() << "urlmessage" << url.toString(); + }*/ + + QCoreApplication::sendEvent(QCoreApplication::instance(), event); +} diff --git a/interface/src/MainWindow.h b/interface/src/MainWindow.h index c6faf8e01a..6ebd19b2a9 100644 --- a/interface/src/MainWindow.h +++ b/interface/src/MainWindow.h @@ -36,6 +36,8 @@ protected: virtual void showEvent(QShowEvent* event); virtual void hideEvent(QHideEvent* event); virtual void changeEvent(QEvent* event); + virtual void dragEnterEvent(QDragEnterEvent *e); + virtual void dropEvent(QDropEvent *e); private: Setting::Handle _windowGeometry; diff --git a/interface/src/ui/Snapshot.cpp b/interface/src/ui/Snapshot.cpp index 0d91f4e7ba..1fcd1c7d16 100644 --- a/interface/src/ui/Snapshot.cpp +++ b/interface/src/ui/Snapshot.cpp @@ -15,8 +15,10 @@ #include #include #include +#include #include +#include #include #include #include @@ -28,7 +30,7 @@ // filename format: hifi-snap-by-%username%-on-%date%_%time%_@-%location%.jpg // %1 <= username, %2 <= date and time, %3 <= current location -const QString FILENAME_PATH_FORMAT = "hifi-snap-by-%1-on-%2@%3.jpg"; +const QString FILENAME_PATH_FORMAT = "hifi-snap-by-%1-on-%2.jpg"; const QString DATETIME_FORMAT = "yyyy-MM-dd_hh-mm-ss"; const QString SNAPSHOTS_DIRECTORY = "Snapshots"; @@ -42,8 +44,12 @@ const QString ORIENTATION_Y = "orientation-y"; const QString ORIENTATION_Z = "orientation-z"; const QString ORIENTATION_W = "orientation-w"; +const QString PATH = "path"; + const QString DOMAIN_KEY = "domain"; +const QString URL = "url"; + Setting::Handle Snapshot::snapshotsLocation("snapshotsLocation", QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)); @@ -56,22 +62,16 @@ SnapshotMetaData* Snapshot::parseSnapshotData(QString snapshotPath) { QImage shot(snapshotPath); // no location data stored - if (shot.text(LOCATION_X).isEmpty() || shot.text(LOCATION_Y).isEmpty() || shot.text(LOCATION_Z).isEmpty()) { + if (shot.text(URL).isEmpty()) { return NULL; } + + // parsing URL + QUrl url = QUrl(shot.text(URL), QUrl::ParsingMode::StrictMode); SnapshotMetaData* data = new SnapshotMetaData(); - data->setLocation(glm::vec3(shot.text(LOCATION_X).toFloat(), - shot.text(LOCATION_Y).toFloat(), - shot.text(LOCATION_Z).toFloat())); - - data->setOrientation(glm::quat(shot.text(ORIENTATION_W).toFloat(), - shot.text(ORIENTATION_X).toFloat(), - shot.text(ORIENTATION_Y).toFloat(), - shot.text(ORIENTATION_Z).toFloat())); - - data->setDomain(shot.text(DOMAIN_KEY)); - + data->setURL(url); + return data; } @@ -82,7 +82,7 @@ QString Snapshot::saveSnapshot(QImage image) { snapshotFile->close(); QString snapshotPath = QFileInfo(*snapshotFile).absoluteFilePath(); - + delete snapshotFile; return snapshotPath; @@ -90,29 +90,35 @@ QString Snapshot::saveSnapshot(QImage image) { QTemporaryFile* Snapshot::saveTempSnapshot(QImage image) { // return whatever we get back from saved file for snapshot - return static_cast(savedFileForSnapshot(image, true));; + return static_cast(savedFileForSnapshot(image, true)); } QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) { - Avatar* avatar = DependencyManager::get()->getMyAvatar(); - - glm::vec3 location = avatar->getPosition(); - glm::quat orientation = avatar->getHead()->getOrientation(); - - // add metadata - shot.setText(LOCATION_X, QString::number(location.x)); - shot.setText(LOCATION_Y, QString::number(location.y)); - shot.setText(LOCATION_Z, QString::number(location.z)); - - shot.setText(ORIENTATION_X, QString::number(orientation.x)); - shot.setText(ORIENTATION_Y, QString::number(orientation.y)); - shot.setText(ORIENTATION_Z, QString::number(orientation.z)); - shot.setText(ORIENTATION_W, QString::number(orientation.w)); - - shot.setText(DOMAIN_KEY, DependencyManager::get()->getDomainHandler().getHostname()); + //Avatar* avatar = DependencyManager::get()->getMyAvatar(); + // + //glm::vec3 location = avatar->getPosition(); + //glm::quat orientation = avatar->getHead()->getOrientation(); + // + //// add metadata + //shot.setText(LOCATION_X, QString::number(location.x)); + //shot.setText(LOCATION_Y, QString::number(location.y)); + //shot.setText(LOCATION_Z, QString::number(location.z)); + // + //shot.setText(ORIENTATION_X, QString::number(orientation.x)); + //shot.setText(ORIENTATION_Y, QString::number(orientation.y)); + //shot.setText(ORIENTATION_Z, QString::number(orientation.z)); + //shot.setText(ORIENTATION_W, QString::number(orientation.w)); + // + //shot.setText(DOMAIN_KEY, DependencyManager::get()->getDomainHandler().getHostname()); + // + //shot.setText(PATH, QString::number()); - QString formattedLocation = QString("%1_%2_%3").arg(location.x).arg(location.y).arg(location.z); + // adding URL to snapshot + QUrl currentURL = DependencyManager::get()->currentAddress(); + shot.setText(URL, currentURL.toString()); + + QString formattedLocation = QString(currentURL.toString()); // replace decimal . with '-' formattedLocation.replace('.', '-'); @@ -122,7 +128,7 @@ QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) { QDateTime now = QDateTime::currentDateTime(); - QString filename = FILENAME_PATH_FORMAT.arg(username, now.toString(DATETIME_FORMAT), formattedLocation); + QString filename = FILENAME_PATH_FORMAT.arg(username, now.toString(DATETIME_FORMAT)); const int IMAGE_QUALITY = 100; @@ -136,6 +142,7 @@ QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) { snapshotFullPath.append(filename); QFile* imageFile = new QFile(snapshotFullPath); + std::string str = snapshotFullPath.toStdString(); imageFile->open(QIODevice::WriteOnly); shot.save(imageFile, 0, IMAGE_QUALITY); diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index e83f8b3ec4..52beffdf6a 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -25,19 +25,11 @@ class QTemporaryFile; class SnapshotMetaData { public: - QString getDomain() { return _domain; } - void setDomain(QString domain) { _domain = domain; } - - glm::vec3 getLocation() { return _location; } - void setLocation(glm::vec3 location) { _location = location; } - - glm::quat getOrientation() { return _orientation; } - void setOrientation(glm::quat orientation) { _orientation = orientation; } + QUrl getURL() { return _URL; } + void setURL(QUrl URL) { _URL = URL; } private: - QString _domain; - glm::vec3 _location; - glm::quat _orientation;; + QUrl _URL; }; class Snapshot { From 694272ffaa15dfabf41d754ab356332a92423767 Mon Sep 17 00:00:00 2001 From: Niraj Venkat Date: Wed, 3 Jun 2015 14:48:25 -0700 Subject: [PATCH 3/6] "fixed" formatting issues and code cleanup --- interface/src/Application.cpp | 6 +-- interface/src/MainWindow.cpp | 35 ++++++------- interface/src/ui/Snapshot.cpp | 96 ++++++++++++----------------------- interface/src/ui/Snapshot.h | 10 ++-- 4 files changed, 57 insertions(+), 90 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 9beb8e7867..82d5e85c56 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1696,9 +1696,9 @@ bool Application::acceptSnapshot(const QString& urlString) { SnapshotMetaData* snapshotData = Snapshot::parseSnapshotData(snapshotPath); if (snapshotData) { - if (!snapshotData->getURL().toString().isEmpty()) { - DependencyManager::get()->handleLookupString(snapshotData->getURL().toString()); - } + if (!snapshotData->getURL().toString().isEmpty()) { + DependencyManager::get()->handleLookupString(snapshotData->getURL().toString()); + } } else { QMessageBox msgBox; msgBox.setText("No location details were found in the file " diff --git a/interface/src/MainWindow.cpp b/interface/src/MainWindow.cpp index b1522d7cbd..9ce088e5b0 100644 --- a/interface/src/MainWindow.cpp +++ b/interface/src/MainWindow.cpp @@ -26,11 +26,11 @@ #include "Util.h" MainWindow::MainWindow(QWidget* parent) : - QMainWindow(parent), - _windowGeometry("WindowGeometry"), - _windowState("WindowState", 0) +QMainWindow(parent), +_windowGeometry("WindowGeometry"), +_windowState("WindowState", 0) { - setAcceptDrops(true); + setAcceptDrops(true); } void MainWindow::restoreGeometry() { @@ -91,20 +91,23 @@ void MainWindow::changeEvent(QEvent* event) { if (event->type() == QEvent::WindowStateChange) { QWindowStateChangeEvent* stateChangeEvent = static_cast(event); if ((stateChangeEvent->oldState() == Qt::WindowNoState || - stateChangeEvent->oldState() == Qt::WindowMaximized) && - windowState() == Qt::WindowMinimized) { + stateChangeEvent->oldState() == Qt::WindowMaximized) && + windowState() == Qt::WindowMinimized) { emit windowShown(false); - } else { + } + else { emit windowShown(true); } - + if (isFullScreen() != Menu::getInstance()->isOptionChecked(MenuOption::Fullscreen)) { Menu::getInstance()->setIsOptionChecked(MenuOption::Fullscreen, isFullScreen()); } - } else if (event->type() == QEvent::ActivationChange) { + } + else if (event->type() == QEvent::ActivationChange) { if (isActiveWindow()) { emit windowShown(true); - } else { + } + else { emit windowShown(false); } } @@ -113,17 +116,11 @@ void MainWindow::changeEvent(QEvent* event) { void MainWindow::dragEnterEvent(QDragEnterEvent* event) { - if (event->mimeData()) - event->acceptProposedAction(); + if (event->mimeData()) + event->acceptProposedAction(); } void MainWindow::dropEvent(QDropEvent* event) { - /*QList urls = event->mimeData()->urls(); - foreach(QUrl url, urls) - { - qDebug() << "urlmessage" << url.toString(); - }*/ - - QCoreApplication::sendEvent(QCoreApplication::instance(), event); + QCoreApplication::sendEvent(QCoreApplication::instance(), event); } diff --git a/interface/src/ui/Snapshot.cpp b/interface/src/ui/Snapshot.cpp index 1fcd1c7d16..944172a6f6 100644 --- a/interface/src/ui/Snapshot.cpp +++ b/interface/src/ui/Snapshot.cpp @@ -35,56 +35,43 @@ const QString FILENAME_PATH_FORMAT = "hifi-snap-by-%1-on-%2.jpg"; const QString DATETIME_FORMAT = "yyyy-MM-dd_hh-mm-ss"; const QString SNAPSHOTS_DIRECTORY = "Snapshots"; -const QString LOCATION_X = "location-x"; -const QString LOCATION_Y = "location-y"; -const QString LOCATION_Z = "location-z"; - -const QString ORIENTATION_X = "orientation-x"; -const QString ORIENTATION_Y = "orientation-y"; -const QString ORIENTATION_Z = "orientation-z"; -const QString ORIENTATION_W = "orientation-w"; - -const QString PATH = "path"; - -const QString DOMAIN_KEY = "domain"; - -const QString URL = "url"; +const QString URL = "highfidelity_url"; Setting::Handle Snapshot::snapshotsLocation("snapshotsLocation", - QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)); + QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)); SnapshotMetaData* Snapshot::parseSnapshotData(QString snapshotPath) { - + if (!QFile(snapshotPath).exists()) { return NULL; } - + QImage shot(snapshotPath); - + // no location data stored if (shot.text(URL).isEmpty()) { return NULL; } - // parsing URL - QUrl url = QUrl(shot.text(URL), QUrl::ParsingMode::StrictMode); - + // parsing URL + QUrl url = QUrl(shot.text(URL), QUrl::ParsingMode::StrictMode); + SnapshotMetaData* data = new SnapshotMetaData(); - data->setURL(url); - + data->setURL(url); + return data; } QString Snapshot::saveSnapshot(QImage image) { QFile* snapshotFile = savedFileForSnapshot(image, false); - + // we don't need the snapshot file, so close it, grab its filename and delete it snapshotFile->close(); - + QString snapshotPath = QFileInfo(*snapshotFile).absoluteFilePath(); delete snapshotFile; - + return snapshotPath; } @@ -94,72 +81,55 @@ QTemporaryFile* Snapshot::saveTempSnapshot(QImage image) { } QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) { - - //Avatar* avatar = DependencyManager::get()->getMyAvatar(); - // - //glm::vec3 location = avatar->getPosition(); - //glm::quat orientation = avatar->getHead()->getOrientation(); - // - //// add metadata - //shot.setText(LOCATION_X, QString::number(location.x)); - //shot.setText(LOCATION_Y, QString::number(location.y)); - //shot.setText(LOCATION_Z, QString::number(location.z)); - // - //shot.setText(ORIENTATION_X, QString::number(orientation.x)); - //shot.setText(ORIENTATION_Y, QString::number(orientation.y)); - //shot.setText(ORIENTATION_Z, QString::number(orientation.z)); - //shot.setText(ORIENTATION_W, QString::number(orientation.w)); - // - //shot.setText(DOMAIN_KEY, DependencyManager::get()->getDomainHandler().getHostname()); - // - //shot.setText(PATH, QString::number()); - // adding URL to snapshot - QUrl currentURL = DependencyManager::get()->currentAddress(); - shot.setText(URL, currentURL.toString()); + // adding URL to snapshot + QUrl currentURL = DependencyManager::get()->currentAddress(); + shot.setText(URL, currentURL.toString()); QString formattedLocation = QString(currentURL.toString()); // replace decimal . with '-' formattedLocation.replace('.', '-'); - + QString username = AccountManager::getInstance().getAccountInfo().getUsername(); // normalize username, replace all non alphanumeric with '-' username.replace(QRegExp("[^A-Za-z0-9_]"), "-"); - + QDateTime now = QDateTime::currentDateTime(); - + QString filename = FILENAME_PATH_FORMAT.arg(username, now.toString(DATETIME_FORMAT)); - + const int IMAGE_QUALITY = 100; - + if (!isTemporary) { QString snapshotFullPath = snapshotsLocation.get(); - + if (!snapshotFullPath.endsWith(QDir::separator())) { snapshotFullPath.append(QDir::separator()); } - + snapshotFullPath.append(filename); - + QFile* imageFile = new QFile(snapshotFullPath); - std::string str = snapshotFullPath.toStdString(); + std::string str = snapshotFullPath.toStdString(); imageFile->open(QIODevice::WriteOnly); - + shot.save(imageFile, 0, IMAGE_QUALITY); imageFile->close(); - + return imageFile; - } else { + + } + else { QTemporaryFile* imageTempFile = new QTemporaryFile(QDir::tempPath() + "/XXXXXX-" + filename); - + if (!imageTempFile->open()) { qDebug() << "Unable to open QTemporaryFile for temp snapshot. Will not save."; return NULL; } - + shot.save(imageTempFile, 0, IMAGE_QUALITY); imageTempFile->close(); - + return imageTempFile; } } diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index 52beffdf6a..5856743141 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -24,12 +24,12 @@ class QTemporaryFile; class SnapshotMetaData { public: - + QUrl getURL() { return _URL; } - void setURL(QUrl URL) { _URL = URL; } - + void setURL(QUrl URL) { _URL = URL; } + private: - QUrl _URL; + QUrl _URL; }; class Snapshot { @@ -37,7 +37,7 @@ public: static QString saveSnapshot(QImage image); static QTemporaryFile* saveTempSnapshot(QImage image); static SnapshotMetaData* parseSnapshotData(QString snapshotPath); - + static Setting::Handle snapshotsLocation; private: static QFile* savedFileForSnapshot(QImage & image, bool isTemporary); From 92248d23e7da5835e6a0f90f312ac85ffd42f9e3 Mon Sep 17 00:00:00 2001 From: Niraj Venkat Date: Wed, 3 Jun 2015 14:59:07 -0700 Subject: [PATCH 4/6] more indentation changes --- interface/src/MainWindow.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/interface/src/MainWindow.cpp b/interface/src/MainWindow.cpp index 9ce088e5b0..e30de96890 100644 --- a/interface/src/MainWindow.cpp +++ b/interface/src/MainWindow.cpp @@ -26,9 +26,9 @@ #include "Util.h" MainWindow::MainWindow(QWidget* parent) : -QMainWindow(parent), -_windowGeometry("WindowGeometry"), -_windowState("WindowState", 0) + QMainWindow(parent), + _windowGeometry("WindowGeometry"), + _windowState("WindowState", 0) { setAcceptDrops(true); } @@ -94,33 +94,29 @@ void MainWindow::changeEvent(QEvent* event) { stateChangeEvent->oldState() == Qt::WindowMaximized) && windowState() == Qt::WindowMinimized) { emit windowShown(false); - } - else { + } else { emit windowShown(true); } if (isFullScreen() != Menu::getInstance()->isOptionChecked(MenuOption::Fullscreen)) { Menu::getInstance()->setIsOptionChecked(MenuOption::Fullscreen, isFullScreen()); } - } - else if (event->type() == QEvent::ActivationChange) { + } else if (event->type() == QEvent::ActivationChange) { if (isActiveWindow()) { emit windowShown(true); - } - else { + } else { emit windowShown(false); } } QMainWindow::changeEvent(event); } -void MainWindow::dragEnterEvent(QDragEnterEvent* event) -{ - if (event->mimeData()) +void MainWindow::dragEnterEvent(QDragEnterEvent* event) { + if (event->mimeData()) { event->acceptProposedAction(); + } } -void MainWindow::dropEvent(QDropEvent* event) -{ +void MainWindow::dropEvent(QDropEvent* event) { QCoreApplication::sendEvent(QCoreApplication::instance(), event); } From 4db110a6e1da85a9e11831bb00e77600245d0e24 Mon Sep 17 00:00:00 2001 From: Niraj Venkat Date: Wed, 3 Jun 2015 15:09:45 -0700 Subject: [PATCH 5/6] Final fixes. Snapshot should be good now --- interface/src/Application.cpp | 3 --- interface/src/MainWindow.h | 4 ++-- interface/src/ui/Snapshot.cpp | 9 ++------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 82d5e85c56..97e2bfafbf 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3450,9 +3450,6 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, bool billb _overlays.renderWorld(true); } - - - activeRenderingThread = nullptr; } diff --git a/interface/src/MainWindow.h b/interface/src/MainWindow.h index 6ebd19b2a9..eb262e0f97 100644 --- a/interface/src/MainWindow.h +++ b/interface/src/MainWindow.h @@ -36,8 +36,8 @@ protected: virtual void showEvent(QShowEvent* event); virtual void hideEvent(QHideEvent* event); virtual void changeEvent(QEvent* event); - virtual void dragEnterEvent(QDragEnterEvent *e); - virtual void dropEvent(QDropEvent *e); + virtual void dragEnterEvent(QDragEnterEvent *e); + virtual void dropEvent(QDropEvent *e); private: Setting::Handle _windowGeometry; diff --git a/interface/src/ui/Snapshot.cpp b/interface/src/ui/Snapshot.cpp index 944172a6f6..2bfe92a504 100644 --- a/interface/src/ui/Snapshot.cpp +++ b/interface/src/ui/Snapshot.cpp @@ -63,6 +63,7 @@ SnapshotMetaData* Snapshot::parseSnapshotData(QString snapshotPath) { } QString Snapshot::saveSnapshot(QImage image) { + QFile* snapshotFile = savedFileForSnapshot(image, false); // we don't need the snapshot file, so close it, grab its filename and delete it @@ -86,10 +87,6 @@ QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) { QUrl currentURL = DependencyManager::get()->currentAddress(); shot.setText(URL, currentURL.toString()); - QString formattedLocation = QString(currentURL.toString()); - // replace decimal . with '-' - formattedLocation.replace('.', '-'); - QString username = AccountManager::getInstance().getAccountInfo().getUsername(); // normalize username, replace all non alphanumeric with '-' username.replace(QRegExp("[^A-Za-z0-9_]"), "-"); @@ -110,7 +107,6 @@ QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) { snapshotFullPath.append(filename); QFile* imageFile = new QFile(snapshotFullPath); - std::string str = snapshotFullPath.toStdString(); imageFile->open(QIODevice::WriteOnly); shot.save(imageFile, 0, IMAGE_QUALITY); @@ -118,8 +114,7 @@ QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) { return imageFile; - } - else { + } else { QTemporaryFile* imageTempFile = new QTemporaryFile(QDir::tempPath() + "/XXXXXX-" + filename); if (!imageTempFile->open()) { From 29a15453acb8055b425661446de2a3451ae15d5b Mon Sep 17 00:00:00 2001 From: Niraj Venkat Date: Wed, 3 Jun 2015 15:35:04 -0700 Subject: [PATCH 6/6] Visual studio tab issues fixed --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 97e2bfafbf..e800fa5ff0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1697,7 +1697,7 @@ bool Application::acceptSnapshot(const QString& urlString) { SnapshotMetaData* snapshotData = Snapshot::parseSnapshotData(snapshotPath); if (snapshotData) { if (!snapshotData->getURL().toString().isEmpty()) { - DependencyManager::get()->handleLookupString(snapshotData->getURL().toString()); + DependencyManager::get()->handleLookupString(snapshotData->getURL().toString()); } } else { QMessageBox msgBox;