Added Q_FUNC_INFO macros to some functions.
[qtrapids] / src / engine / QTorrentHandle.cpp
index b1f426a..677341e 100644 (file)
@@ -1,11 +1,9 @@
 /***************************************************************************
- *   Copyright (C) 2009 by Lassi Väätämöinen   *
- *   lassi.vaatamoinen@ixonos.com   *
+ *   Copyright (C) 2010 by Ixonos Plc   *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
+ *   the Free Software Foundation; version 2 of the License.               *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
 #include "QTorrentHandle.h"
 
-namespace qtrapids {
+namespace qtrapids
+{
+
 
-       
-QTorrentHandle::QTorrentHandle(libtorrent::torrent_handle handle) : 
+QTorrentHandle::QTorrentHandle(libtorrent::torrent_handle handle) :
                torrentHandle_(handle)
 {
 }
@@ -68,26 +67,26 @@ size_t QTorrentHandle::getTotalSize() const
 QTorrentHandle::State QTorrentHandle::state() const
 {
        TorrentStatus statusTmp = status();
-       
-               switch (statusTmp.state) {
-               case TorrentStatus::queued_for_checking :
-                       return QTorrentHandle::QUEUED_FOR_CHECKING;
-               case TorrentStatus::checking_files :
-                       return QTorrentHandle::CHECKING_FILES;
-               case TorrentStatus::downloading_metadata :
-                       return QTorrentHandle::DOWNLOADING_METADATA;
-               case TorrentStatus::downloading :
-                       return QTorrentHandle::DOWNLOADING;
-               case TorrentStatus::finished :
-                       return QTorrentHandle::FINISHED;
-               case TorrentStatus::seeding :
-                       return QTorrentHandle::SEEDING; 
-               case TorrentStatus::allocating :
-                       return QTorrentHandle::ALLOCATING;
-               default:
-                       return QTorrentHandle::UNSPECIFIED;
+
+       switch (statusTmp.state) {
+       case TorrentStatus::queued_for_checking :
+               return QTorrentHandle::QUEUED_FOR_CHECKING;
+       case TorrentStatus::checking_files :
+               return QTorrentHandle::CHECKING_FILES;
+       case TorrentStatus::downloading_metadata :
+               return QTorrentHandle::DOWNLOADING_METADATA;
+       case TorrentStatus::downloading :
+               return QTorrentHandle::DOWNLOADING;
+       case TorrentStatus::finished :
+               return QTorrentHandle::FINISHED;
+       case TorrentStatus::seeding :
+               return QTorrentHandle::SEEDING;
+       case TorrentStatus::allocating :
+               return QTorrentHandle::ALLOCATING;
+       default:
+               return QTorrentHandle::UNSPECIFIED;
        }
-       
+
 }
 
 
@@ -128,13 +127,13 @@ qint32 QTorrentHandle::numLeeches() const
 qint32 QTorrentHandle::ratio() const
 {
        TorrentStatus statusTmp = status();
-       size_t ratio; 
+       size_t ratio;
        if (statusTmp.total_payload_download == 0) {
                ratio = 0;
        } else {
                ratio = static_cast<size_t> (statusTmp.total_payload_upload / statusTmp.total_payload_download);
        }
-       
+
        return ratio;
 }
 
@@ -159,4 +158,3 @@ bool QTorrentHandle::operator<(QTorrentHandle const& h) const
 } // namespace qtrapids
 
 
-                               
\ No newline at end of file