Skip to content

Commit

Permalink
Fix error in installs dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravbug committed Sep 15, 2024
1 parent 16a68d8 commit 79f31d6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions source/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
<string>it</string>
</array>
<key>CFBundleLongVersionString</key>
<string>(c) 2024 Ravbug</string>
<string>(c) 2019-2024 Ravbug</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.54</string>
<string>1.55</string>
<key>CFBundleSignature</key>
<string>UNHn</string>
<key>CFBundleVersion</key>
Expand Down
12 changes: 11 additions & 1 deletion source/add_install_dlg_derived.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,19 @@ void AddNewInstallDlg::PopulateTable(wxCommandEvent&){
installSearchSizer->Layout();
}

#define TRYCATCH 1


void AddNewInstallDlg::GetAllVersions(){
#ifndef __linux__

// version date info
unordered_map<string,string> versionDates;
{
try{
#if TRYCATCH
try
#endif
{
auto r = fetch("https://symbolserver.unity3d.com/000Admin/history.txt");
if (r.code != 200){
wxMessageBox("Unable to access Unity version metadata", "Download error", wxOK | wxICON_ERROR);
Expand Down Expand Up @@ -107,6 +112,9 @@ void AddNewInstallDlg::GetAllVersions(){

// get the version and hashcode
auto slashpos = versiondata.find_first_of("/");
if (slashpos == versiondata.npos){
continue;
}

auto version = string(string_view(versiondata.data(),slashpos));
if (versionDates.find(version) != versionDates.end()){
Expand All @@ -122,9 +130,11 @@ void AddNewInstallDlg::GetAllVersions(){
}
}
}
#if TRYCATCH
catch(std::exception& e){
wxMessageBox(fmt::format("Network error: {}", e.what()), "Error", wxOK | wxICON_ERROR);
}
#endif
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion source/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
static constexpr std::string_view projectsFile = "projects.txt";
static constexpr std::string_view editorPathsFile = "editorPaths.txt";
static constexpr std::string_view templatePrefix = "com.unity.template";
static constexpr std::string_view AppVersion = "v1.54";
static constexpr std::string_view AppVersion = "v1.55";

struct wxListCtrl;
struct wxWindow;
Expand Down
2 changes: 1 addition & 1 deletion source/interface_derived.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void MainFrameDerived::OnAbout(wxCommandEvent& event)
{
wxAboutDialogInfo aboutInfo;
aboutInfo.SetName("Unity Hub Native");
aboutInfo.SetCopyright(fmt::format("(C) Ravbug {}",BUILD_YEAR));
aboutInfo.SetCopyright(fmt::format("(C) Ravbug 2019-{}",BUILD_YEAR));
aboutInfo.SetDescription("Developed with wxWidgets in C++");
#if defined __linux__
aboutInfo.SetWebSite("https://github.com/ravbug/UnityHubNative");
Expand Down

0 comments on commit 79f31d6

Please sign in to comment.