Update Sidebar open logic to use the correct folder

This commit is contained in:
Timothy Warren 2019-05-30 16:09:01 -04:00
parent 8ab0a50960
commit e6e40cdaba
4 changed files with 8 additions and 12 deletions

View File

@ -58,6 +58,8 @@ include_directories(${INCLUDE_DIRS})
# set some platform-specific flags
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(MACOSX_DEPLOYMENT_TARGET 10.9)
#set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
set(CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS} -stdlib=libc++")
add_definitions(-D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_ -D__WXMAC__)
else()

View File

@ -1,13 +1,7 @@
#!/bin/bash
mkdir -p build
unset MACOSX_DEPLOYMENT_TARGET
unset CMAKE_OSX_SYSROOT
export MACOSX_DEPLOYMENT_TARGET="10.9"
export CMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"
cd build
cmake -stdlib=libc++ ..
cmake ..
make "$@"
cd ..

View File

@ -75,7 +75,7 @@ void FilePane::CreateTree(const wxString &path)
wxTreeListItem root = this->GetRootItem();
auto *files = new wxArrayString();
wxFileName rootPath(path);
wxFileName rootPath = wxFileName::DirName(path);
rootPath.MakeAbsolute();
this->base_path = rootPath.GetPath();
@ -196,7 +196,7 @@ void FilePane::AddDirToTree(wxTreeListItem &root, const wxString &path, const wx
wxLogInfo("-- Recursing to deeper folder: %s(%s), parent: %s(%s)", dirs[0], dir, newParent, parentDir);
this->AddDirToTree(dir_node, dirs[0], newParent);
this->AddDirToTree(dir_node, dirs[0], newParent, true);
}
delete files;

View File

@ -292,13 +292,13 @@ void MainFrame::OnOpen(wxCommandEvent &WXUNUSED(event))
void MainFrame::OnOpenFolder(wxCommandEvent &event)
{
wxString path;
wxDirDialog dlg(this, "Select Project Dir", wxEmptyString, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST | wxDD_CHANGE_DIR);
if (dlg.ShowModal() != wxID_OK) return;
filePane->CreateTree(dlg.GetPath());
auto path = dlg.GetPath();
filePane->CreateTree(path);
}
/**