diff options
Diffstat (limited to 'freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch')
-rw-r--r-- | freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch | 314 |
1 files changed, 314 insertions, 0 deletions
diff --git a/freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch b/freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch new file mode 100644 index 0000000..12a1b43 --- /dev/null +++ b/freefilesync/debian/patches/revert_zenju_aggressive_upstreamisms.patch @@ -0,0 +1,314 @@ +diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/wx+/choice_enum.h +--- 10.24-0/wx+/choice_enum.h 2020-05-17 18:30:59.441499418 -0400 ++++ 10.24-1/wx+/choice_enum.h 2020-05-17 18:53:59.893685507 -0400 +@@ -7,7 +7,6 @@ + #ifndef CHOICE_ENUM_H_132413545345687 + #define CHOICE_ENUM_H_132413545345687 + +-#include <unordered_map> + #include <vector> + #include <wx/choice.h> + +@@ -44,11 +43,8 @@ + descrList.push_back({ value, { text, tooltip } }); + return *this; + } +- + using DescrList = std::vector<std::pair<Enum, std::pair<wxString, wxString>>>; + DescrList descrList; +- +- std::unordered_map<const wxChoice*, std::vector<wxString>> itemsSetLast; + }; + template <class Enum> void setEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value); + template <class Enum> Enum getEnumVal(const EnumDescrList<Enum>& mapping, const wxChoice& ctrl); +@@ -69,34 +65,26 @@ + + //--------------- impelementation ------------------------------------------- + template <class Enum> +-void setEnumVal(EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value) ++void setEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl, Enum value) + { +- auto& itemsSetLast = mapping.itemsSetLast[&ctrl]; ++ ctrl.Clear(); + +- std::vector<wxString> items; ++ int selectedPos = 0; + for (auto it = mapping.descrList.begin(); it != mapping.descrList.end(); ++it) +- items.push_back(it->second.first); +- +- if (items != itemsSetLast) + { +- ctrl.Set(items); //expensive as fuck! => only call when absolutely needed! +- itemsSetLast = std::move(items); ++ ctrl.Append(it->second.first); ++ if (it->first == value) ++ { ++ selectedPos = it - mapping.descrList.begin(); ++ ++ if (it->second.second.empty()) ++ ctrl.UnsetToolTip(); ++ else ++ ctrl.SetToolTip(it->second.second); ++ } + } +- //----------------------------------------------------------------- +- +- const auto it = std::find_if(mapping.descrList.begin(), mapping.descrList.end(), [&](const auto& mapItem) { return mapItem.first == value; }); +- if (it != mapping.descrList.end()) +- { +- if (const wxString& tooltip = it->second.second; +- !tooltip.empty()) +- ctrl.SetToolTip(tooltip); +- else +- ctrl.UnsetToolTip(); + +- const int selectedPos = it - mapping.descrList.begin(); +- ctrl.SetSelection(selectedPos); +- } +- else assert(false); ++ ctrl.SetSelection(selectedPos); + } + + template <class Enum> +@@ -115,17 +103,11 @@ + + template <class Enum> void updateTooltipEnumVal(const EnumDescrList<Enum>& mapping, wxChoice& ctrl) + { +- const int selectedPos = ctrl.GetSelection(); ++ const Enum currentValue = getEnumVal(mapping, ctrl); + +- if (0 <= selectedPos && selectedPos < std::ssize(mapping.descrList)) +- { +- if (const auto& [text, tooltip] = mapping.descrList[selectedPos].second; +- !tooltip.empty()) +- ctrl.SetToolTip(tooltip); +- else +- ctrl.UnsetToolTip(); +- } +- else assert(false); ++ for (const auto& [enumValue, textAndTooltip] : mapping.descrList) ++ if (currentValue == enumValue) ++ ctrl.SetToolTip(textAndTooltip.second); + } + } + + +Version: 11.1 +Message: this one is really just a fix of Zenju's sloppy Makefile. He'll figure it out on his own for v11.2. If I tell him now, he'll replace the source tarball for 11.1 which will mess up everyone's checksums. +diff -x '*.orig' -x '*.rej' -aur 11.1-1/FreeFileSync/Source/Makefile 11.1-2/FreeFileSync/Source/Makefile +--- 11.1-1/FreeFileSync/Source/Makefile 2020-09-01 20:07:26.751011466 -0400 ++++ 11.1-2/FreeFileSync/Source/Makefile 2020-09-01 20:17:31.030611773 -0400 +@@ -95,6 +95,7 @@ + cppFiles+=../../zen/shutdown.cpp + cppFiles+=../../zen/sys_error.cpp + cppFiles+=../../zen/sys_info.cpp ++cppFiles+=../../zen/sys_version.cpp + cppFiles+=../../zen/thread.cpp + cppFiles+=../../zen/zlib_wrap.cpp + cppFiles+=../../wx+/file_drop.cpp +Message: Now have to revert wxWidgets 3.1.4 upstreamisms +cd 11.1-0 ; git diff HEAD~1 -- $( grep -l -rIE 'wxASCII_STR' ) > ~/foo1 ; ( cd ../11.1-2 ; vi ~/foo1 $( grep -l -rIE 'wxASCII_STR' ) ; ) +cd 11.1-0 ; git diff HEAD~1 -- $( grep -l -rIE 'wxDD_SHOW_HIDDEN' ) > ~/foo1 ; ( cd ../11.1-2 ; vi ~/foo1 $( grep -l -rIE 'wxDD_SHOW_HIDDEN' ) ; ) +diff -x '*.orig' -x '*.rej' -aur 11.1-1/FreeFileSync/Source/RealTimeSync/folder_selector2.cpp 11.1-2/FreeFileSync/Source/RealTimeSync/folder_selector2.cpp +--- 11.1-1/FreeFileSync/Source/RealTimeSync/folder_selector2.cpp 2020-09-01 19:07:43.703122022 -0400 ++++ 11.1-2/FreeFileSync/Source/RealTimeSync/folder_selector2.cpp 2020-09-01 20:13:16.679447647 -0400 +@@ -145,7 +145,7 @@ + } + + Zstring newFolderPath; +- wxDirDialog dirPicker(parent_, _("Select a folder"), utfTo<wxString>(defaultFolderPath), wxDD_DEFAULT_STYLE | wxDD_SHOW_HIDDEN); ++ wxDirDialog dirPicker(parent_, _("Select a folder"), utfTo<wxString>(defaultFolderPath)); //put modal wxWidgets dialogs on stack: creating on freestore leads to memleak! + if (dirPicker.ShowModal() != wxID_OK) + return; + newFolderPath = utfTo<Zstring>(dirPicker.GetPath()); +diff -x '*.orig' -x '*.rej' -aur 11.1-1/FreeFileSync/Source/ui/command_box.h 11.1-2/FreeFileSync/Source/ui/command_box.h +--- 11.1-1/FreeFileSync/Source/ui/command_box.h 2020-09-01 19:07:43.719122215 -0400 ++++ 11.1-2/FreeFileSync/Source/ui/command_box.h 2020-09-01 20:09:56.840929352 -0400 +@@ -30,7 +30,7 @@ + const wxString choices[] = nullptr, + long style = 0, + const wxValidator& validator = wxDefaultValidator, +- const wxString& name = wxASCII_STR(wxComboBoxNameStr)); ++ const wxString& name = wxComboBoxNameStr); + + void setHistory(const std::vector<Zstring>& history, size_t historyMax) { history_ = history; historyMax_ = historyMax; } + std::vector<Zstring> getHistory() const { return history_; } +diff -x '*.orig' -x '*.rej' -aur 11.1-1/FreeFileSync/Source/ui/folder_history_box.h 11.1-2/FreeFileSync/Source/ui/folder_history_box.h +--- 11.1-1/FreeFileSync/Source/ui/folder_history_box.h 2020-09-01 19:07:43.719122215 -0400 ++++ 11.1-2/FreeFileSync/Source/ui/folder_history_box.h 2020-09-01 20:09:50.624849989 -0400 +@@ -68,7 +68,7 @@ + const wxString choices[] = nullptr, + long style = 0, + const wxValidator& validator = wxDefaultValidator, +- const wxString& name = wxASCII_STR(wxComboBoxNameStr)); ++ const wxString& name = wxComboBoxNameStr); + + void setHistory(std::shared_ptr<HistoryList> sharedHistory) { sharedHistory_ = std::move(sharedHistory); } + std::shared_ptr<HistoryList> getHistory() { return sharedHistory_; } +diff -x '*.orig' -x '*.rej' -aur 11.1-1/FreeFileSync/Source/ui/folder_selector.cpp 11.1-2/FreeFileSync/Source/ui/folder_selector.cpp +--- 11.1-1/FreeFileSync/Source/ui/folder_selector.cpp 2020-09-01 20:07:25.907000676 -0400 ++++ 11.1-2/FreeFileSync/Source/ui/folder_selector.cpp 2020-09-01 20:13:48.791852316 -0400 +@@ -227,9 +227,10 @@ + } + + Zstring shellItemPath; +- wxDirDialog dirPicker(parent_, _("Select a folder"), utfTo<wxString>(defaultFolderPath), wxDD_DEFAULT_STYLE | wxDD_SHOW_HIDDEN); +- //GTK2: "Show hidden" is also available as a context menu option in the folder picker! +- //It looks like wxDD_SHOW_HIDDEN only sets the default when opening for the first time!? ++ wxDirDialog dirPicker(parent_, _("Select a folder"), utfTo<wxString>(defaultFolderPath)); //put modal wxWidgets dialogs on stack: creating on freestore leads to memleak! ++ ++ //-> following doesn't seem to do anything at all! still "Show hidden" is available as a context menu option: ++ //::gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dirPicker.m_widget), true /*show_hidden*/); + + if (dirPicker.ShowModal() != wxID_OK) + return; +diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/bitmap_button.h 11.1-2/wx+/bitmap_button.h +--- 11.1-1/wx+/bitmap_button.h 2020-09-01 19:07:43.727122311 -0400 ++++ 11.1-2/wx+/bitmap_button.h 2020-09-01 20:10:31.385364671 -0400 +@@ -26,7 +26,7 @@ + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, +- const wxString& name = wxASCII_STR(wxButtonNameStr)) : ++ const wxString& name = wxButtonNameStr) : + wxBitmapButton(parent, id, wxNullBitmap, pos, size, style, validator, name) + { + SetLabel(label); +diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/dc.h 11.1-2/wx+/dc.h +--- 11.1-1/wx+/dc.h 2020-09-01 19:09:33.652448178 -0400 ++++ 11.1-2/wx+/dc.h 2020-09-01 20:08:43.183988180 -0400 +@@ -68,9 +68,6 @@ + inline + int fastFromDIP(int d) //like wxWindow::FromDIP (but tied to primary monitor and buffered) + { +-#ifndef wxHAVE_DPI_INDEPENDENT_PIXELS +-#error why is wxHAVE_DPI_INDEPENDENT_PIXELS not defined? +-#endif + //GTK2 doesn't properly support high DPI: https://freefilesync.org/forum/viewtopic.php?t=6114 + //=> requires general fix at wxWidgets-level + +diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/graph.h 11.1-2/wx+/graph.h +--- 11.1-1/wx+/graph.h 2020-09-01 19:07:43.731122359 -0400 ++++ 11.1-2/wx+/graph.h 2020-09-01 20:10:36.541429649 -0400 +@@ -153,7 +153,7 @@ + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxTAB_TRAVERSAL | wxNO_BORDER, +- const wxString& name = wxASCII_STR(wxPanelNameStr)); ++ const wxString& name = wxPanelNameStr); + + class CurveAttributes + { +diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/grid.cpp 11.1-2/wx+/grid.cpp +--- 11.1-1/wx+/grid.cpp 2020-09-01 20:07:24.418981662 -0400 ++++ 11.1-2/wx+/grid.cpp 2020-09-01 20:10:23.745268393 -0400 +@@ -268,7 +268,7 @@ + { + public: + SubWindow(Grid& parent) : +- wxWindow(&parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxBORDER_NONE, wxASCII_STR(wxPanelNameStr)), ++ wxWindow(&parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxBORDER_NONE, wxPanelNameStr), + parent_(parent) + { + Bind(wxEVT_PAINT, [this](wxPaintEvent& event) { onPaintEvent(event); }); +diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/grid.h 11.1-2/wx+/grid.h +--- 11.1-1/wx+/grid.h 2020-09-01 19:07:43.731122359 -0400 ++++ 11.1-2/wx+/grid.h 2020-09-01 20:10:48.817584344 -0400 +@@ -149,7 +149,7 @@ + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxTAB_TRAVERSAL | wxNO_BORDER, +- const wxString& name = wxASCII_STR(wxPanelNameStr)); ++ const wxString& name = wxPanelNameStr); + + size_t getRowCount() const; + +diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/toggle_button.h 11.1-2/wx+/toggle_button.h +--- 11.1-1/wx+/toggle_button.h 2020-09-01 19:07:43.731122359 -0400 ++++ 11.1-2/wx+/toggle_button.h 2020-09-01 20:10:44.629531569 -0400 +@@ -24,7 +24,7 @@ + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, +- const wxString& name = wxASCII_STR(wxButtonNameStr)) : ++ const wxString& name = wxButtonNameStr) : + wxBitmapButton(parent, id, bitmap, pos, size, style, validator, name) {} + + //wxButton constructor +@@ -35,7 +35,7 @@ + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, +- const wxString& name = wxASCII_STR(wxButtonNameStr)) : ++ const wxString& name = wxButtonNameStr) : + wxBitmapButton(parent, id, wxNullBitmap, pos, size, style, validator, name) + { + SetLabel(label); +Version: 11.1 +Message: Had to revert gui_status_handler.cpp and .h entirely to version 11.0 to avoid the wx 3.1.4-isms here. +diff --git a/FreeFileSync/Source/ui/gui_status_handler.cpp b/FreeFileSync/Source/ui/gui_status_handler.cpp +index 3cb6aaaa..9484af2c 100644 +--- a/FreeFileSync/Source/ui/gui_status_handler.cpp ++++ b/FreeFileSync/Source/ui/gui_status_handler.cpp +@@ -43,8 +43,8 @@ StatusHandlerTemporaryPanel::StatusHandlerTemporaryPanel(MainDialog& dlg, + mainDlg_.Update(); //don't wait until idle event! + + //register keys +- mainDlg_. Bind(wxEVT_CHAR_HOOK, &StatusHandlerTemporaryPanel::onLocalKeyEvent, this); +- mainDlg_.m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &StatusHandlerTemporaryPanel::onAbortCompare, this); ++ mainDlg_.Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(StatusHandlerTemporaryPanel::OnKeyPressed), nullptr, this); ++ mainDlg_.m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusHandlerTemporaryPanel::OnAbortCompare), nullptr, this); + } + + +@@ -128,9 +128,8 @@ StatusHandlerTemporaryPanel::~StatusHandlerTemporaryPanel() + mainDlg_.auiMgr_.Update(); + + //unregister keys +- [[maybe_unused]] bool ubOk1 = mainDlg_. Unbind(wxEVT_CHAR_HOOK, &StatusHandlerTemporaryPanel::onLocalKeyEvent, this); +- [[maybe_unused]] bool ubOk2 = mainDlg_.m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &StatusHandlerTemporaryPanel::onAbortCompare, this); +- assert(ubOk1 && ubOk2); ++ mainDlg_.Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(StatusHandlerTemporaryPanel::OnKeyPressed), nullptr, this); ++ mainDlg_.m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusHandlerTemporaryPanel::OnAbortCompare), nullptr, this); + + mainDlg_.compareStatus_->teardown(); + +@@ -314,20 +313,20 @@ void StatusHandlerTemporaryPanel::forceUiUpdateNoThrow() + } + + +-void StatusHandlerTemporaryPanel::onLocalKeyEvent(wxKeyEvent& event) ++void StatusHandlerTemporaryPanel::OnKeyPressed(wxKeyEvent& event) + { + const int keyCode = event.GetKeyCode(); + if (keyCode == WXK_ESCAPE) + { + wxCommandEvent dummy; +- onAbortCompare(dummy); ++ OnAbortCompare(dummy); + } + + event.Skip(); + } + + +-void StatusHandlerTemporaryPanel::onAbortCompare(wxCommandEvent& event) ++void StatusHandlerTemporaryPanel::OnAbortCompare(wxCommandEvent& event) + { + userRequestAbort(); + } +diff --git a/FreeFileSync/Source/ui/gui_status_handler.h b/FreeFileSync/Source/ui/gui_status_handler.h +index e8ed01e4..2a9e00d2 100644 +--- a/FreeFileSync/Source/ui/gui_status_handler.h ++++ b/FreeFileSync/Source/ui/gui_status_handler.h +@@ -41,8 +41,8 @@ public: + Result reportResults(); //noexcept!! + + private: +- void onLocalKeyEvent(wxKeyEvent& event); +- void onAbortCompare(wxCommandEvent& event); //handle abort button click ++ void OnKeyPressed(wxKeyEvent& event); ++ void OnAbortCompare(wxCommandEvent& event); //handle abort button click + void showStatsPanel(); + + MainDialog& mainDlg_; |