Mercurial > p > dcplusplus > code
changeset 4001:caac2855dec2
Remove an unneeded share refresh call and some dead code from UploadPage - fixes hashing was unable to start after share filtering options have changed
author | eMTee <emtee11@gmail.com> |
---|---|
date | Sat, 15 Jun 2024 13:51:29 +0200 |
parents | 37edf7ac9d32 |
children | 2665be3ee7d2 |
files | changelog.txt win32/UploadFilteringPage.cpp win32/UploadPage.cpp win32/UploadPage.h |
diffstat | 4 files changed, 11 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/changelog.txt Fri Jun 14 10:33:05 2024 +0200 +++ b/changelog.txt Sat Jun 15 13:51:29 2024 +0200 @@ -1,3 +1,4 @@ +* Fix hashing after share filter options changed (emtee) * [L#2066921] [ADC] Add encrypted active search results feature (SUDP) (emtee, iceman50, based on code from AirDC++) * Improve find text in chats, add search context menu commands to various windows with text boxes (emtee) * Improve randomization (iceman50)
--- a/win32/UploadFilteringPage.cpp Fri Jun 14 10:33:05 2024 +0200 +++ b/win32/UploadFilteringPage.cpp Sat Jun 15 13:51:29 2024 +0200 @@ -95,7 +95,7 @@ modifyRegExButton = regexGrid->addChild(Button::Seed(T_("M&odify"))); modifyRegExButton->onClicked([this] { handleModButtonClicked(T_("Regular expressions"), regexTextBox); }); - regexGrid->addChild(Label::Seed(T_("Use semicolon to separate multiple regular expressions."))); + regexGrid->addChild(Label::Seed(T_("Use semicolons to separate multiple regular expressions."))); } { @@ -111,7 +111,7 @@ modifyExtensionsButton = extensionsGrid->addChild(Button::Seed(T_("M&odify"))); modifyExtensionsButton->onClicked([this] { handleModButtonClicked(T_("File extensions"), extensionsTextBox); }); - extensionsGrid->addChild(Label::Seed(T_("Use semicolon to separate multiple extensions."))); + extensionsGrid->addChild(Label::Seed(T_("Use semicolons to separate multiple extensions."))); } { @@ -127,9 +127,13 @@ modifyPathsButton = pathsGrid->addChild(Button::Seed(T_("M&odify"))); modifyPathsButton->onClicked([this] { handleModButtonClicked(T_("Paths"), pathsTextBox); }); - pathsGrid->addChild(Label::Seed(T_("Use semicolon to separate multiple paths."))); + pathsGrid->addChild(Label::Seed(T_("Use semicolons to separate multiple paths."))); } + // @todo Add some clever spacing here to fill up the empty space so the following information text aligns to the bottom of the pane as usual + + grid->addChild(Label::Seed(T_("Changes in the share will be applied when you close the Settings dialog."))); + PropPage::read(items); } @@ -149,7 +153,7 @@ ShareManager::getInstance()->updateFilterCache(); ShareManager::getInstance()->setDirty(); - ShareManager::getInstance()->refresh(true, false, true); + ShareManager::getInstance()->refresh(true); } }
--- a/win32/UploadPage.cpp Fri Jun 14 10:33:05 2024 +0200 +++ b/win32/UploadPage.cpp Sat Jun 15 13:51:29 2024 +0200 @@ -165,10 +165,9 @@ { PropPage::write(items); - if(SETTING(SLOTS) < 1) + if(SETTING(SLOTS) < 1) { SettingsManager::getInstance()->set(SettingsManager::SLOTS, 1); - - ShareManager::getInstance()->refresh(); + } } void UploadPage::handleDoubleClick() { @@ -203,23 +202,6 @@ addDirectory(i); } -void UploadPage::handleShareHiddenClicked(CheckBoxPtr checkBox, int setting) { - // Save the checkbox state so that ShareManager knows to include/exclude hidden files - SettingsManager::getInstance()->set(static_cast<SettingsManager::BoolSetting>(setting), checkBox->getChecked()); - - // Refresh the share. This is a blocking refresh. Might cause problems? - // Hopefully people won't click the checkbox enough for it to be an issue. :-) - ShareManager::getInstance()->setDirty(); - ShareManager::getInstance()->refresh(true, false, true); - - // Clear the GUI list, for insertion of updated shares - directories->clear(); - fillList(); - - // Display the new total share size - refreshTotalSize(); -} - void UploadPage::handleAddClicked() { tstring target = Text::toT(SETTING(LAST_SHARED_FOLDER)); if(FolderDialog(this).setInitialSelection(CSIDL_PERSONAL).open(target)) {
--- a/win32/UploadPage.h Fri Jun 14 10:33:05 2024 +0200 +++ b/win32/UploadPage.h Sat Jun 15 13:51:29 2024 +0200 @@ -44,7 +44,6 @@ bool handleKeyDown(int c); void handleSelectionChanged(); void handleDragDrop(const TStringList& files); - void handleShareHiddenClicked(CheckBoxPtr checkBox, int setting); void handleAddClicked(); void handleRenameClicked(); void handleRemoveClicked();