Skip to content

Commit 0f649c9

Browse files
committed
Bug fixes
create_dialog_derived.cpp ~ loop now has const interface_derived.cpp - removed commented-out code ~ fixed lists having different order than UI ~ fixed editors vector not getting cleared on subsequent calls to LoadEditorVersions() interface_derived.hpp ~ fixed OnRevealInstallLocation opening the wrong folder entirely
1 parent 39da6df commit 0f649c9

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

source/create_dialog_derived.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ CreateProjectDialogD::CreateProjectDialogD(wxWindow* parent, const vector<editor
3030
editors = versions;
3131
this->callback = callback;
3232
//Set combo box values to the different Unity versions passed in
33-
for (editor& e : editors){
33+
for (const editor& e : editors){
3434
unityVersionChoice->AppendString(e.name);
3535
}
3636
//select the element 0

source/interface_derived.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ MainFrameDerived::MainFrameDerived() : MainFrame(NULL){
4848
for (string& str : cols){
4949
projectsList->AppendColumn(str,wxLIST_FORMAT_CENTER);
5050
}
51-
52-
// installsList->AppendColumn("", wxLIST_FORMAT_CENTER, wxLIST_AUTOSIZE_USEHEADER);
53-
// installsPathsList->AppendColumn("", wxLIST_FORMAT_CENTER, wxLIST_AUTOSIZE_USEHEADER);
5451
}
5552
//make the data folder if it does not already exist (with readwrite for all groups)
5653
#if defined __APPLE__ || defined __linux__
@@ -176,14 +173,14 @@ void MainFrameDerived::OnAddProject(wxCommandEvent& event){
176173
*/
177174
void MainFrameDerived::LoadEditorPath(const string& path){
178175
//add to internal structure and to file
179-
installPaths.insert(installPaths.begin(), path);
176+
installPaths.push_back(path);
180177
SaveEditorVersions();
181178

182179
//add to the UI
183180
wxArrayString a;
184181
a.Add(path);
185182

186-
installsPathsList->InsertItems(a,0);
183+
installsPathsList->Append(a);
187184
}
188185

189186
void MainFrameDerived::OnRemoveInstallPath(wxCommandEvent& event){
@@ -407,6 +404,7 @@ void MainFrameDerived::AddProject(const project& p){
407404
void MainFrameDerived::LoadEditorVersions(){
408405
//clear list control
409406
installsList->Clear();
407+
editors.clear();
410408

411409
//iterate over the search paths
412410
for (string& path : installPaths){
@@ -427,12 +425,12 @@ void MainFrameDerived::LoadEditorVersions(){
427425

428426
//add it to the backing datastructure
429427
editor e = {entry->d_name, path};
430-
editors.insert(editors.begin(),e);
428+
editors.push_back(e);
431429
}
432430
}
433431
entry = readdir(dir);
434432
}
435-
installsList->InsertItems(a, 0);
433+
installsList->Append(a);
436434
//free resources when finished
437435
closedir(dir);
438436
free(entry);

source/interface_derived.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ class MainFrameDerived : public MainFrame{
9797
void OnRevealInstallLocation(wxCommandEvent& event){
9898
int id = installsPathsList->GetSelection();
9999
if (id != wxNOT_FOUND){
100-
editor& e = editors[id];
101-
string path = e.path;
102-
reveal_in_explorer(path);
100+
reveal_in_explorer(installPaths[id]);
103101
}
104102
}
105103
void OnOpenHub(wxCommandEvent& event){

0 commit comments

Comments
 (0)