Skip to content

Commit ce5b752

Browse files
committed
Fix Windows build
1 parent 530e566 commit ce5b752

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

source/create_dialog_derived.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,7 @@ void CreateProjectDialogD::loadTemplates(const editor& e){
168168
templateCtrl->ClearAll();
169169

170170
//open the folder
171-
#if __APPLE__
172-
auto templatesFolder = e.path / templatesDir;
173-
174-
#else
175-
auto templatesFolder = e.path /e.name / templatesDir;
176-
#endif
171+
auto templatesFolder = e.templatePath();
177172

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

188183
templateCtrl->InsertItem(i);

source/globals.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,7 @@ struct editor {
117117
std::string name;
118118
std::filesystem::path path;
119119
decltype(path) executablePath() const {
120-
#if __APPLE__
121-
return path / executable;
122-
#else
123-
return path / name / executable;
124-
#endif
120+
return path / executable;
125121
}
126122

127123
auto templatePath() const{

source/interface_derived.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ void MainFrameDerived::LoadEditorVersions(){
637637
auto p = entry / executable;
638638
if (filesystem::exists(p)){
639639
//add it to the backing datastructure
640-
editor e = {entry.filename(), p};
640+
editor e = {entry.filename().string(), entry};
641641
addInstall(e);
642642
}
643643
#endif

0 commit comments

Comments
 (0)