Skip to content

Commit

Permalink
Settings for lowest and medium priority search
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan386 committed Jun 13, 2018
1 parent 3c5015d commit 5d25d5d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shareaza/ManagedSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ BOOL CManagedSearch::Execute(int nPriorityClass)
// Throttle this individual search (so it doesn't take up too many resources)
DWORD nThrottle = Settings.Search.GeneralThrottle;
if ( m_nPriority == spLowest )
nThrottle += 30000; // + 30 s
nThrottle += Settings.Search.LowestPriorityThrottle; // + 30 s
else if ( m_nPriority == spMedium )
nThrottle += 800; // + 800 ms
nThrottle += Settings.Search.MediumPriorityThrottle; // + 800 ms

const DWORD tTicks = GetTickCount();
const DWORD tSecs = static_cast< DWORD >( time( NULL ) );
Expand Down
2 changes: 2 additions & 0 deletions shareaza/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ void CSettings::Load()
Add( _T("Search"), _T("DetailPanelVisible"), &Search.DetailPanelVisible, true );
Add( _T("Search"), _T("ExpandMatches"), &Search.ExpandMatches, false );
Add( _T("Search"), _T("FilterMask"), &Search.FilterMask, 0x168 );
Add( _T("Search"), _T("LowestPriorityThrottle"), &Search.LowestPriorityThrottle, 30000, 1000, 1, 120, _T(" s") );
Add( _T("Search"), _T("MediumPriorityThrottle"), &Search.MediumPriorityThrottle, 800, 1, 100, 5000, _T(" ms") );
Add( _T("Search"), _T("GeneralThrottle"), &Search.GeneralThrottle, 200, 1, 200, 1000, _T(" ms") );
Add( _T("Search"), _T("HideSearchPanel"), &Search.HideSearchPanel, false );
Add( _T("Search"), _T("HighlightNew"), &Search.HighlightNew, true );
Expand Down
2 changes: 2 additions & 0 deletions shareaza/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ class CSettings
bool AdvancedPanel;
DWORD SpamFilterThreshold; // Percentage of spam hits which triggers file sources to be treated as a spam
DWORD GeneralThrottle; // A general throttle for how often each individual search may run. Low values may cause source finding to get overlooked.
DWORD LowestPriorityThrottle;
DWORD MediumPriorityThrottle;
DWORD ClearPrevious; // Clear previous search results? 0 - ask user; 1 - no; 2 - yes.
bool SanityCheck; // Drop hits of banned hosts
bool AutoPreview; // Auto-previewing selected hit
Expand Down

0 comments on commit 5d25d5d

Please sign in to comment.