[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/network/kmldonkey
From:       Gioacchino Mazzurco <gioxmx () libero ! it>
Date:       2009-06-03 18:31:07
Message-ID: 1244053867.836683.13509.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 977272 by gmazzurco:

a lot of work about torrent full support
someone that know http better than me please check the http communication with \
mldonkey core on sending torrent it miss very littel thing to work...


 M  +1 -0      kmldonkey/CMakeLists.txt  
 M  +11 -26    kmldonkey/kmldonkey.cpp  
 M  +2 -1      libkmldonkey/CMakeLists.txt  
 M  +3 -2      libkmldonkey/emulecollection.h  
 A             libkmldonkey/torrenthost.cpp   [License: GPL (v2+)]
 A             libkmldonkey/torrenthost.h   [License: GPL (v2+)]


--- trunk/extragear/network/kmldonkey/kmldonkey/CMakeLists.txt #977271:977272
@@ -46,6 +46,7 @@
     prefs/prefs.cpp
     main.cpp
     ../libkmldonkey/emulecollection.cpp
+    ../libkmldonkey/torrenthost.cpp
 )
 
 kde4_add_ui_files(kmldonkeyapp_KDEINIT_SRCS
--- trunk/extragear/network/kmldonkey/kmldonkey/kmldonkey.cpp #977271:977272
@@ -52,7 +52,6 @@
 #include <qtimer.h>
 #include <qtooltip.h>
 #include <qfile.h>
-#include <QTcpServer>
 
 #include <kglobal.h>
 #include <klocale.h>
@@ -94,6 +93,7 @@
 #include <hostdialog.h>
 #include <donkeyhost.h>
 #include <emulecollection.h>
+#include <torrenthost.h>
 
 #include <kdeversion.h>
 #include <KShortcutsDialog>
@@ -108,9 +108,7 @@
         it.current()->setEnabled(enable);
 }
 
-KMLDonkey::KMLDonkey()
-    : KParts::MainWindow()
-{
+KMLDonkey::KMLDonkey() : KParts::MainWindow(){
     setCaption("KMLDonkey");
     setObjectName("KMLDonkeyMainWindow");
 
@@ -161,9 +159,7 @@
     QTimer::singleShot(0, this, SLOT(connectToCore()));
 }
 
-KMLDonkey::~KMLDonkey()
-{
-}
+KMLDonkey::~KMLDonkey(){}
 
 void KMLDonkey::finalise()
 {
@@ -686,26 +682,15 @@
 }
 
 void KMLDonkey::actionSubmitTorrent(){
-
-    QString url = KFileDialog::getOpenFileName(KUrl("kfiledialog:///KMLDonkeySubmitTorrent"), \
                QString("*.torrent\n*"), this, i18n("Open Torrent File"));
-    if (url.isEmpty()) return;
+    qDebug() << "KMLDonkey::actionSubmitTorrent() called";
+    QString filePath = \
KFileDialog::getOpenFileName(KUrl("kfiledialog:///KMLDonkeySubmitTorrent"), \
QString("*.torrent\n*"), this, i18n("Open Torrent File")); +    qDebug() << filePath;
+    if (filePath.isEmpty()) return;
+        
+    TorrentHost * torrentSender = new TorrentHost(filePath);
+    //donkey->submitUrl("http://" + donkey->getLocalAddress().toString() +":"+ \
torrentSender->getPort() + "/ciccio.torrent"); //TODO: decomment this line when \
TorrentHost::sendTorrent() is fixed! +    qDebug() << "http://" + \
donkey->getLocalAddress().toString() +":"+ torrentSender->getPort();  
-    
-    QFile f(url);
-    if (! f.open(QIODevice::ReadOnly)){
-        KMessageBox::error(this, i18n("Failed to open torrent file %1.", url));
-        return;
-    }
-
-    //QTcpServer httpServer();
-    /*
-    //it should appear something like this
-    donkey->submitUrl("http://" + donkey->getLocalAddess().toString() + "/" + url);
-
-    */    
-
-    f.close();
-    
 }
 
 
--- trunk/extragear/network/kmldonkey/libkmldonkey/CMakeLists.txt #977271:977272
@@ -5,6 +5,7 @@
 )
 
 set(libkmldonkey_LIB_SRCS
+    torrenthost.cpp
     emulecollection.cpp
     clientinfo.cpp
     donkeyhost.cpp
@@ -39,7 +40,7 @@
     clientinfo.h fileinfo.h network.h searchinfo.h
     searchquery.h serverinfo.h shareinfo.h roominfo.h
     hostmanager.h hostiface.h infoiface.h hostdialog.h
-    ed2kurl.h
+    ed2kurl.h torrenthost.h
     donkeymessage.h donkeyprotocol.h donkeysocket.h donkeyhost.h donkeytypes.h \
kmldonkey_export.h emulecollection.h  DESTINATION ${INCLUDE_INSTALL_DIR}/kmldonkey \
COMPONENT Devel  )
--- trunk/extragear/network/kmldonkey/libkmldonkey/emulecollection.h #977271:977272
@@ -20,9 +20,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  */
-#ifndef EMULECOLLECTION_H
-#define EMULECOLLECTION_H
 
+#ifndef __libkmldonkey_EMULECOLLECTION_H__
+#define __libkmldonkey_EMULECOLLECTION_H__
+
 #include <string>
 #include <vector>
 #include <stdint.h>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic