Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravbug committed Sep 27, 2024
1 parent 530e566 commit ce5b752
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
9 changes: 2 additions & 7 deletions source/create_dialog_derived.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,7 @@ void CreateProjectDialogD::loadTemplates(const editor& e){
templateCtrl->ClearAll();

//open the folder
#if __APPLE__
auto templatesFolder = e.path / templatesDir;

#else
auto templatesFolder = e.path /e.name / templatesDir;
#endif
auto templatesFolder = e.templatePath();

for(const auto& entry : std::filesystem::directory_iterator{templatesFolder}){
//does the file start with the correct prefix?
Expand All @@ -182,7 +177,7 @@ void CreateProjectDialogD::loadTemplates(const editor& e){
//add it to the UI
wxListItem i;
i.SetId(0);
string label = path.filename();
string label = path.filename().string();
i.SetText(label.substr(templatePrefix.length()+1));

templateCtrl->InsertItem(i);
Expand Down
6 changes: 1 addition & 5 deletions source/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ struct editor {
std::string name;
std::filesystem::path path;
decltype(path) executablePath() const {
#if __APPLE__
return path / executable;
#else
return path / name / executable;
#endif
return path / executable;
}

auto templatePath() const{
Expand Down
2 changes: 1 addition & 1 deletion source/interface_derived.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ void MainFrameDerived::LoadEditorVersions(){
auto p = entry / executable;
if (filesystem::exists(p)){
//add it to the backing datastructure
editor e = {entry.filename(), p};
editor e = {entry.filename().string(), entry};
addInstall(e);
}
#endif
Expand Down

0 comments on commit ce5b752

Please sign in to comment.