summaryrefslogtreecommitdiff
path: root/pcr/freefilesync/revert_bulk_append.patch
blob: 9782134ec6a0d695ae8eab4bdd31a14492d6eaf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
diff -r -u a/FreeFileSync/Source/ui/command_box.cpp b/FreeFileSync/Source/ui/command_box.cpp
--- a/FreeFileSync/Source/ui/command_box.cpp	2020-06-18 19:16:52.000000000 +0200
+++ b/FreeFileSync/Source/ui/command_box.cpp	2020-06-21 10:45:23.265579023 +0200
@@ -120,7 +120,8 @@
 
     //this->Clear(); -> NO! emits yet another wxEVT_COMMAND_TEXT_UPDATED!!!
     wxItemContainer::Clear(); //suffices to clear the selection items only!
-    this->Append(items); //expensive as fuck! => only call when absolutely needed!
+    for (const wxString& item : items)                                                                                             
+        this->Append(item); 
 
     //this->SetSelection(wxNOT_FOUND); //don't select anything
     ChangeValue(value); //preserve main text!
diff -r -u a/FreeFileSync/Source/ui/folder_history_box.cpp b/FreeFileSync/Source/ui/folder_history_box.cpp
--- a/FreeFileSync/Source/ui/folder_history_box.cpp	2020-06-18 19:16:52.000000000 +0200
+++ b/FreeFileSync/Source/ui/folder_history_box.cpp	2020-06-21 10:45:23.265579023 +0200
@@ -90,7 +90,8 @@
 
     //this->Clear(); -> NO! emits yet another wxEVT_COMMAND_TEXT_UPDATED!!!
     wxItemContainer::Clear(); //suffices to clear the selection items only!
-    this->Append(items); //expensive as fuck! => only call when absolutely needed!
+    for (const wxString& item : items)                                                                                             
+        this->Append(item); 
 
     //this->SetSelection(wxNOT_FOUND); //don't select anything
     ChangeValue(folderPathPhrase); //preserve main text!
diff -r -u a/FreeFileSync/Source/ui/small_dlgs.cpp b/FreeFileSync/Source/ui/small_dlgs.cpp
--- a/FreeFileSync/Source/ui/small_dlgs.cpp	2020-06-18 19:16:52.000000000 +0200
+++ b/FreeFileSync/Source/ui/small_dlgs.cpp	2020-06-21 11:35:53.494412284 +0200
@@ -293,7 +293,9 @@
     {
         showNotificationDialog(this, DialogInfoType::error, PopupDialogCfg().setDetailInstructions(e.toString()));
     }
-    m_listBoxGdriveUsers->Append(gdriveAccounts);
+    for (auto const& account: gdriveAccounts) {
+        m_listBoxGdriveUsers->Append(account);
+    }
 
     //set default values for Google Drive: use first item of m_listBoxGdriveUsers
     if (!gdriveAccounts.empty() && !acceptsItemPathPhraseGdrive(folderPathPhrase))
diff -r -u a/wx+/choice_enum.h b/wx+/choice_enum.h
--- a/wx+/choice_enum.h	2020-06-18 19:16:51.000000000 +0200
+++ b/wx+/choice_enum.h	2020-06-21 10:45:23.268912329 +0200
@@ -79,7 +79,10 @@
 
     if (items != itemsSetLast)
     {
-        ctrl.Set(items); //expensive as fuck! => only call when absolutely needed!
+        ctrl.Clear();
+        for (auto item : items) {
+            ctrl.Append(item);
+        }
         itemsSetLast = std::move(items);
     }
     //-----------------------------------------------------------------