Skip to content

Commit

Permalink
Merge pull request #824 from g-maxime/vcl-crash
Browse files Browse the repository at this point in the history
Windows GUI: Fix crashes in preferences dialog
  • Loading branch information
JeromeMartinez authored Apr 15, 2024
2 parents 72f9df1 + 5122386 commit e271fb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Source/Common/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,8 @@ void __fastcall ThreadInternetCheck::Execute()
Prefs->Config(__T("SponsorUrl"))=__T("");

ZtringListList Sponsor=Download.SubSheet(__T("ShowSponsor"));
if (int En=Sponsor.Find(__T("en"), 1)!=-1 && Sponsor[En](2)!=__T("") && Sponsor[En](3)!=__T(""))
unsigned int En=Sponsor.Find(__T("en"), 1);
if (En!=(unsigned int)-1 && Sponsor[En](2)!=__T("") && Sponsor[En](3)!=__T(""))
{
Prefs->Config(__T("Sponsored"))=__T("1");
Ztring Message;
Expand Down
10 changes: 5 additions & 5 deletions Source/GUI/VCL/GUI_Preferences_Sheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@ void __fastcall TPreferences_SheetF::Column_Kind0Change(TObject *Sender)
//Fill Column_Parameter
Column_Parameter[Pos]->Items->Clear();
if (Column_Kind[Pos]->ItemIndex==0) //General
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(Prefs->Translate(__T("General"))+__T("\r\n"), __T("\r\n\r\n")));
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(__T("General\r\n"), __T("\r\n\r\n")));
if (Column_Kind[Pos]->ItemIndex==1) //Video
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(Prefs->Translate(__T("Video"))+__T("\r\n"), __T("\r\n\r\n")));
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(__T("Video\r\n"), __T("\r\n\r\n")));
if (Column_Kind[Pos]->ItemIndex==2) //Audio
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(Prefs->Translate(__T("Audio"))+__T("\r\n"), __T("\r\n\r\n")));
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(__T("Audio\r\n"), __T("\r\n\r\n")));
if (Column_Kind[Pos]->ItemIndex==3) //Text
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(Prefs->Translate(__T("Text"))+__T("\r\n"), __T("\r\n\r\n")));
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(__T("Text\r\n"), __T("\r\n\r\n")));
if (Column_Kind[Pos]->ItemIndex==4) //Chapters
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(Prefs->Translate(__T("Chapters"))+__T("\r\n"), __T("")));
Infos_Parameters[Pos].Write(Ztring(MediaInfoNameSpace::MediaInfo::Option_Static(__T("Info_Parameters_CSV"))).SubString(__T("Chapters\r\n"), __T("")));
for (size_t Info_Pos=0; Info_Pos<Infos_Parameters[Pos].size(); Info_Pos++)
Column_Parameter[Pos]->Items->Add(Infos_Parameters[Pos].Read(Info_Pos, 0).c_str());
Column_Parameter[Pos]->ItemIndex=0;
Expand Down

0 comments on commit e271fb0

Please sign in to comment.