Skip to content
Snippets Groups Projects
Commit 09d3372e authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Do not use getHomePath() at all. Make outputDirectory a std::filesystem::path

parent ad6706e2
No related branches found
No related tags found
1 merge request!150Save images in $HOME/Pictures instead of $HOME
......@@ -87,8 +87,17 @@ namespace visionx
frameRate = -1.0f;
// Qt Moc does not seem to accept outputDirectory being a std::filesystem::path().
const std::filesystem::path home = armarx::ArmarXDataPath::getHomePath();
outputDirectory = (home / "Pictures").string();
{
if (const char* home = std::getenv("HOME"))
{
// ToDo: Replace with XDG_PICTURES_DIR standards when available.
outputDirectory = std::filesystem::path(home) / "Pictures";
}
else
{
outputDirectory = std::filesystem::absolute(".");
}
}
imageBufferSize = 100;
bufferFps = 5;
......
......@@ -27,11 +27,15 @@
// STD/STL
#include <mutex>
#include <optional>
// <filesystem> needs to be down here. Otherwise, for some reason,
// the Qt AutoMoc will say: 'Parse error at "std"'
#include <filesystem>
#include <queue>
#include <set>
#include <string>
#include <vector>
// Boost
#include <boost/circular_buffer.hpp>
......@@ -89,7 +93,7 @@ namespace visionx
std::string providerName;
int frameRate;
std::string outputDirectory;
std::filesystem::path outputDirectory;
int imageBufferSize;
float bufferFps;
std::set<size_t> imagesToShow;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment