File disable-DHT.diff of Package ktorrent

--- apps/ktorrent/ktorrent.cpp
+++ apps/ktorrent/ktorrent.cpp	2006/05/23 15:57:30
@@ -320,6 +320,7 @@
 	
 	//update QM
 	m_core->getQueueManager()->orderQueue();
+#if 0
 	dht::DHTBase & ht = Globals::instance().getDHT();
 	if (Settings::dhtSupport() && !ht.isRunning())
 	{
@@ -335,6 +336,7 @@
 		ht.stop();
 		ht.start(KGlobal::dirs()->saveLocation("data","ktorrent") + "dht_table",Settings::dhtPort());
 	}
+#endif
 	
 	if (Settings::useEncryption())
 	{
--- libktorrent/ktorrent.kcfg
+++ libktorrent/ktorrent.kcfg	2006/05/23 15:31:53
@@ -79,16 +79,6 @@
 			<label>GUI update interval</label>
 			<default>0</default>
 		</entry>
-		<entry name="dhtSupport" type="Bool">
-			<label>Support for DHT</label>
-			<default>false</default>
-		</entry>
-		<entry name="dhtPort" type="Int">
-		     <label>DHT port</label>
-			<default>6881</default>
-			<min>0</min>
-			<max>65535</max>
-		</entry>
 		<entry name="numUploadSlots" type="Int">
 			<label>Number of upload slots</label>
 			<default>4</default>
--- apps/ktorrent/pref.cpp
+++ apps/ktorrent/pref.cpp	2006/05/23 15:59:53
@@ -153,12 +153,14 @@
 	Settings::setKeepSeeding(dp->keep_seeding->isChecked());
 	Settings::setPort(dp->port->value());
 	Settings::setNumUploadSlots(dp->num_upload_slots->value());
+#if 0
 	if (Settings::dhtSupport() && dp->udp_tracker_port->value() == Settings::dhtPort())
 	{
 		QString msg = i18n("The DHT port needs to be different from the UDP tracker port!");
 		KMessageBox::error(0,msg,i18n("Error"));
 		return false;
 	}
+#endif
 	Settings::setUdpTrackerPort(dp->udp_tracker_port->value());
 	return true;
 }
@@ -202,8 +204,10 @@
 			this,SLOT(autosaveChecked(bool )));
 	connect(gp->custom_ip_check,SIGNAL(toggled(bool)),
 			this,SLOT(customIPChecked(bool )));
+#if 0
 	connect(gp->use_dht,SIGNAL(toggled(bool)),
 			this,SLOT(dhtChecked( bool )));
+#endif
 	connect(gp->use_encryption,SIGNAL(toggled(bool)),
 			this,SLOT(useEncryptionChecked( bool )));
 }
@@ -258,6 +262,7 @@
 	
 	
 	
+#if 0
 	if (gp->use_dht->isChecked() && gp->dht_port->value() == Settings::udpTrackerPort())
 	{
 		QString msg = i18n("The DHT port needs to be different from the UDP tracker port!");
@@ -255,6 +260,7 @@
 	
 	Settings::setDhtSupport(gp->use_dht->isChecked());
 	Settings::setDhtPort(gp->dht_port->value());
+#endif
 	Settings::setUseEncryption(gp->use_encryption->isChecked());
 	Settings::setAllowUnencryptedConnections(gp->allow_unencrypted->isChecked());
 	return true;
@@ -278,8 +284,10 @@
 
 void GeneralPrefPage::dhtChecked(bool on)
 {
+#if 0
 	gp->dht_port->setEnabled(on);
 	gp->dht_port_label->setEnabled(on);
+#endif
 }
 
 void PrefPageTwo::updateData()
@@ -333,10 +341,13 @@
 	gp->custom_ip->setEnabled(useExternalIP);
 	gp->custom_ip_label->setEnabled(useExternalIP);
 		
+	gp->groupBox4->hide();
+#if 0
 	gp->use_dht->setChecked(Settings::dhtSupport());
 	gp->dht_port->setValue(Settings::dhtPort());
 	gp->dht_port->setEnabled(Settings::dhtSupport());
 	gp->dht_port_label->setEnabled(Settings::dhtSupport());
+#endif
 
 	gp->use_encryption->setChecked(Settings::useEncryption());
 	gp->allow_unencrypted->setChecked(Settings::allowUnencryptedConnections());
--- plugins/webinterface/php_interface.cpp	2007/03/06 09:40:49	1.1
+++ plugins/webinterface/php_interface.cpp	2007/03/06 09:42:44
@@ -130,7 +130,7 @@
 		ret.append(QString("\"max_upload_speed\" => \"%1\",").arg(core->getMaxUploadSpeed()));
 		ret.append(QString("\"max_downloads\" => \"%1\",").arg(Settings::maxDownloads()));
 		ret.append(QString("\"max_seeds\"=> \"%1\",").arg(Settings::maxSeeds()));
-		ret.append(QString("\"dht_support\" => \"%1\",").arg(Settings::dhtSupport()));
+		ret.append(QString("\"dht_support\" => \"%1\",").arg(false));
 		ret.append(QString("\"use_encryption\" => \"%1\"").arg(Settings::useEncryption()));
 		ret.append(");\n}\n");
 	
@@ -155,32 +155,6 @@
 			switch(it.key()[0])
 			{
 				case 'd':
-					if(it.key()=="dht")
-					{
-						if(it.data()=="start")
-						{
-							Settings::setDhtSupport(true);
-						}
-						else
-						{
-							Settings::setDhtSupport(false);
-						}
-					
-						dht::DHTBase & ht = Globals::instance().getDHT();
-						if (Settings::dhtSupport() && !ht.isRunning())
-						{
-							ht.start(kt::DataDir() + "dht_table",Settings::dhtPort());
-						}
-						else if (!Settings::dhtSupport() && ht.isRunning())
-						{
-							ht.stop();
-						}
-						else if (Settings::dhtSupport() && ht.getPort() != Settings::dhtPort())
-						{
-							ht.stop();
-							ht.start(kt::DataDir() + "dht_table",Settings::dhtPort());
-						}
-					}	
 					break;
 				case 'e':
 					if(it.key()=="encription")
openSUSE Build Service is sponsored by