Showing the changes to interface/src/Menu.cpp (1 of 8 files). Show all
Unified · Split
| @@ -25,7 +25,6 @@ · 24 unmodified lines | ||
| 25 | 25 | #include <QMessageBox> |
| 26 | 26 | #include <QShortcut> |
| 27 | 27 | #include <QSlider> |
| 28 | −#include <QStandardPaths> | |
| 29 | 28 | #include <QUuid> |
| 30 | 29 | #include <QHBoxLayout> |
| 31 | 30 | |
| @@ -87,7 +86,8 @@ Menu::Menu() : · 55 unmodified lines | ||
| 87 | 86 | _fpsAverage(FIVE_SECONDS_OF_FRAMES), |
| 88 | 87 | _fastFPSAverage(ONE_SECOND_OF_FRAMES), |
| 89 | 88 | _loginAction(NULL), |
| 90 | − _preferencesDialog(NULL) | |
| 89 | + _preferencesDialog(NULL), | |
| 90 | + _snapshotsLocation() | |
| 91 | 91 | { |
| 92 | 92 | Application *appInstance = Application::getInstance(); |
| 93 | 93 | |
| @@ -417,6 +417,8 @@ void Menu::loadSettings(QSettings* settings) { · 323 unmodified lines | ||
| 417 | 417 | _maxVoxelPacketsPerSecond = loadSetting(settings, "maxVoxelsPPS", DEFAULT_MAX_VOXEL_PPS); |
| 418 | 418 | _voxelSizeScale = loadSetting(settings, "voxelSizeScale", DEFAULT_OCTREE_SIZE_SCALE); |
| 419 | 419 | _boundaryLevelAdjust = loadSetting(settings, "boundaryLevelAdjust", 0); |
| 420 | + _snapshotsLocation = settings->value("snapshotsLocation", | |
| 421 | + QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)).toString(); | |
| 420 | 422 | |
| 421 | 423 | settings->beginGroup("View Frustum Offset Camera"); |
| 422 | 424 | // in case settings is corrupt or missing loadSetting() will check for NaN |
| @@ -456,6 +458,7 @@ void Menu::saveSettings(QSettings* settings) { · 33 unmodified lines | ||
| 456 | 458 | settings->setValue("maxVoxelsPPS", _maxVoxelPacketsPerSecond); |
| 457 | 459 | settings->setValue("voxelSizeScale", _voxelSizeScale); |
| 458 | 460 | settings->setValue("boundaryLevelAdjust", _boundaryLevelAdjust); |
| 461 | + settings->setValue("snapshotsLocation", _snapshotsLocation); | |
| 459 | 462 | settings->beginGroup("View Frustum Offset Camera"); |
| 460 | 463 | settings->setValue("viewFrustumOffsetYaw", _viewFrustumOffset.yaw); |
| 461 | 464 | settings->setValue("viewFrustumOffsetPitch", _viewFrustumOffset.pitch); |
| @@ -1510,3 +1513,10 @@ void Menu::removeMenuItem(const QString& menu, const QString& menuitem) { · 1048 unmodified lines | ||
| 1510 | 1513 | QMenuBar::repaint(); |
| 1511 | 1514 | }; |
| 1512 | 1515 | |
| 1516 | +QString Menu::getSnapshotsLocation() const { | |
| 1517 | + if (_snapshotsLocation.isNull() || _snapshotsLocation.isEmpty() || QDir(_snapshotsLocation).exists() == false) { | |
| 1518 | + return QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); | |
| 1519 | + } | |
| 1520 | + return _snapshotsLocation; | |
| 1521 | +} | |
| 1522 | + | |