Navigation Menu

Skip to content

Commit

Permalink
fix temporary file path
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Apr 8, 2021
1 parent dcd621d commit 8ea831f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/core/pointcloud/qgseptdecoder.cpp
Expand Up @@ -23,6 +23,7 @@
#include "qgslogger.h"

#include <QFile>
#include <QDir>
#include <iostream>
#include <memory>
#include <cstring>
Expand Down Expand Up @@ -481,19 +482,17 @@ QgsPointCloudBlock *QgsEptDecoder::decompressLaz( const QByteArray &byteArrayDat
const QgsPointCloudAttributeCollection &attributes,
const QgsPointCloudAttributeCollection &requestedAttributes )
{
QString filename = "/tmp/node.txt";
QString filename = QDir::tempPath() + QDir::separator() + QStringLiteral( "node.txt" );
std::ofstream file( filename.toStdString(), std::ios::binary | std::ios::out );
if ( file.is_open() )
{
std::ofstream file( filename.toStdString(), std::ios::binary | std::ios::out );
if ( file.is_open() )
{
file.write( byteArrayData.constData(), byteArrayData.size() );
file.close();
}
else
{
QgsDebugMsg( QStringLiteral( "Couldn't open %1" ).arg( filename ) );
return nullptr;
}
file.write( byteArrayData.constData(), byteArrayData.size() );
file.close();
}
else
{
QgsDebugMsg( QStringLiteral( "Couldn't open %1" ).arg( filename ) );
return nullptr;
}
return QgsEptDecoder::decompressLaz( filename, attributes, requestedAttributes );
}
Expand Down

0 comments on commit 8ea831f

Please sign in to comment.