Mageia Bugzilla – Attachment 14098 Details for
Bug 31905
When starting FreeFileSync and choosing "compare" FreeFileSync exits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
3rd patch : ffs_no_check_updates.patch
ffs_no_check_updates.patch (text/plain), 13.31 KB, created by
Philippe Didier
on 2023-10-26 17:31:33 CEST
(
hide
)
Description:
3rd patch : ffs_no_check_updates.patch
Filename:
MIME Type:
Creator:
Philippe Didier
Created:
2023-10-26 17:31:33 CEST
Size:
13.31 KB
patch
obsolete
>--- a/FreeFileSync/Source/Makefile >+++ b/FreeFileSync/Source/Makefile >@@ -81,7 +81,6 @@ > cppFiles+=ui/sync_cfg.cpp > cppFiles+=ui/tray_icon.cpp > cppFiles+=ui/triple_splitter.cpp >-cppFiles+=ui/version_check.cpp > cppFiles+=../../libcurl/curl_wrap.cpp > cppFiles+=../../zen/argon2.cpp > cppFiles+=../../zen/file_access.cpp >--- a/FreeFileSync/Source/ui/gui_generated.cpp >+++ b/FreeFileSync/Source/ui/gui_generated.cpp >@@ -110,15 +110,6 @@ > > m_menuHelp->AppendSeparator(); > >- m_menuItemCheckVersionNow = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&Check for updates now") ) , wxEmptyString, wxITEM_NORMAL ); >- m_menuHelp->Append( m_menuItemCheckVersionNow ); >- >- m_menuItemCheckVersionAuto = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("Check &automatically once a week") ) , wxEmptyString, wxITEM_CHECK ); >- m_menuHelp->Append( m_menuItemCheckVersionAuto ); >- m_menuItemCheckVersionAuto->Check( true ); >- >- m_menuHelp->AppendSeparator(); >- > m_menuItemAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( _("&About") ) + wxT('\t') + wxT("Shift+F1"), wxEmptyString, wxITEM_NORMAL ); > m_menuHelp->Append( m_menuItemAbout ); > >@@ -1129,8 +1120,6 @@ > m_menuTools->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuExportFileList ), this, m_menuItemExportList->GetId()); > m_menuTools->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuResetLayout ), this, m_menuItemResetLayout->GetId()); > m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onShowHelp ), this, m_menuItemHelp->GetId()); >- m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuCheckVersion ), this, m_menuItemCheckVersionNow->GetId()); >- m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuCheckVersionAutomatically ), this, m_menuItemCheckVersionAuto->GetId()); > m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuAbout ), this, m_menuItemAbout->GetId()); > m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::onCompare ), NULL, this ); > m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::onCmpSettings ), NULL, this ); >--- a/FreeFileSync/Source/ui/gui_generated.h >+++ b/FreeFileSync/Source/ui/gui_generated.h >@@ -96,8 +96,6 @@ > wxMenuItem* m_menuItemShowOverview; > wxMenu* m_menuHelp; > wxMenuItem* m_menuItemHelp; >- wxMenuItem* m_menuItemCheckVersionNow; >- wxMenuItem* m_menuItemCheckVersionAuto; > wxMenuItem* m_menuItemAbout; > wxBoxSizer* bSizerPanelHolder; > wxPanel* m_panelTopButtons; >@@ -234,8 +232,6 @@ > virtual void onMenuExportFileList( wxCommandEvent& event ) { event.Skip(); } > virtual void onMenuResetLayout( wxCommandEvent& event ) { event.Skip(); } > virtual void onShowHelp( wxCommandEvent& event ) { event.Skip(); } >- virtual void onMenuCheckVersion( wxCommandEvent& event ) { event.Skip(); } >- virtual void onMenuCheckVersionAutomatically( wxCommandEvent& event ) { event.Skip(); } > virtual void onMenuAbout( wxCommandEvent& event ) { event.Skip(); } > virtual void onCompSettingsContextMouse( wxMouseEvent& event ) { event.Skip(); } > virtual void onCompSettingsContext( wxCommandEvent& event ) { event.Skip(); } >--- a/FreeFileSync/Source/ui/main_dlg.cpp >+++ b/FreeFileSync/Source/ui/main_dlg.cpp >@@ -32,7 +32,6 @@ > #include <wx+/window_tools.h> > #include <wx+/image_resources.h> > #include "cfg_grid.h" >-#include "version_check.h" > #include "gui_status_handler.h" > #include "small_dlgs.h" > #include "rename_dlg.h" >@@ -854,7 +853,6 @@ > > setImage(*m_menuItemHelp, loadImage("help", getDefaultMenuIconSize())); > setImage(*m_menuItemAbout, loadImage("about", getDefaultMenuIconSize())); >- setImage(*m_menuItemCheckVersionNow, loadImage("update_check", getDefaultMenuIconSize())); > > fixMenuIcons(*m_menuFile); > fixMenuIcons(*m_menuActions); >@@ -954,9 +952,6 @@ > //mainly to update row label sizes... > updateGui(); > >- //register regular check for update on next idle event >- Bind(wxEVT_IDLE, &MainDialog::onStartupUpdateCheck, this); >- > //asynchronous call to wxWindow::Dimensions(): fix superfluous frame on right and bottom when FFS is started in fullscreen mode > Bind(wxEVT_IDLE, &MainDialog::onLayoutWindowAsync, this); > wxCommandEvent evtDummy; //call once before onLayoutWindowAsync() >@@ -1181,8 +1176,6 @@ > auiMgr_.GetPane(m_panelSearch).Hide(); //no need to show it on startup > auiMgr_.GetPane(m_panelLog ).Hide(); // > >- m_menuItemCheckVersionAuto->Check(updateCheckActive(globalCfg_.lastUpdateCheck)); >- > auiMgr_.Update(); > } > >@@ -6192,71 +6185,6 @@ > } > > >-void MainDialog::onMenuCheckVersion(wxCommandEvent& event) >-{ >- checkForUpdateNow(*this, globalCfg_.lastOnlineVersion); >-} >- >- >-void MainDialog::onMenuCheckVersionAutomatically(wxCommandEvent& event) >-{ >- if (updateCheckActive(globalCfg_.lastUpdateCheck)) >- disableUpdateCheck(globalCfg_.lastUpdateCheck); >- else >- globalCfg_.lastUpdateCheck = 0; //reset to GlobalSettings.xml default value! >- >- m_menuItemCheckVersionAuto->Check(updateCheckActive(globalCfg_.lastUpdateCheck)); >- >- if (shouldRunAutomaticUpdateCheck(globalCfg_.lastUpdateCheck)) >- { >- flashStatusInfo(_("Searching for program updates...")); >- //synchronous update check is sufficient here: >- automaticUpdateCheckEval(*this, globalCfg_.lastUpdateCheck, globalCfg_.lastOnlineVersion, >- automaticUpdateCheckRunAsync(automaticUpdateCheckPrepare(*this).ref()).ref()); >- } >-} >- >- >-void MainDialog::onStartupUpdateCheck(wxIdleEvent& event) >-{ >- //execute just once per startup! >- [[maybe_unused]] bool ubOk = Unbind(wxEVT_IDLE, &MainDialog::onStartupUpdateCheck, this); >- assert(ubOk); >- >- auto showNewVersionReminder = [this] >- { >- if (!globalCfg_.lastOnlineVersion.empty() && haveNewerVersionOnline(globalCfg_.lastOnlineVersion)) >- { >- auto menu = new wxMenu(); >- wxMenuItem* newItem = new wxMenuItem(menu, wxID_ANY, _("&Show details")); >- Bind(wxEVT_COMMAND_MENU_SELECTED, [this](wxCommandEvent&) { checkForUpdateNow(*this, globalCfg_.lastOnlineVersion); }, newItem->GetId()); >- //show changelog + handle Donation Edition auto-updater (including expiration) >- menu->Append(newItem); //pass ownership >- >- const std::wstring& blackStar = utfTo<std::wstring>("â "); >- m_menubar->Append(menu, blackStar + L' ' + replaceCpy(_("FreeFileSync %x is available!"), L"%x", utfTo<std::wstring>(globalCfg_.lastOnlineVersion)) + L' ' + blackStar); >- } >- }; >- >- if (shouldRunAutomaticUpdateCheck(globalCfg_.lastUpdateCheck)) >- { >- flashStatusInfo(_("Searching for program updates...")); >- >- SharedRef<const UpdateCheckResultPrep> resultPrep = automaticUpdateCheckPrepare(*this); //run on main thread: >- >- guiQueue_.processAsync([resultPrep] { return automaticUpdateCheckRunAsync(resultPrep.ref()); }, //run on worker thread: (long-running part of the check) >- [this, showNewVersionReminder] (SharedRef<const UpdateCheckResult>&& resultAsync) >- { >- automaticUpdateCheckEval(*this, globalCfg_.lastUpdateCheck, globalCfg_.lastOnlineVersion, >- resultAsync.ref()); //run on main thread: >- showNewVersionReminder(); >- }); >- } >- else >- showNewVersionReminder(); >-} >- >- > void MainDialog::onLayoutWindowAsync(wxIdleEvent& event) > { > //execute just once per startup! >--- a/FreeFileSync/Source/ui/main_dlg.h >+++ b/FreeFileSync/Source/ui/main_dlg.h >@@ -276,8 +276,6 @@ > void onMenuExportFileList (wxCommandEvent& event) override; > void onMenuResetLayout (wxCommandEvent& event) override { resetLayout(); } > void onMenuFindItem (wxCommandEvent& event) override { showFindPanel(true /*show*/); } //CTRL + F >- void onMenuCheckVersion (wxCommandEvent& event) override; >- void onMenuCheckVersionAutomatically(wxCommandEvent& event) override; > void onMenuAbout (wxCommandEvent& event) override; > void onShowHelp (wxCommandEvent& event) override { wxLaunchDefaultBrowser(L"https://freefilesync.org/manual.php?topic=freefilesync"); } > void onMenuQuit (wxCommandEvent& event) override { Close(); } >--- a/FreeFileSync/Source/ui/small_dlgs.cpp >+++ b/FreeFileSync/Source/ui/small_dlgs.cpp >@@ -26,7 +26,6 @@ > #include <wx+/image_resources.h> > #include "gui_generated.h" > #include "folder_selector.h" >-#include "version_check.h" > #include "abstract_folder_picker.h" > #include "../afs/concrete.h" > #include "../afs/gdrive.h" >--- a/FreeFileSync/Source/ui/version_check.cpp >+++ b/FreeFileSync/Source/ui/version_check.cpp >@@ -80,6 +80,9 @@ > > bool fff::shouldRunAutomaticUpdateCheck(time_t lastUpdateCheck) > { >+ // short-circuit >+ return false; >+ > if (lastUpdateCheck == getVersionCheckInactiveId()) > return false; > >@@ -176,8 +179,7 @@ > std::wstring updateDetailsMsg; > try > { >- updateDetailsMsg = utfTo<std::wstring>(sendHttpGet(utfTo<Zstring>("https://api.freefilesync.org/latest_changes?" + xWwwFormUrlEncode({{"since", ffsVersion}})), >- ffsUpdateCheckUserAgent, Zstring() /*caCertFilePath*/).readAll(nullptr /*notifyUnbufferedIO*/)); //throw SysError >+ updateDetailsMsg = utfTo<std::wstring>(""); > } > catch (const SysError& e) { updateDetailsMsg = _("Failed to retrieve update information.") + + L"\n\n" + e.toString(); } > >@@ -199,8 +201,8 @@ > > std::string getOnlineVersion(const std::vector<std::pair<std::string, std::string>>& postParams) //throw SysError > { >- const std::string response = sendHttpPost(Zstr("https://api.freefilesync.org/latest_version"), postParams, nullptr /*notifyUnbufferedIO*/, >- ffsUpdateCheckUserAgent, Zstring() /*caCertFilePath*/).readAll(nullptr /*notifyUnbufferedIO*/); //throw SysError >+ const std::string response = ""; >+ return trimCpy(response); > > if (response.empty() || > !std::all_of(response.begin(), response.end(), [](char c) { return isDigit(c) || c == FFS_VERSION_SEPARATOR; }) || >@@ -247,58 +249,6 @@ > } > > >-void fff::checkForUpdateNow(wxWindow& parent, std::string& lastOnlineVersion) >-{ >- try >- { >- const std::string onlineVersion = getOnlineVersion(geHttpPostParameters(parent)); //throw SysError >- lastOnlineVersion = onlineVersion; >- >- if (haveNewerVersionOnline(onlineVersion)) >- showUpdateAvailableDialog(&parent, onlineVersion); >- else >- showNotificationDialog(&parent, DialogInfoType::info, PopupDialogCfg(). >- setIcon(loadImage("update_check")). >- setTitle(_("Check for Program Updates")). >- setMainInstructions(_("FreeFileSync is up-to-date."))); >- } >- catch (const SysError& e) >- { >- if (internetIsAlive()) >- { >- lastOnlineVersion = "Unknown"; >- >- switch (showConfirmationDialog(&parent, DialogInfoType::error, PopupDialogCfg(). >- setTitle(_("Check for Program Updates")). >- setMainInstructions(_("Cannot find current FreeFileSync version number online. A newer version is likely available. Check manually now?")). >- setDetailInstructions(e.toString()), _("&Check"), _("&Retry"))) >- { >- case ConfirmationButton2::accept: >- openBrowserForDownload(&parent); >- break; >- case ConfirmationButton2::accept2: //retry >- checkForUpdateNow(parent, lastOnlineVersion); //note: retry via recursion!!! >- break; >- case ConfirmationButton2::cancel: >- break; >- } >- } >- else >- switch (showConfirmationDialog(&parent, DialogInfoType::error, PopupDialogCfg(). >- setTitle(_("Check for Program Updates")). >- setMainInstructions(replaceCpy(_("Unable to connect to %x."), L"%x", L"freefilesync.org")). >- setDetailInstructions(e.toString()), _("&Retry"))) >- { >- case ConfirmationButton::accept: //retry >- checkForUpdateNow(parent, lastOnlineVersion); //note: retry via recursion!!! >- break; >- case ConfirmationButton::cancel: >- break; >- } >- } >-} >- >- > struct fff::UpdateCheckResultPrep > { > std::vector<std::pair<std::string, std::string>> postParameters; >--- a/FreeFileSync/Source/ui/version_check.h >+++ b/FreeFileSync/Source/ui/version_check.h >@@ -32,9 +32,6 @@ > //run on main thread: > void automaticUpdateCheckEval(wxWindow& parent, time_t& lastUpdateCheck, std::string& lastOnlineVersion, const UpdateCheckResult& result); > //---------------------------------------------------------------------------- >-//call from main thread: >-void checkForUpdateNow(wxWindow& parent, std::string& lastOnlineVersion); >-//---------------------------------------------------------------------------- > } > > #endif //VERSION_CHECK_H_324872374893274983275
--- a/FreeFileSync/Source/Makefile +++ b/FreeFileSync/Source/Makefile @@ -81,7 +81,6 @@ cppFiles+=ui/sync_cfg.cpp cppFiles+=ui/tray_icon.cpp cppFiles+=ui/triple_splitter.cpp -cppFiles+=ui/version_check.cpp cppFiles+=../../libcurl/curl_wrap.cpp cppFiles+=../../zen/argon2.cpp cppFiles+=../../zen/file_access.cpp --- a/FreeFileSync/Source/ui/gui_generated.cpp +++ b/FreeFileSync/Source/ui/gui_generated.cpp @@ -110,15 +110,6 @@ m_menuHelp->AppendSeparator(); - m_menuItemCheckVersionNow = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&Check for updates now") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuHelp->Append( m_menuItemCheckVersionNow ); - - m_menuItemCheckVersionAuto = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("Check &automatically once a week") ) , wxEmptyString, wxITEM_CHECK ); - m_menuHelp->Append( m_menuItemCheckVersionAuto ); - m_menuItemCheckVersionAuto->Check( true ); - - m_menuHelp->AppendSeparator(); - m_menuItemAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( _("&About") ) + wxT('\t') + wxT("Shift+F1"), wxEmptyString, wxITEM_NORMAL ); m_menuHelp->Append( m_menuItemAbout ); @@ -1129,8 +1120,6 @@ m_menuTools->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuExportFileList ), this, m_menuItemExportList->GetId()); m_menuTools->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuResetLayout ), this, m_menuItemResetLayout->GetId()); m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onShowHelp ), this, m_menuItemHelp->GetId()); - m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuCheckVersion ), this, m_menuItemCheckVersionNow->GetId()); - m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuCheckVersionAutomatically ), this, m_menuItemCheckVersionAuto->GetId()); m_menuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::onMenuAbout ), this, m_menuItemAbout->GetId()); m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::onCompare ), NULL, this ); m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::onCmpSettings ), NULL, this ); --- a/FreeFileSync/Source/ui/gui_generated.h +++ b/FreeFileSync/Source/ui/gui_generated.h @@ -96,8 +96,6 @@ wxMenuItem* m_menuItemShowOverview; wxMenu* m_menuHelp; wxMenuItem* m_menuItemHelp; - wxMenuItem* m_menuItemCheckVersionNow; - wxMenuItem* m_menuItemCheckVersionAuto; wxMenuItem* m_menuItemAbout; wxBoxSizer* bSizerPanelHolder; wxPanel* m_panelTopButtons; @@ -234,8 +232,6 @@ virtual void onMenuExportFileList( wxCommandEvent& event ) { event.Skip(); } virtual void onMenuResetLayout( wxCommandEvent& event ) { event.Skip(); } virtual void onShowHelp( wxCommandEvent& event ) { event.Skip(); } - virtual void onMenuCheckVersion( wxCommandEvent& event ) { event.Skip(); } - virtual void onMenuCheckVersionAutomatically( wxCommandEvent& event ) { event.Skip(); } virtual void onMenuAbout( wxCommandEvent& event ) { event.Skip(); } virtual void onCompSettingsContextMouse( wxMouseEvent& event ) { event.Skip(); } virtual void onCompSettingsContext( wxCommandEvent& event ) { event.Skip(); } --- a/FreeFileSync/Source/ui/main_dlg.cpp +++ b/FreeFileSync/Source/ui/main_dlg.cpp @@ -32,7 +32,6 @@ #include <wx+/window_tools.h> #include <wx+/image_resources.h> #include "cfg_grid.h" -#include "version_check.h" #include "gui_status_handler.h" #include "small_dlgs.h" #include "rename_dlg.h" @@ -854,7 +853,6 @@ setImage(*m_menuItemHelp, loadImage("help", getDefaultMenuIconSize())); setImage(*m_menuItemAbout, loadImage("about", getDefaultMenuIconSize())); - setImage(*m_menuItemCheckVersionNow, loadImage("update_check", getDefaultMenuIconSize())); fixMenuIcons(*m_menuFile); fixMenuIcons(*m_menuActions); @@ -954,9 +952,6 @@ //mainly to update row label sizes... updateGui(); - //register regular check for update on next idle event - Bind(wxEVT_IDLE, &MainDialog::onStartupUpdateCheck, this); - //asynchronous call to wxWindow::Dimensions(): fix superfluous frame on right and bottom when FFS is started in fullscreen mode Bind(wxEVT_IDLE, &MainDialog::onLayoutWindowAsync, this); wxCommandEvent evtDummy; //call once before onLayoutWindowAsync() @@ -1181,8 +1176,6 @@ auiMgr_.GetPane(m_panelSearch).Hide(); //no need to show it on startup auiMgr_.GetPane(m_panelLog ).Hide(); // - m_menuItemCheckVersionAuto->Check(updateCheckActive(globalCfg_.lastUpdateCheck)); - auiMgr_.Update(); } @@ -6192,71 +6185,6 @@ } -void MainDialog::onMenuCheckVersion(wxCommandEvent& event) -{ - checkForUpdateNow(*this, globalCfg_.lastOnlineVersion); -} - - -void MainDialog::onMenuCheckVersionAutomatically(wxCommandEvent& event) -{ - if (updateCheckActive(globalCfg_.lastUpdateCheck)) - disableUpdateCheck(globalCfg_.lastUpdateCheck); - else - globalCfg_.lastUpdateCheck = 0; //reset to GlobalSettings.xml default value! - - m_menuItemCheckVersionAuto->Check(updateCheckActive(globalCfg_.lastUpdateCheck)); - - if (shouldRunAutomaticUpdateCheck(globalCfg_.lastUpdateCheck)) - { - flashStatusInfo(_("Searching for program updates...")); - //synchronous update check is sufficient here: - automaticUpdateCheckEval(*this, globalCfg_.lastUpdateCheck, globalCfg_.lastOnlineVersion, - automaticUpdateCheckRunAsync(automaticUpdateCheckPrepare(*this).ref()).ref()); - } -} - - -void MainDialog::onStartupUpdateCheck(wxIdleEvent& event) -{ - //execute just once per startup! - [[maybe_unused]] bool ubOk = Unbind(wxEVT_IDLE, &MainDialog::onStartupUpdateCheck, this); - assert(ubOk); - - auto showNewVersionReminder = [this] - { - if (!globalCfg_.lastOnlineVersion.empty() && haveNewerVersionOnline(globalCfg_.lastOnlineVersion)) - { - auto menu = new wxMenu(); - wxMenuItem* newItem = new wxMenuItem(menu, wxID_ANY, _("&Show details")); - Bind(wxEVT_COMMAND_MENU_SELECTED, [this](wxCommandEvent&) { checkForUpdateNow(*this, globalCfg_.lastOnlineVersion); }, newItem->GetId()); - //show changelog + handle Donation Edition auto-updater (including expiration) - menu->Append(newItem); //pass ownership - - const std::wstring& blackStar = utfTo<std::wstring>("â "); - m_menubar->Append(menu, blackStar + L' ' + replaceCpy(_("FreeFileSync %x is available!"), L"%x", utfTo<std::wstring>(globalCfg_.lastOnlineVersion)) + L' ' + blackStar); - } - }; - - if (shouldRunAutomaticUpdateCheck(globalCfg_.lastUpdateCheck)) - { - flashStatusInfo(_("Searching for program updates...")); - - SharedRef<const UpdateCheckResultPrep> resultPrep = automaticUpdateCheckPrepare(*this); //run on main thread: - - guiQueue_.processAsync([resultPrep] { return automaticUpdateCheckRunAsync(resultPrep.ref()); }, //run on worker thread: (long-running part of the check) - [this, showNewVersionReminder] (SharedRef<const UpdateCheckResult>&& resultAsync) - { - automaticUpdateCheckEval(*this, globalCfg_.lastUpdateCheck, globalCfg_.lastOnlineVersion, - resultAsync.ref()); //run on main thread: - showNewVersionReminder(); - }); - } - else - showNewVersionReminder(); -} - - void MainDialog::onLayoutWindowAsync(wxIdleEvent& event) { //execute just once per startup! --- a/FreeFileSync/Source/ui/main_dlg.h +++ b/FreeFileSync/Source/ui/main_dlg.h @@ -276,8 +276,6 @@ void onMenuExportFileList (wxCommandEvent& event) override; void onMenuResetLayout (wxCommandEvent& event) override { resetLayout(); } void onMenuFindItem (wxCommandEvent& event) override { showFindPanel(true /*show*/); } //CTRL + F - void onMenuCheckVersion (wxCommandEvent& event) override; - void onMenuCheckVersionAutomatically(wxCommandEvent& event) override; void onMenuAbout (wxCommandEvent& event) override; void onShowHelp (wxCommandEvent& event) override { wxLaunchDefaultBrowser(L"https://freefilesync.org/manual.php?topic=freefilesync"); } void onMenuQuit (wxCommandEvent& event) override { Close(); } --- a/FreeFileSync/Source/ui/small_dlgs.cpp +++ b/FreeFileSync/Source/ui/small_dlgs.cpp @@ -26,7 +26,6 @@ #include <wx+/image_resources.h> #include "gui_generated.h" #include "folder_selector.h" -#include "version_check.h" #include "abstract_folder_picker.h" #include "../afs/concrete.h" #include "../afs/gdrive.h" --- a/FreeFileSync/Source/ui/version_check.cpp +++ b/FreeFileSync/Source/ui/version_check.cpp @@ -80,6 +80,9 @@ bool fff::shouldRunAutomaticUpdateCheck(time_t lastUpdateCheck) { + // short-circuit + return false; + if (lastUpdateCheck == getVersionCheckInactiveId()) return false; @@ -176,8 +179,7 @@ std::wstring updateDetailsMsg; try { - updateDetailsMsg = utfTo<std::wstring>(sendHttpGet(utfTo<Zstring>("https://api.freefilesync.org/latest_changes?" + xWwwFormUrlEncode({{"since", ffsVersion}})), - ffsUpdateCheckUserAgent, Zstring() /*caCertFilePath*/).readAll(nullptr /*notifyUnbufferedIO*/)); //throw SysError + updateDetailsMsg = utfTo<std::wstring>(""); } catch (const SysError& e) { updateDetailsMsg = _("Failed to retrieve update information.") + + L"\n\n" + e.toString(); } @@ -199,8 +201,8 @@ std::string getOnlineVersion(const std::vector<std::pair<std::string, std::string>>& postParams) //throw SysError { - const std::string response = sendHttpPost(Zstr("https://api.freefilesync.org/latest_version"), postParams, nullptr /*notifyUnbufferedIO*/, - ffsUpdateCheckUserAgent, Zstring() /*caCertFilePath*/).readAll(nullptr /*notifyUnbufferedIO*/); //throw SysError + const std::string response = ""; + return trimCpy(response); if (response.empty() || !std::all_of(response.begin(), response.end(), [](char c) { return isDigit(c) || c == FFS_VERSION_SEPARATOR; }) || @@ -247,58 +249,6 @@ } -void fff::checkForUpdateNow(wxWindow& parent, std::string& lastOnlineVersion) -{ - try - { - const std::string onlineVersion = getOnlineVersion(geHttpPostParameters(parent)); //throw SysError - lastOnlineVersion = onlineVersion; - - if (haveNewerVersionOnline(onlineVersion)) - showUpdateAvailableDialog(&parent, onlineVersion); - else - showNotificationDialog(&parent, DialogInfoType::info, PopupDialogCfg(). - setIcon(loadImage("update_check")). - setTitle(_("Check for Program Updates")). - setMainInstructions(_("FreeFileSync is up-to-date."))); - } - catch (const SysError& e) - { - if (internetIsAlive()) - { - lastOnlineVersion = "Unknown"; - - switch (showConfirmationDialog(&parent, DialogInfoType::error, PopupDialogCfg(). - setTitle(_("Check for Program Updates")). - setMainInstructions(_("Cannot find current FreeFileSync version number online. A newer version is likely available. Check manually now?")). - setDetailInstructions(e.toString()), _("&Check"), _("&Retry"))) - { - case ConfirmationButton2::accept: - openBrowserForDownload(&parent); - break; - case ConfirmationButton2::accept2: //retry - checkForUpdateNow(parent, lastOnlineVersion); //note: retry via recursion!!! - break; - case ConfirmationButton2::cancel: - break; - } - } - else - switch (showConfirmationDialog(&parent, DialogInfoType::error, PopupDialogCfg(). - setTitle(_("Check for Program Updates")). - setMainInstructions(replaceCpy(_("Unable to connect to %x."), L"%x", L"freefilesync.org")). - setDetailInstructions(e.toString()), _("&Retry"))) - { - case ConfirmationButton::accept: //retry - checkForUpdateNow(parent, lastOnlineVersion); //note: retry via recursion!!! - break; - case ConfirmationButton::cancel: - break; - } - } -} - - struct fff::UpdateCheckResultPrep { std::vector<std::pair<std::string, std::string>> postParameters; --- a/FreeFileSync/Source/ui/version_check.h +++ b/FreeFileSync/Source/ui/version_check.h @@ -32,9 +32,6 @@ //run on main thread: void automaticUpdateCheckEval(wxWindow& parent, time_t& lastUpdateCheck, std::string& lastOnlineVersion, const UpdateCheckResult& result); //---------------------------------------------------------------------------- -//call from main thread: -void checkForUpdateNow(wxWindow& parent, std::string& lastOnlineVersion); -//---------------------------------------------------------------------------- } #endif //VERSION_CHECK_H_324872374893274983275
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31905
:
14080
|
14094
|
14095
|
14096
|
14097
| 14098 |
14099
|
14100
|
14101
|
14102
|
14103
|
14104
|
14105