From c04fb06fb8f1d39e779d22d884133808b6bce639 Mon Sep 17 00:00:00 2001 From: ivan386 Date: Sun, 30 Sep 2018 22:09:17 +0300 Subject: [PATCH] New option eDonkey.CloseNeighboursOnConnect --- shareaza/NeighboursWithConnect.cpp | 6 ++++-- shareaza/Settings.cpp | 1 + shareaza/Settings.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shareaza/NeighboursWithConnect.cpp b/shareaza/NeighboursWithConnect.cpp index 4e318a52ca..331ad3f042 100644 --- a/shareaza/NeighboursWithConnect.cpp +++ b/shareaza/NeighboursWithConnect.cpp @@ -141,7 +141,8 @@ CNeighbour* CNeighboursWithConnect::ConnectTo( case PROTOCOL_ED2K: Settings.eDonkey.EnableToday = true; - CloseDonkeys(); + if ( Settings.eDonkey.CloseNeighboursOnConnect ) + CloseDonkeys(); break; case PROTOCOL_BT: @@ -274,7 +275,8 @@ CNeighbour* CNeighboursWithConnect::ConnectTo( case PROTOCOL_ED2K: Settings.eDonkey.EnableToday = true; - CloseDonkeys(); + if ( Settings.eDonkey.CloseNeighboursOnConnect ) + CloseDonkeys(); break; case PROTOCOL_BT: diff --git a/shareaza/Settings.cpp b/shareaza/Settings.cpp index 3e42f5f71f..baea570b11 100644 --- a/shareaza/Settings.cpp +++ b/shareaza/Settings.cpp @@ -422,6 +422,7 @@ void CSettings::Load() Add( _T("Gnutella2"), _T("UdpOutFrames"), &Gnutella2.UdpOutFrames, 256, 1, 16, 2048 ); Add( _T("Gnutella2"), _T("UdpOutResend"), &Gnutella2.UdpOutResend, 6000, 1000, 1, 300, _T(" s") ); + Add( _T("eDonkey"), _T("CloseNeighboursOnConnect"), &eDonkey.CloseNeighboursOnConnect, true ); Add( _T("eDonkey"), _T("DefaultServerFlags"), &eDonkey.DefaultServerFlags, 0xFFFFFFFF ); Add( _T("eDonkey"), _T("DequeueTime"), &eDonkey.DequeueTime, 3600, 60, 2, 512, _T(" m") ); Add( _T("eDonkey"), _T("EnableAlways"), &eDonkey.EnableAlways, false ); diff --git a/shareaza/Settings.h b/shareaza/Settings.h index 88e7d05045..4a98f47eb6 100644 --- a/shareaza/Settings.h +++ b/shareaza/Settings.h @@ -417,6 +417,7 @@ class CSettings struct seDonkey { + bool CloseNeighboursOnConnect; bool EnableToday; bool EnableAlways; bool FastConnect; // Try connecting to 2 servers to get online faster