Skip to content

Commit

Permalink
OpenUserDataFolder makes it if needed
Browse files Browse the repository at this point in the history
If you open your user data folder to put stuff in it, that means
you want it, so if it isn't there, we should create it.

Closes surge-synthesizer#1323
  • Loading branch information
baconpaul committed Nov 22, 2019
1 parent cf24f61 commit 6ad82e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/common/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@
#include "vstgui/lib/platform/platform_x11.h"
#include "vstgui/lib/platform/linux/x11platform.h"

#if LINUX
#include <experimental/filesystem>
#elif MAC || TARGET_RACK
#include <filesystem.h>
#else
#include <filesystem>
#endif

namespace fs = std::experimental::filesystem;

#if LINUX && TARGET_LV2
namespace SurgeLv2
{
Expand Down Expand Up @@ -3081,6 +3091,8 @@ void SurgeGUIEditor::showSettingsMenu(CRect &menuRect)


addCallbackMenu(dataSubMenu, "Open User Data Folder", [this]() {
// make it if it isn't there
fs::create_directories(this->synth->storage.userDataPath);
Surge::UserInteractions::openFolderInFileBrowser(this->synth->storage.userDataPath);
});
did++;
Expand Down

0 comments on commit 6ad82e5

Please sign in to comment.