From 9ad5c7b5e23b4940e7a3ea3ca3a6fb77e6a8fab0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 20 Jan 2010 02:37:40 +0000 Subject: Updated to final KDE3 ktorrent release (2.2.6) git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1077377 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- estimation-scripts/enable-logging.diff | 224 +++++++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 estimation-scripts/enable-logging.diff (limited to 'estimation-scripts/enable-logging.diff') diff --git a/estimation-scripts/enable-logging.diff b/estimation-scripts/enable-logging.diff new file mode 100644 index 0000000..57dc703 --- /dev/null +++ b/estimation-scripts/enable-logging.diff @@ -0,0 +1,224 @@ +Index: estimation-scripts/enable-logging.diff +=================================================================== +--- estimation-scripts/enable-logging.diff (revision 472081) ++++ estimation-scripts/enable-logging.diff (working copy) +@@ -1,106 +0,0 @@ +-Index: apps/ktorrent/ktorrentviewitem.cpp +-=================================================================== +---- apps/ktorrent/ktorrentviewitem.cpp (revision 469614) +-+++ apps/ktorrent/ktorrentviewitem.cpp (working copy) +-@@ -25,6 +25,7 @@ +- #include +- #include "ktorrentviewitem.h" +- #include "functions.h" +-+#include +- +- using namespace bt; +- +-@@ -77,6 +78,9 @@ +- KTorrentViewItem::KTorrentViewItem(QListView* parent,bt::TorrentControl* tc) +- : KListViewItem(parent),tc(tc) +- { +-+ toLog = true; +-+ counter = 1; +-+ started = false; +- update(); +- } +- +-@@ -86,6 +90,7 @@ +- +- void KTorrentViewItem::update() +- { +-+ bool tmpLog = true; +- /* +- addColumn(i18n("File")); +- addColumn(i18n("Status")); +-@@ -114,8 +119,43 @@ +- setText(6,KBytesPerSecToString(tc->getUploadRate() / 1024.0)); +- +- KLocale* loc = KGlobal::locale(); +-+ +-+ +-+ if(counter==1) +-+ { +-+ if (tc->isRunning()) +-+ { +-+ if(!started) +-+ { +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",ACTIVATED" << endl; +-+ tmpLog = false; +-+ started = true; +-+ toLog = true; +-+ } +-+ } +-+ +-+ if(!tc->isRunning()) +-+ { +-+ if(started) +-+ { +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",DEACTIVATED" <getBytesLeft() == 0) +- { +-+ if(toLog && tmpLog) +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << 0 << "," << tc->getNumPeers() << ",FINISHED" << endl; +-+ toLog = false; +-+ +- setText(7,i18n("finished")); +- } +- else +-@@ -124,9 +164,16 @@ +- if( bytes_downloaded < 1 ) //if we just started download use old algorithm +- { +- if (tc->getDownloadRate() == 0) +-+ { +-+ if(toLog && tmpLog) +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << 0 << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl; +- setText(7,i18n("infinity")); +-+ } +- else +- { +-+ if(toLog && tmpLog) +-+ Out() << "{" << tc->getTorrentName() << "}," << QDateTime::currentDateTime().toTime_t() << "," << tc->getDownloadRate() << "," << tc->getBytesDownloaded() << "," << tc->getBytesLeft() << "," << tc->getNumPeers() << ",RUNNING" << endl; +-+ +- Uint32 secs = (int)floor( (float)tc->getBytesLeft() / (float)tc->getDownloadRate() ); +- QTime t; +- t = t.addSecs(secs); +-Index: apps/ktorrent/ktorrentviewitem.h +-=================================================================== +---- apps/ktorrent/ktorrentviewitem.h (revision 469614) +-+++ apps/ktorrent/ktorrentviewitem.h (working copy) +-@@ -41,6 +41,10 @@ +- void update(); +- +- private: +-+ bool toLog; +-+ int counter; +-+ bool started; +-+ uint start_timestamp; +- int compare(QListViewItem * i,int col,bool ascending) const; +- void paintCell(QPainter* p,const QColorGroup & cg,int column,int width,int align); +- +Index: apps/ktorrent/ktorrentviewitem.cpp +=================================================================== +--- apps/ktorrent/ktorrentviewitem.cpp (revision 472081) ++++ apps/ktorrent/ktorrentviewitem.cpp (working copy) +@@ -25,7 +25,10 @@ + #include + #include "ktorrentviewitem.h" + #include "functions.h" ++#include ++#include + ++ + using namespace bt; + using namespace kt; + +@@ -78,6 +81,9 @@ + KTorrentViewItem::KTorrentViewItem(QListView* parent,TorrentInterface* tc) + : KListViewItem(parent),tc(tc) + { ++ toLog = true; ++ counter = 1; ++ started = false; + update(); + } + +@@ -87,6 +93,7 @@ + + void KTorrentViewItem::update() + { ++ bool tmpLog = true; + /* + addColumn(i18n("File")); + addColumn(i18n("Status")); +@@ -114,8 +121,46 @@ + setText(6,KBytesPerSecToString(s.upload_rate / 1024.0)); + + KLocale* loc = KGlobal::locale(); ++ ++ ++ ++ if(counter==1) ++ { ++ if (s.running) ++ { ++ if(!started) ++ { ++ Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",ACTIVATED" << endl; ++ tmpLog = false; ++ started = true; ++ toLog = true; ++ } ++ } ++ ++ if(!s.running) ++ { ++ if(started) ++ { ++ Out() << "{" << s.torrent_name << "}," << QDateTime::currentDateTime().toTime_t() << "," << s.download_rate << "," << s.bytes_downloaded << "," << s.bytes_left << "," << s.num_peers << ",DEACTIVATED" <