Changeset calitko,135 for calitko
- Timestamp:
- 07/27/07 00:15:15 (1 year ago)
- branch-nick:
- calitko
- Files:
-
- calitko/Gnutella/Bootstrapping/ConnectionKeeper.h (modified) (1 diff)
- calitko/Gnutella/Bootstrapping/NodeCache.h (modified) (2 diffs)
- calitko/Gnutella/Bootstrapping/UdpHostCache.h (modified) (1 diff)
- calitko/Gnutella/Handshaking/Handshaker.h (modified) (1 diff)
- calitko/Gnutella/Handshaking/SlotAllocator.h (modified) (1 diff)
- calitko/Gnutella/LocalPeer.h (modified) (1 diff)
- calitko/Gnutella/PacketProcessing/DynamicSearching/DynamicSearcher.h (modified) (1 diff)
- calitko/Gnutella/PacketProcessing/PacketProcessor.h (modified) (1 diff)
- calitko/Gnutella/PacketProcessing/PacketSession.h (modified) (1 diff)
- calitko/Gnutella/PacketProcessing/PongCache.h (modified) (1 diff)
- calitko/Gnutella/PacketProcessing/QueryRouting/QrtExchanger.h (modified) (1 diff)
- calitko/Gnutella/PacketProcessing/QueryRouting/QrtReader.h (modified) (1 diff)
- calitko/Gnutella/PacketProcessing/QueryRouting/QrtWriter.h (modified) (1 diff)
- calitko/Gnutella/Packets/Extensions/Extension.h (modified) (2 diffs)
- calitko/Gnutella/Packets/QueryHits.h (modified) (1 diff)
- calitko/Gnutella/Searching/Searcher.h (modified) (1 diff)
- calitko/Protocols/BitTorrent/Bencoding/BDecoder.h (modified) (2 diffs)
- calitko/Protocols/BitTorrent/Bencoding/BDictionary.h (modified) (1 diff)
- calitko/Protocols/Generics/FifoQueue.cpp (modified) (1 diff)
- calitko/Protocols/Generics/FifoQueue.h (modified) (1 diff)
- calitko/Protocols/Generics/GenericSession.h (modified) (1 diff)
- calitko/Protocols/Generics/PacketBase.h (modified) (1 diff)
- calitko/Protocols/Generics/PacketSerializer.h (modified) (1 diff)
- calitko/Protocols/Gnutella/Packets/QueryHits.h (modified) (2 diffs)
- calitko/Protocols/Transports/TcpConnection.h (modified) (1 diff)
- calitko/Protocols/Transports/UdpSwitch.h (modified) (1 diff)
- calitko/Qt.h (modified) (1 diff)
- calitko/UIs/Searching/SearchModel.cpp (modified) (3 diffs)
- calitko/UIs/Searching/SearchModel.h (modified) (5 diffs)
- calitko/Utils/CalitkoMocks/BoundFunction.h (modified) (1 diff)
- calitko/Utils/CalitkoMocks/ExpectedFunction.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
calitko/Gnutella/Bootstrapping/ConnectionKeeper.h
r115 r135 39 39 { 40 40 Q_OBJECT 41 REFERENCE_OBJECT (ConnectionKeeper) 41 42 42 43 public: calitko/Gnutella/Bootstrapping/NodeCache.h
r115 r135 37 37 { 38 38 Q_OBJECT 39 REFERENCE_OBJECT (NodeCache) 39 40 40 41 public: … … 105 106 PredicateImp predicateImp (pred); 106 107 107 return getNodes (count, availability, freshNodes, (const Predicate &)predicateImp);108 return getNodes (count, availability, freshNodes, predicateImp); 108 109 } 109 110 calitko/Gnutella/Bootstrapping/UdpHostCache.h
r115 r135 42 42 { 43 43 Q_OBJECT 44 REFERENCE_OBJECT (UdpHostCache) 44 45 45 46 public: calitko/Gnutella/Handshaking/Handshaker.h
r115 r135 37 37 { 38 38 Q_OBJECT 39 REFERENCE_OBJECT (Handshaker) 39 40 40 41 public: calitko/Gnutella/Handshaking/SlotAllocator.h
r123 r135 41 41 { 42 42 Q_OBJECT 43 REFERENCE_OBJECT (SlotAllocator) 43 44 44 45 public: calitko/Gnutella/LocalPeer.h
r115 r135 62 62 { 63 63 Q_OBJECT 64 REFERENCE_OBJECT (LocalPeer) 64 65 65 66 public: calitko/Gnutella/PacketProcessing/DynamicSearching/DynamicSearcher.h
r~117 r135 35 35 { 36 36 Q_OBJECT 37 REFERENCE_OBJECT (DynamicSearcher) 37 38 38 39 public: calitko/Gnutella/PacketProcessing/PacketProcessor.h
r115 r135 61 61 { 62 62 Q_OBJECT 63 REFERENCE_OBJECT (PacketProcessor) 63 64 64 65 public: calitko/Gnutella/PacketProcessing/PacketSession.h
r115 r135 46 46 { 47 47 Q_OBJECT 48 REFERENCE_OBJECT (PacketSession) 48 49 49 50 public: calitko/Gnutella/PacketProcessing/PongCache.h
r115 r135 59 59 { 60 60 Q_OBJECT 61 REFERENCE_OBJECT (PongCache) 61 62 62 63 public: calitko/Gnutella/PacketProcessing/QueryRouting/QrtExchanger.h
r115 r135 41 41 { 42 42 Q_OBJECT 43 REFERENCE_OBJECT (QrtExchanger) 43 44 44 45 public: calitko/Gnutella/PacketProcessing/QueryRouting/QrtReader.h
r115 r135 36 36 { 37 37 Q_OBJECT 38 REFERENCE_OBJECT (QrtReader) 38 39 39 40 public: calitko/Gnutella/PacketProcessing/QueryRouting/QrtWriter.h
r115 r135 35 35 class QrtWriter 36 36 { 37 REFERENCE_OBJECT (QrtWriter) 38 37 39 public: 38 40 QrtWriter (PacketSession *, quint8 patchEntryBits); calitko/Gnutella/Packets/Extensions/Extension.h
r~117 r135 38 38 { 39 39 public: 40 virtual ~Extension() {}40 virtual ~Extension() {} 41 41 virtual Extension * copy() const = 0; 42 42 … … 49 49 50 50 protected: 51 Extension() { isValid_ = true;}51 Extension() : isValid_ (true) {} 52 52 void setIsValid (bool isValid) { isValid_ = isValid; } 53 53 calitko/Gnutella/Packets/QueryHits.h
r115 r135 131 131 struct Result 132 132 { 133 Result() : fileIndex (0), fileSize (0), fullFileName(), resultData(), 134 fileNameSize (0) {} 135 133 136 quint32 fileIndex; //!< The file index result field. 134 137 quint32 fileSize; //!< The file size result field. calitko/Gnutella/Searching/Searcher.h
r115 r135 42 42 { 43 43 Q_OBJECT 44 REFERENCE_OBJECT (Searcher) 44 45 45 46 private: calitko/Protocols/BitTorrent/Bencoding/BDecoder.h
r134 r135 52 52 class BDecoder 53 53 { 54 REFERENCE_OBJECT (BDecoder) 55 54 56 public: 55 57 BDecoder (const QByteArray &rawData); … … 62 64 63 65 private: 64 BDecoder (const BDecoder &); // Forbid copying.65 BDecoder & operator= (const BDecoder &); // Forbid assignment.66 67 66 auto_ptr <BinaryReader> binaryReader; 68 67 }; calitko/Protocols/BitTorrent/Bencoding/BDictionary.h
r~118 r135 58 58 /*! 59 59 If there is a value to the given \a key it is returned. Otherwise 60 an error item is returned.60 an error item is returned. 61 61 */ 62 62 inline const BItem * BDictionary::item (const QByteArray &key) const calitko/Protocols/Generics/FifoQueue.cpp
r~120 r135 25 25 #include "Imports.cpp" 26 26 27 FifoQueue::FifoQueue() 28 : queue() 29 { 30 } 31 27 32 bool FifoQueue::isEmpty() const 28 33 { calitko/Protocols/Generics/FifoQueue.h
r~120 r135 35 35 class FifoQueue : public DataQueue 36 36 { 37 REFERENCE_OBJECT (FifoQueue) 38 37 39 public: 40 FifoQueue(); 41 38 42 bool isEmpty() const; 39 43 void enqueue (const Data &); calitko/Protocols/Generics/GenericSession.h
r134 r135 102 102 { 103 103 CALITKO_TESTABLE (GenericSession) 104 REFERENCE_OBJECT (GenericSession) 104 105 105 106 public: calitko/Protocols/Generics/PacketBase.h
r~120 r135 110 110 { 111 111 public: 112 Data() : rawHeader(), rawPayload(), rewriteHeader(), rewritePayload() {} 113 112 114 mutable QByteArray rawHeader; 113 115 mutable QByteArray rawPayload; calitko/Protocols/Generics/PacketSerializer.h
r~120 r135 43 43 { 44 44 CALITKO_TESTABLE (PacketSerializer) 45 REFERENCE_OBJECT (PacketSerializer) 45 46 46 47 public: calitko/Protocols/Gnutella/Packets/QueryHits.h
r~120 r135 62 62 63 63 protected: 64 // Unhide all overloads from the base class to avoid a compiler warning: 65 using PacketBase::readPayload; 66 using PacketBase::writePayload; 67 64 68 void readPayload (BinaryReader &); 65 69 void writePayload (BinaryWriter &) const; … … 74 78 75 79 public: 80 Data () : port(0), ipAddress(), speed (0), resultSet(), queryHitsData() 81 {} 82 76 83 quint16 port; 77 84 QHostAddress ipAddress; calitko/Protocols/Transports/TcpConnection.h
r~117 r135 32 32 { 33 33 Q_OBJECT 34 REFERENCE_OBJECT (TcpConnection) 34 35 35 36 public: calitko/Protocols/Transports/UdpSwitch.h
r~117 r135 45 45 { 46 46 Q_OBJECT 47 REFERENCE_OBJECT (UdpSwitch) 47 48 48 49 public: calitko/Qt.h
r126 r135 60 60 61 61 // Using long because on 64bit Linuxes long is 64bit and we normally cast a pointer to 62 // to a ConnectionId. This is just a temporary solution because under Win64 long is 62 // to a ConnectionId. This is just a temporary solution because under Win64 long is 63 63 // still 32 bit! 64 64 typedef long ConnectionId; // \todo Remove if not used anymore! 65 65 66 66 // These macros expand to forward declarations of types contained in namesapces: 67 #define FORWARD_DECLARE(ns,dec) \67 #define FORWARD_DECLARE(ns,dec) \ 68 68 namespace ns { dec; } 69 #define FORWARD_DECLARE2(ns1,ns2,dec) \69 #define FORWARD_DECLARE2(ns1,ns2,dec) \ 70 70 namespace ns1 { namespace ns2 { dec; }} 71 #define FORWARD_DECLARE3(ns1,ns2,ns3,dec) \71 #define FORWARD_DECLARE3(ns1,ns2,ns3,dec) \ 72 72 namespace ns1 { namespace ns2 { namespace ns3 { dec; }}} 73 #define FORWARD_DECLARE4(ns1,ns2,ns3,ns4,dec) \74 namespace ns1 { namespace ns2 { namespace ns3 { \73 #define FORWARD_DECLARE4(ns1,ns2,ns3,ns4,dec) \ 74 namespace ns1 { namespace ns2 { namespace ns3 { \ 75 75 namespace ns4 { dec; }}}} 76 #define FORWARD_DECLARE5(ns1,ns2,ns3,ns4,ns5,dec) \77 namespace ns1 { namespace ns2 { namespace ns3 { \76 #define FORWARD_DECLARE5(ns1,ns2,ns3,ns4,ns5,dec) \ 77 namespace ns1 { namespace ns2 { namespace ns3 { \ 78 78 namespace ns4 { namespace ns5 { dec; }}}}} 79 #define FORWARD_DECLARE6(ns1,ns2,ns3,ns4,ns5,ns6,dec) \80 namespace ns1 { namespace ns2 { namespace ns3 { \81 namespace ns4 { namespace ns5 { namespace ns6 { dec; }}}}}} ;82 #define FORWARD_DECLARE7(ns1,ns2,ns3,ns4,ns5,ns6,ns7,dec) \83 namespace ns1 { namespace ns2 { namespace ns3 { \84 namespace ns4 { namespace ns5 { namespace ns6 { \85 namespace ns7 { dec; }}}}}}} ;86 #define FORWARD_DECLARE8(ns1,ns2,ns3,ns4,ns5,ns6,ns7,ns8,dec) \87 namespace ns1 { namespace ns2 { namespace ns3 { \88 namespace ns4 { namespace ns5 { namespace ns6 { \89 namespace ns7 { namespace ns8 { dec; }}}}}}}} ;90 #define FORWARD_DECLARE9(ns1,ns2,ns3,ns4,ns5,ns6,ns7,ns8,ns9,dec) \91 namespace ns1 { namespace ns2 { namespace ns3 { \92 namespace ns4 { namespace ns5 { namespace ns6 { \93 namespace ns7 { namespace ns8 { namespace ns9 { \94 dec; }}}}}}}}} ;79 #define FORWARD_DECLARE6(ns1,ns2,ns3,ns4,ns5,ns6,dec) \ 80 namespace ns1 { namespace ns2 { namespace ns3 { \ 81 namespace ns4 { namespace ns5 { namespace ns6 { dec; }}}}}} 82 #define FORWARD_DECLARE7(ns1,ns2,ns3,ns4,ns5,ns6,ns7,dec) \ 83 namespace ns1 { namespace ns2 { namespace ns3 { \ 84 namespace ns4 { namespace ns5 { namespace ns6 { \ 85 namespace ns7 { dec; }}}}}}} 86 #define FORWARD_DECLARE8(ns1,ns2,ns3,ns4,ns5,ns6,ns7,ns8,dec) \ 87 namespace ns1 { namespace ns2 { namespace ns3 { \ 88 namespace ns4 { namespace ns5 { namespace ns6 { \ 89 namespace ns7 { namespace ns8 { dec; }}}}}}}} 90 #define FORWARD_DECLARE9(ns1,ns2,ns3,ns4,ns5,ns6,ns7,ns8,ns9,dec) \ 91 namespace ns1 { namespace ns2 { namespace ns3 { \ 92 namespace ns4 { namespace ns5 { namespace ns6 { \ 93 namespace ns7 { namespace ns8 { namespace ns9 { \ 94 dec; }}}}}}}}} 95 95 96 #define REFERENCE_OBJECT(Class) Class (const Class &); \ 97 Class & operator= (const Class &); 98 99 #define VALUE_OBJECT(Class) Class (const Class &); \ 100 Class & operator= (const Class &); \ 101 bool operator== (const Class &); \ 102 bool operator!= (const Class &); 103 104 #define STATIC_HELPER(Class) Class(); 96 105 97 106 #endif // QT_H calitko/UIs/Searching/SearchModel.cpp
r116 r135 120 120 121 121 resultList.insert (index, *result); 122 for (int i=0; i<resultList.at(index).hosts.count(); i++) { 123 // resultList.last().hosts.at(i).showEmphasized = !tabActive; 122 /* for (int i=0; i<resultList.at(index).hosts.count(); i++) { 124 123 resultList.at(index).hosts.at(i).parent = (SearchResult*) &resultList.at(index); 125 } 124 }*/ 126 125 127 126 endInsertRows(); … … 218 217 return createIndex (row, column, result); 219 218 } else { 220 result = static_cast <SearchResult*> (parent.internalPointer()); 219 Q_ASSERT (false); 220 /* result = static_cast <SearchResult*> (parent.internalPointer()); 221 221 Q_ASSERT(result); 222 222 if (row < result->hosts.count()) { 223 223 host = (SearchResult*) &result->hosts.at (row); 224 224 return createIndex (row, column, (void*) host); 225 } 225 }*/ 226 226 } 227 227 228 228 return QModelIndex(); 229 229 } 230 230 /* 231 231 QModelIndex SearchModel::parent ( const QModelIndex & index ) const 232 232 { … … 242 242 243 243 return QModelIndex(); 244 } 244 }*/ 245 245 246 246 QVariant SearchModel::headerData (int section, Qt::Orientation orientation, int role) const calitko/UIs/Searching/SearchModel.h
r113 r135 33 33 34 34 struct SearchResult { 35 SearchResult(const QString &fn, const QString &ext, const quint32 &sz, quint32 sp, QString ht, QString clt) 36 : fileName(fn), extension(ext), speed(QString()), 35 //! \todo Why these funny default values? 36 SearchResult(const QString &fn, const QString &ext, const quint32 &sz, quint32 sp, QString ht, QString clt) 37 : fileName(fn), extension(ext), speed(QString()), size (0), 37 38 rating("Good"), status("Available"), host(ht), 38 39 client(clt), duration("0:53:24"), 39 bitrate("8 bps"), parent(NULL), showEmphasized (false)40 bitrate("8 bps"), /*parent(NULL), */hosts(), showEmphasized (false) 40 41 { 41 42 float fz = sz; // B … … 65 66 speed = QString().sprintf ("%d kbps", sp); 66 67 } 68 }; 67 69 68 };69 70 QString fileName; 70 71 QString extension; … … 77 78 QString duration; 78 79 QString bitrate; 79 mutable SearchResult *parent;80 //mutable SearchResult *parent; // Can we get rid of that? 80 81 QList<SearchResult> hosts; 81 82 bool showEmphasized; … … 85 86 { 86 87 Q_OBJECT 88 REFERENCE_OBJECT (SearchModel) 87 89 88 90 public: … … 96 98 bool hasChildren (const QModelIndex &index) const; 97 99 QModelIndex index(int row, int column, const QModelIndex &parent) const; 98 QModelIndex parent ( const QModelIndex & index ) const;100 //QModelIndex parent ( const QModelIndex & index ) const; 99 101 void tabActivated(); 100 102 void tabDisactivated(); calitko/Utils/CalitkoMocks/BoundFunction.h
r134 r135 106 106 : public BoundFunctionBase \ 107 107 { \ 108 REFERENCE_OBJECT (BoundFunction) \ 108 109 public: \ 109 110 typedef BoundFunctionBase Base; \ calitko/Utils/CalitkoMocks/ExpectedFunction.h
r~120 r135 163 163 : public ExpectedFunctionBase \ 164 164 { \ 165 REFERENCE_OBJECT (ExpectedFunction) \ 165 166 public: \ 166 167 typedef ExpectedFunctionBase Base; \