mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:47:11 +02:00
Final fixes. Snapshot should be good now
This commit is contained in:
parent
92248d23e7
commit
4db110a6e1
3 changed files with 4 additions and 12 deletions
|
@ -3450,9 +3450,6 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, bool billb
|
||||||
_overlays.renderWorld(true);
|
_overlays.renderWorld(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
activeRenderingThread = nullptr;
|
activeRenderingThread = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,8 @@ protected:
|
||||||
virtual void showEvent(QShowEvent* event);
|
virtual void showEvent(QShowEvent* event);
|
||||||
virtual void hideEvent(QHideEvent* event);
|
virtual void hideEvent(QHideEvent* event);
|
||||||
virtual void changeEvent(QEvent* event);
|
virtual void changeEvent(QEvent* event);
|
||||||
virtual void dragEnterEvent(QDragEnterEvent *e);
|
virtual void dragEnterEvent(QDragEnterEvent *e);
|
||||||
virtual void dropEvent(QDropEvent *e);
|
virtual void dropEvent(QDropEvent *e);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Setting::Handle<QRect> _windowGeometry;
|
Setting::Handle<QRect> _windowGeometry;
|
||||||
|
|
|
@ -63,6 +63,7 @@ SnapshotMetaData* Snapshot::parseSnapshotData(QString snapshotPath) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Snapshot::saveSnapshot(QImage image) {
|
QString Snapshot::saveSnapshot(QImage image) {
|
||||||
|
|
||||||
QFile* snapshotFile = savedFileForSnapshot(image, false);
|
QFile* snapshotFile = savedFileForSnapshot(image, false);
|
||||||
|
|
||||||
// we don't need the snapshot file, so close it, grab its filename and delete it
|
// 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<AddressManager>()->currentAddress();
|
QUrl currentURL = DependencyManager::get<AddressManager>()->currentAddress();
|
||||||
shot.setText(URL, currentURL.toString());
|
shot.setText(URL, currentURL.toString());
|
||||||
|
|
||||||
QString formattedLocation = QString(currentURL.toString());
|
|
||||||
// replace decimal . with '-'
|
|
||||||
formattedLocation.replace('.', '-');
|
|
||||||
|
|
||||||
QString username = AccountManager::getInstance().getAccountInfo().getUsername();
|
QString username = AccountManager::getInstance().getAccountInfo().getUsername();
|
||||||
// normalize username, replace all non alphanumeric with '-'
|
// normalize username, replace all non alphanumeric with '-'
|
||||||
username.replace(QRegExp("[^A-Za-z0-9_]"), "-");
|
username.replace(QRegExp("[^A-Za-z0-9_]"), "-");
|
||||||
|
@ -110,7 +107,6 @@ QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) {
|
||||||
snapshotFullPath.append(filename);
|
snapshotFullPath.append(filename);
|
||||||
|
|
||||||
QFile* imageFile = new QFile(snapshotFullPath);
|
QFile* imageFile = new QFile(snapshotFullPath);
|
||||||
std::string str = snapshotFullPath.toStdString();
|
|
||||||
imageFile->open(QIODevice::WriteOnly);
|
imageFile->open(QIODevice::WriteOnly);
|
||||||
|
|
||||||
shot.save(imageFile, 0, IMAGE_QUALITY);
|
shot.save(imageFile, 0, IMAGE_QUALITY);
|
||||||
|
@ -118,8 +114,7 @@ QFile* Snapshot::savedFileForSnapshot(QImage & shot, bool isTemporary) {
|
||||||
|
|
||||||
return imageFile;
|
return imageFile;
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
QTemporaryFile* imageTempFile = new QTemporaryFile(QDir::tempPath() + "/XXXXXX-" + filename);
|
QTemporaryFile* imageTempFile = new QTemporaryFile(QDir::tempPath() + "/XXXXXX-" + filename);
|
||||||
|
|
||||||
if (!imageTempFile->open()) {
|
if (!imageTempFile->open()) {
|
||||||
|
|
Loading…
Reference in a new issue