← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3336: Added option to set automatic search interval

 

------------------------------------------------------------
revno: 3336
committer: Fredrik Ullner <ullner@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Thu 2013-08-08 23:26:09 +0200
message:
   Added option to set automatic search interval
modified:
  changelog.txt
  dcpp/QueueManager.cpp
  dcpp/SettingsManager.cpp
  dcpp/SettingsManager.h
  help/settings_expert.html
  win32/ExpertsPage.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'changelog.txt'
--- changelog.txt	2013-08-02 19:13:38 +0000
+++ changelog.txt	2013-08-08 21:26:09 +0000
@@ -2,6 +2,8 @@
 * [L#1206658] Fix transfer painting issues (poy)
 * [L#1206855] Fix a bug with duplicate directory downloads (maksis)
 * Optimize searches with multiple extensions (emtee, poy)
+* [L#1032153] Added CDATA parsing to XML parser (crise)
+* [L#233798] Added option to set automatic search interval (ullner)
 
 -- 0.828 2013-07-23 --
 * Translation fixes

=== modified file 'dcpp/QueueManager.cpp'
--- dcpp/QueueManager.cpp	2013-08-01 20:36:42 +0000
+++ dcpp/QueueManager.cpp	2013-08-08 21:26:09 +0000
@@ -498,7 +498,15 @@
 				searchString = qi->getTTH().toBase32();
 				online = qi->hasOnlineUsers();
 				recent.push_back(qi->getTarget());
-				nextSearch = aTick + (online ? 120000 : 300000);
+
+				// Previously, this code used a static difference between the online and offline interval.
+				// This difference was 180 seconds (online = 120, offline = 300).
+				uint64_t intervalDiff = 180;
+
+				uint64_t onlineInterval = (SETTING(AUTO_SEARCH_INTERVAL) * 1000);
+				uint64_t offlineInterval = ((SETTING(AUTO_SEARCH_INTERVAL) + intervalDiff)  * 1000);
+
+				nextSearch = aTick + (online ? onlineInterval : offlineInterval );
 			}
 		}
 	}

=== modified file 'dcpp/SettingsManager.cpp'
--- dcpp/SettingsManager.cpp	2013-05-13 18:32:08 +0000
+++ dcpp/SettingsManager.cpp	2013-08-08 21:26:09 +0000
@@ -82,7 +82,7 @@
 	"HubLastLogLines", "MagnetAction", "MaxCommandLength", "MaxCompression", "MaxDownloadSpeed",
 	"MaxFilelistSize", "MaxHashSpeed", "MaxMessageLines", "MaxPMWindows", "MinMessageLines",
 	"MinUploadSpeed", "PMLastLogLines", "SearchHistory", "SetMinislotSize",
-	"SettingsSaveInterval", "Slots", "TabStyle", "TabWidth", "ToolbarSize",
+	"SettingsSaveInterval", "Slots", "TabStyle", "TabWidth", "ToolbarSize", "AutoSearchInterval",
 	"SENTRY",
 	// Bools
 	"AddFinishedInstantly", "AdlsBreakOnFirst",
@@ -174,6 +174,7 @@
 	setDefault(MINIMIZE_TRAY, true);
 	setDefault(ALWAYS_TRAY, true);
 	setDefault(AUTO_SEARCH, false);
+	setDefault(AUTO_SEARCH_INTERVAL, 120);
 	setDefault(TIME_STAMPS, true);
 	setDefault(POPUP_HUB_PMS, true);
 	setDefault(POPUP_BOT_PMS, true);
@@ -522,6 +523,9 @@
 		else if(SETTING(AUTO_SEARCH_LIMIT) < 1)
 			set(AUTO_SEARCH_LIMIT, 1);
 
+		if(SETTING(AUTO_SEARCH_INTERVAL) < 120)
+			set(AUTO_SEARCH_INTERVAL, 120);
+
 #ifdef DCPP_REGEN_CID
 		set(PRIVATE_ID, CID::generate().toBase32());
 #endif

=== modified file 'dcpp/SettingsManager.h'
--- dcpp/SettingsManager.h	2013-05-13 18:32:08 +0000
+++ dcpp/SettingsManager.h	2013-08-08 21:26:09 +0000
@@ -118,6 +118,7 @@
 		MAX_FILELIST_SIZE, MAX_HASH_SPEED, MAX_MESSAGE_LINES, MAX_PM_WINDOWS, MIN_MESSAGE_LINES,
 		MIN_UPLOAD_SPEED, PM_LAST_LOG_LINES, SEARCH_HISTORY, SET_MINISLOT_SIZE,
 		SETTINGS_SAVE_INTERVAL, SLOTS, TAB_STYLE, TAB_WIDTH, TOOLBAR_SIZE,
+		AUTO_SEARCH_INTERVAL,
 
 		INT_LAST };
 

=== modified file 'help/settings_expert.html'
--- help/settings_expert.html	2012-07-12 13:17:54 +0000
+++ help/settings_expert.html	2013-08-08 21:26:09 +0000
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
 <html xmlns="http://www.w3.org/1999/xhtml";>
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
@@ -19,6 +19,8 @@
 disk for downloads. Measured in kibibytes. (default: 16 KiB)</dd>
   <dt id="autosearchlimit">Auto-search limit</dt>
   <dd cshelp="IDH_SETTINGS_EXPERT_AUTO_SEARCH_LIMIT">This will limit the amount of sources a file can have before it will no longer be auto searched for. For example, if this option is set to 2, if a file has more than or exactly 2 sources, the file will be excluded from the auto-search list.</dd>
+    <dt id="Dt1">Auto-search interval</dt>
+  <dd cshelp="IDH_SETTINGS_EXPERT_AUTO_SEARCH_INTERVAL">This will set the time interval between auto searches. Specified in seconds and defaults to 120 seconds (cannot be lower than this).</dd>
   <dt id="minislotsize">Mini slot size</dt>
   <dd cshelp="IDH_SETTINGS_EXPERT_MINISLOT_SIZE">This value defines a file size border for mini slots; a <a href="settings_sharing.html#slots">mini slot</a> will be given to peers on requesting files below this size. The minimum value for this setting is 512 KiB. (default: 512 KiB)</dd>
   <dt id="maxlistsize">Max filelist size</dt>

=== modified file 'win32/ExpertsPage.cpp'
--- win32/ExpertsPage.cpp	2013-01-18 21:28:38 +0000
+++ win32/ExpertsPage.cpp	2013-08-08 21:26:09 +0000
@@ -43,6 +43,7 @@
 	addItem(T_("Max hash speed"), SettingsManager::MAX_HASH_SPEED, true, IDH_SETTINGS_EXPERT_MAX_HASH_SPEED, T_("MiB/s"));
 	addItem(T_("Write buffer size"), SettingsManager::BUFFER_SIZE, true, IDH_SETTINGS_EXPERT_BUFFERSIZE, T_("KiB"));
 	addItem(T_("Auto-search limit"), SettingsManager::AUTO_SEARCH_LIMIT, true, IDH_SETTINGS_EXPERT_AUTO_SEARCH_LIMIT);
+	addItem(T_("Auto-search interval"), SettingsManager::AUTO_SEARCH_INTERVAL, true, IDH_SETTINGS_EXPERT_AUTO_SEARCH_INTERVAL, T_("seconds"));
 	addItem(T_("Mini slot size"), SettingsManager::SET_MINISLOT_SIZE, true, IDH_SETTINGS_EXPERT_MINISLOT_SIZE, T_("KiB"));
 	addItem(T_("Max filelist size"), SettingsManager::MAX_FILELIST_SIZE, true, IDH_SETTINGS_EXPERT_MAX_FILELIST_SIZE, T_("MiB"));
 	addItem(T_("PID"), SettingsManager::PRIVATE_ID, false, IDH_SETTINGS_EXPERT_PRIVATE_ID);
@@ -68,6 +69,9 @@
 		settings->set(SettingsManager::AUTO_SEARCH_LIMIT, 5);
 	else if(SETTING(AUTO_SEARCH_LIMIT) < 1)
 		settings->set(SettingsManager::AUTO_SEARCH_LIMIT, 1);
+
+	if(SETTING(AUTO_SEARCH_INTERVAL) < 120)
+		settings->set(SettingsManager::AUTO_SEARCH_INTERVAL, 120);
 }
 
 void ExpertsPage::addItem(const tstring& text, int setting, bool isInt, unsigned helpId, const tstring& text2) {