Changeset 14379


Ignore:
Timestamp:
Dec 12, 2014, 11:52:17 PM (8 years ago)
Author:
mikedld
Message:

Fix various cppcheck comments for Qt client code

Location:
trunk/qt
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/app.cc

    r14377 r14379  
    309309
    310310void
    311 MyApp::onTorrentsAdded (QSet<int> torrents)
     311MyApp::onTorrentsAdded (const QSet<int>& torrents)
    312312{
    313313  if (!myPrefs->getBool (Prefs::SHOW_NOTIFICATION_ON_ADD))
  • trunk/qt/app.h

    r14272 r14379  
    5858    void refreshPref (int key);
    5959    void refreshTorrents ();
    60     void onTorrentsAdded (QSet<int>);
     60    void onTorrentsAdded (const QSet<int>& torrents);
    6161    void onTorrentCompleted (int);
    6262    void onNewTorrentChanged (int);
  • trunk/qt/details.cc

    r14377 r14379  
    9999    virtual ~PeerItem () {}
    100100
    101     PeerItem (const Peer& p)
    102     {
    103       peer = p;
     101    PeerItem (const Peer& p):
     102      peer(p)
     103    {
    104104      int q[4];
    105105      if (sscanf (p.address.toUtf8 ().constData (), "%d.%d.%d.%d", q+0, q+1, q+2, q+3) == 4)
     
    409409  // myHaveLabel
    410410  double sizeWhenDone = 0;
    411   double leftUntilDone = 0;
    412411  double available = 0;
    413   int64_t haveTotal = 0;
    414   int64_t haveVerified = 0;
    415   int64_t haveUnverified = 0;
    416   int64_t verifiedPieces = 0;
    417412  if (torrents.empty ())
    418413    {
     
    421416  else
    422417    {
     418      double leftUntilDone = 0;
     419      int64_t haveTotal = 0;
     420      int64_t haveVerified = 0;
     421      int64_t haveUnverified = 0;
     422      int64_t verifiedPieces = 0;
     423
    423424      foreach (const Torrent * t, torrents)
    424425        {
     
    842843        {
    843844          const QString key = idStr + ":" + peer.address;
    844           PeerItem * item = (PeerItem*) myPeers.value (key, 0);
     845          PeerItem * item = static_cast<PeerItem*> (myPeers.value (key, 0));
    845846
    846847          if (item == 0) // new peer has connected
  • trunk/qt/file-tree.cc

    r14377 r14379  
    624624                        bool                  updateFields)
    625625{
    626   bool added = false;
    627626  FileTreeItem * item;
    628627  QStringList tokens = filename.split (QChar::fromLatin1('/'));
     
    652651  else // we haven't build the FileTreeItems for these tokens yet
    653652    {
     653      bool added = false;
     654
    654655      item = myRootItem;
    655656      while (!tokens.isEmpty())
  • trunk/qt/filterbar.cc

    r14377 r14379  
    286286namespace
    287287{
    288   QString readableHostName (const QString host)
     288  QString readableHostName (const QString& host)
    289289  {
    290290    // get the readable name...
  • trunk/qt/mainwin.cc

    r14377 r14379  
    14131413
    14141414void
    1415 TrMainWindow::errorMessage (const QString msg)
     1415TrMainWindow::errorMessage (const QString& msg)
    14161416{
    14171417    myErrorMessage = msg;
  • trunk/qt/mainwin.h

    r14241 r14379  
    122122    void dataSendProgress ();
    123123    void onError (QNetworkReply::NetworkError);
    124     void errorMessage (const QString);
     124    void errorMessage (const QString&);
    125125    void toggleWindows (bool doShow);
    126126    void onSetPrefs ();
  • trunk/qt/torrent-model.cc

    r14377 r14379  
    144144  QSet<int> addIds;
    145145  QSet<int> newIds;
    146   int updatedCount = 0;
    147146
    148147  if  (isCompleteList)
     
    173172                {
    174173                  tor->update (child);
    175                   ++updatedCount;
    176174                  if (tor->isMagnet() && tor->hasMetadata())
    177175                    {
Note: See TracChangeset for help on using the changeset viewer.