Skip to content

Commit 839226a

Browse files
committed
On OS X, the default data directory is now ~/Documents/open-ephys, which is created if it doesn't exist
1 parent 36f4c8c commit 839226a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Source/UI/ControlPanel.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,17 +426,17 @@ ControlPanel::ControlPanel(ProcessorGraph* graph_, AudioComponent* audio_)
426426
addChildComponent(newDirectoryButton);
427427

428428

429-
File executable = File::getSpecialLocation(File::currentExecutableFile);
430-
431429
#if defined(__APPLE__)
432-
const String executableDirectory =
433-
executable.getParentDirectory().getParentDirectory().getParentDirectory().getParentDirectory().getFullPathName();
430+
const File dataDirectory = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile("open-ephys");
431+
if (!dataDirectory.isDirectory()) {
432+
dataDirectory.createDirectory();
433+
}
434434
#else
435-
const String executableDirectory = executable.getParentDirectory().getFullPathName();
435+
const File dataDirectory = File::getSpecialLocation(File::currentExecutableFile).getParentDirectory();
436436
#endif
437437

438438
filenameComponent = new FilenameComponent("folder selector",
439-
executableDirectory,
439+
dataDirectory.getFullPathName(),
440440
true,
441441
true,
442442
true,

0 commit comments

Comments
 (0)