]> granicus.if.org Git - transmission/commitdiff
(qt) #5252: disable file editing in the options dialog. remove keyboard shortcuts...
authorJordan Lee <jordan@transmissionbt.com>
Mon, 28 Jan 2013 07:01:58 +0000 (07:01 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Mon, 28 Jan 2013 07:01:58 +0000 (07:01 +0000)
qt/details.cc
qt/details.h
qt/file-tree.cc
qt/file-tree.h
qt/options.cc
qt/session.cc
qt/torrent.cc
qt/torrent.h

index b96847a182184dd93955c3765fa22da252a759c0..e59f13f6c7bf5c2761d05fe1ee70930396ad857e 100644 (file)
@@ -202,10 +202,8 @@ Details :: setIds (const QSet<int>& ids)
     // stop listening to the old torrents
     foreach (int id, myIds) {
         const Torrent * tor = myModel.getTorrentFromId (id);
-        if (tor) {
+        if (tor)
             disconnect (tor, SIGNAL (torrentChanged (int)), this, SLOT (onTorrentChanged ()));
-            disconnect (tor, SIGNAL (torrentFileListRebuilt (int)), this, SLOT (onTorrentFileListRebuilt ()));
-        }
     }
 
     myFileTreeView->clear ();
@@ -215,10 +213,8 @@ Details :: setIds (const QSet<int>& ids)
     // listen to the new torrents
     foreach (int id, myIds) {
         const Torrent * tor = myModel.getTorrentFromId (id);
-        if (tor) {
+        if (tor)
             connect (tor, SIGNAL (torrentChanged (int)), this, SLOT (onTorrentChanged ()));
-            connect (tor, SIGNAL (torrentFileListRebuilt (int)), this, SLOT (onTorrentFileListRebuilt ()));
-        }
     }
 
     foreach (QWidget * w, myWidgets)
@@ -299,13 +295,6 @@ Details :: onTorrentChanged ()
     }
 }
 
-void
-Details :: onTorrentFileListRebuilt ()
-{
-  myFilesDirty = true;
-  onTorrentChanged ();
-}
-
 namespace
 {
     void setIfIdle (QComboBox * box, int i)
@@ -840,12 +829,11 @@ Details :: refresh ()
     }
     myPeers = peers2;
 
-    if (!single || myFilesDirty)
+    if (!single)
         myFileTreeView->clear ();
     if (single)
-        myFileTreeView->update (torrents[0]->files () , myFilesDirty || myChangedTorrents);
+        myFileTreeView->update (torrents[0]->files (), myChangedTorrents);
 
-    myFilesDirty = false;
     myChangedTorrents = false;
     myHavePendingRefresh = false;
     foreach (QWidget * w, myWidgets)
index 077ed439a6196d88e79b8e536e1cb7fa163fa3bb..990ef34c3e60d03fc29566bb00d5fab0562a73d6 100644 (file)
@@ -49,7 +49,6 @@ class Details: public QDialog
 
   private slots:
     void onTorrentChanged ();
-    void onTorrentFileListRebuilt ();
     void onTimer ();
 
   public:
@@ -136,8 +135,6 @@ class Details: public QDialog
 
     FileTreeView * myFileTreeView;
 
-    bool myFilesDirty;
-
   private slots:
     void refreshPref (int key);
     void onBandwidthPriorityChanged (int);
index c8203361f8e2958538d889d439c09d2d50a48621..d2994a114a662f54ab1cbfaf997010d6aa5982af 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <cassert>
-#include <iostream>
 
 #include <QApplication>
 #include <QHeaderView>
 enum
 {
   COL_NAME,
+  FIRST_VISIBLE_COLUMN = COL_NAME,
   COL_PROGRESS,
   COL_WANTED,
   COL_PRIORITY,
+  LAST_VISIBLE_COLUMN = COL_PRIORITY,
+
+  COL_FILE_INDEX,
   NUM_COLUMNS
 };
 
@@ -41,7 +44,7 @@ enum
 *****
 ****/
 
-QHash<QString,int>&
+const QHash<QString,int>&
 FileTreeItem :: getMyChildRows ()
 {
   const size_t n = childCount();
@@ -114,7 +117,11 @@ FileTreeItem :: data (int column, int role) const
 {
   QVariant value;
 
-  if (role == Qt::EditRole)
+  if (column == COL_FILE_INDEX)
+    {
+      return myIndex;
+    }
+  else if (role == Qt::EditRole)
     {
       if (column == 0)
         value.setValue (name());
@@ -177,47 +184,48 @@ FileTreeItem :: fileSizeName () const
   return str;
 }
 
+#include <iostream>
+
 bool
-FileTreeItem :: update (int      index,
-                        bool     wanted,
-                        int      priority,
-                        uint64_t totalSize,
-                        uint64_t haveSize,
-                        bool     updateFields)
+FileTreeItem :: update (const QString& name,
+                        bool           wanted,
+                        int            priority,
+                        uint64_t       haveSize,
+                        bool           updateFields)
 {
   bool changed = false;
 
-std::cerr << __FILE__ << ':' << __LINE__ << " index " << index << " wanted " << wanted << " myIndex " << myIndex << " myWanted" << myIsWanted << std::endl;
-
-  if (myIndex != index)
+  if (myName != name)
     {
-      myIndex = index;
-      changed = true;
-    }
+      if (myParent)
+        myParent->myFirstUnhashedRow = row();
 
-  if (updateFields && myIsWanted != wanted)
-    {
-      myIsWanted = wanted;
+      myName = name;
       changed = true;
-std::cerr << __FILE__ << ':' << __LINE__ << " setting myIsWanted to " << myIsWanted << std::endl;
     }
 
-  if (updateFields && myPriority != priority)
+  if (fileIndex() != -1)
     {
-      myPriority = priority;
-      changed = true;
-    }
-
-  if (myTotalSize != totalSize)
-    {
-      myTotalSize = totalSize;
-      changed = true;
-    }
+      if (myHaveSize != haveSize)
+        {
+          myHaveSize = haveSize;
+          changed = true;
+        }
 
-  if (myHaveSize != haveSize)
-    {
-      myHaveSize = haveSize;
-      changed = true;
+      if (updateFields)
+        {
+          if (myIsWanted != wanted)
+            {
+              myIsWanted = wanted;
+              changed = true;
+            }
+
+          if (myPriority != priority)
+            {
+              myPriority = priority;
+              changed = true;
+            }
+        }
     }
 
   return changed;
@@ -288,7 +296,6 @@ FileTreeItem :: twiddlePriority (QSet<int>& ids, int& p)
     p = TR_PRI_HIGH;
   else
     p = TR_PRI_LOW;
-std::cerr << __FILE__ << ':' << __LINE__ << " twiddlePriority, p " << p << std::endl;
 
   setSubtreePriority (p, ids);
 }
@@ -320,7 +327,6 @@ FileTreeItem :: isSubtreeWanted () const
 void
 FileTreeItem :: setSubtreeWanted (bool b, QSet<int>& ids)
 {
-std::cerr << __FILE__ << ':' << __LINE__ << " twiddleWanted, wanted " << b << std::endl;
   if (myIsWanted != b)
     {
       myIsWanted = b;
@@ -336,7 +342,6 @@ std::cerr << __FILE__ << ':' << __LINE__ << " twiddleWanted, wanted " << b << st
 void
 FileTreeItem :: twiddleWanted (QSet<int>& ids, bool& wanted)
 {
-std::cerr << __FILE__ << ':' << __LINE__ << " twiddleWanted" << std::endl;
   wanted = isSubtreeWanted() != Qt::Checked;
   setSubtreeWanted (wanted, ids);
 }
@@ -346,18 +351,18 @@ std::cerr << __FILE__ << ':' << __LINE__ << " twiddleWanted" << std::endl;
 ****
 ***/
 
-FileTreeModel :: FileTreeModel (QObject *parent):
-  QAbstractItemModel(parent)
+FileTreeModel :: FileTreeModel (QObject *parent, bool isEditable):
+  QAbstractItemModel(parent),
+  myRootItem (new FileTreeItem),
+  myIsEditable (isEditable)
 {
-  rootItem = new FileTreeItem(-1);
 }
 
 FileTreeModel :: ~FileTreeModel()
 {
-std::cerr << __FILE__ << ':' << __LINE__ << " dtor " << std::endl;
   clear();
 
-  delete rootItem;
+  delete myRootItem;
 }
 
 QVariant
@@ -379,7 +384,7 @@ FileTreeModel :: flags (const QModelIndex& index) const
 {
   int i(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
 
-  if(index.column() == COL_NAME)
+  if(myIsEditable && (index.column() == COL_NAME))
     i |= Qt::ItemIsEditable;
 
   if(index.column() == COL_WANTED)
@@ -452,14 +457,14 @@ FileTreeModel :: index (int row, int column, const QModelIndex& parent) const
 
   if (!hasIndex (row, column, parent))
     {
-      std::cerr << " I don't have this index " << std::endl;
+      qWarning ("I don't have this index");
     }
   else
     {
       FileTreeItem * parentItem;
 
       if(!parent.isValid())
-        parentItem = rootItem;
+        parentItem = myRootItem;
       else
         parentItem = static_cast<FileTreeItem*>(parent.internalPointer());
 
@@ -495,7 +500,7 @@ FileTreeModel :: rowCount (const QModelIndex& parent) const
   FileTreeItem * parentItem;
 
   if (!parent.isValid())
-    parentItem = rootItem;
+    parentItem = myRootItem;
   else
     parentItem = static_cast<FileTreeItem*>(parent.internalPointer());
 
@@ -507,13 +512,13 @@ FileTreeModel :: columnCount (const QModelIndex &parent) const
 {
   Q_UNUSED(parent);
 
-  return 4;
+  return NUM_COLUMNS;
 }
 
 QModelIndex
 FileTreeModel :: indexOf (FileTreeItem * item, int column) const
 {
-  if (!item || item==rootItem)
+  if (!item || item==myRootItem)
     return QModelIndex();
 
   return createIndex(item->row(), column, item);
@@ -523,7 +528,6 @@ void
 FileTreeModel :: clearSubtree (const QModelIndex& top)
 {
   size_t i = rowCount (top);
-std::cerr << __FILE__ << ':' << __LINE__ << " clearSubtree " << i << std::endl;
 
   while (i > 0)
     clearSubtree(index(--i, 0, top));
@@ -534,47 +538,98 @@ std::cerr << __FILE__ << ':' << __LINE__ << " clearSubtree " << i << std::endl;
 void
 FileTreeModel :: clear ()
 {
-std::cerr << __FILE__ << ':' << __LINE__ << " clear"  << std::endl;
   clearSubtree (QModelIndex());
 
   reset ();
 }
 
+FileTreeItem *
+FileTreeModel :: findItemForFileIndex (int fileIndex) const
+{
+  FileTreeItem * ret = 0;
+
+  QModelIndexList indices = match (index (0,COL_FILE_INDEX),
+                                   Qt::DisplayRole,
+                                   fileIndex,
+                                   1,
+                                   Qt::MatchFlags (Qt::MatchExactly | Qt::MatchRecursive));
+
+  if (!indices.isEmpty ())
+    {
+      QModelIndex& index = indices.front ();
+      if (index.isValid())
+        ret = static_cast<FileTreeItem*>(index.internalPointer());
+    }
+
+  return ret;
+}
+
+void
+FileTreeModel :: itemChanged (FileTreeItem * item)
+{
+  dataChanged (indexOf(item, FIRST_VISIBLE_COLUMN), indexOf(item, LAST_VISIBLE_COLUMN));
+}
+
 void
-FileTreeModel :: addFile (int                   index,
+FileTreeModel :: addFile (int                   fileIndex,
                           const QString       & filename,
                           bool                  wanted,
                           int                   priority,
-                          uint64_t              size,
+                          uint64_t              totalSize,
                           uint64_t              have,
                           QList<QModelIndex>  & rowsAdded,
                           bool                  updateFields)
 {
   bool added = false;
-  FileTreeItem * i (rootItem);
+  FileTreeItem * item;
+  QStringList tokens = filename.split (QChar::fromAscii('/'));
+
+  item = findItemForFileIndex (fileIndex);
 
-  foreach (QString token, filename.split (QChar::fromAscii('/')))
+  if (item) // this file is already in the tree, we've added this 
     {
-      FileTreeItem * child(i->child(token));
-      if (!child)
+      while (!tokens.isEmpty())
         {
-          added = true;
-          QModelIndex parentIndex (indexOf(i, 0));
-          const int n (i->childCount());
-          beginInsertRows (parentIndex, n, n);
-          i->appendChild ((child = new FileTreeItem(-1, token)));
-          endInsertRows ();
-          rowsAdded.append (indexOf(child, 0));
+          const QString token = tokens.takeLast();
+          if (item->update (token, wanted, priority, have, updateFields))
+            itemChanged (item);
+          item = item->parent();
         }
-      i = child;
+      assert (item == myRootItem);
     }
-
-  if (i != rootItem)
+  else // we haven't build the FileTreeItems for these tokens yet
     {
-      if (i->update (index, wanted, priority, size, have, added || updateFields))
+      item = myRootItem;
+      while (!tokens.isEmpty())
+        {
+          const QString token = tokens.takeFirst();
+          FileTreeItem * child(item->child(token));
+          if (!child)
+            {
+              added = true;
+              QModelIndex parentIndex (indexOf(item, 0));
+              const int n (item->childCount());
+
+              beginInsertRows (parentIndex, n, n);
+              if (tokens.isEmpty())
+                child = new FileTreeItem (token, fileIndex, totalSize);
+              else
+                child = new FileTreeItem (token);
+              item->appendChild (child);
+              endInsertRows ();
+
+              rowsAdded.append (indexOf(child, 0));
+            }
+          item = child;
+        }
+
+      if (item != myRootItem)
         {
-          std::cerr << __FILE__ << ':' << __LINE__ << " emitting dataChanged for row " << i << std::endl;
-          dataChanged (indexOf(i, 0), indexOf(i, NUM_COLUMNS-1));
+          assert (item->fileIndex() == fileIndex);
+          assert (item->totalSize() == totalSize);
+
+          if (item->update (item->name(), wanted, priority, have, added || updateFields))
+            itemChanged (item);
         }
     }
 }
@@ -637,7 +692,6 @@ FileTreeModel :: clicked (const QModelIndex& index)
       QSet<int> file_ids;
       FileTreeItem * item;
 
-std::cerr << "clicked in COL_PRIORITY" << std::endl;
       item = static_cast<FileTreeItem*>(index.internalPointer());
       item->twiddlePriority (file_ids, priority);
       emit priorityChanged (file_ids, priority);
@@ -775,9 +829,9 @@ FileTreeDelegate :: paint (QPainter                    * painter,
 *****
 ****/
 
-FileTreeView :: FileTreeView (QWidget * parent):
+FileTreeView :: FileTreeView (QWidget * parent, bool isEditable):
   QTreeView (parent),
-  myModel (this),
+  myModel (this, isEditable),
   myProxy (new QSortFilterProxyModel()),
   myDelegate (this)
 {
@@ -792,7 +846,7 @@ FileTreeView :: FileTreeView (QWidget * parent):
   sortByColumn (COL_NAME, Qt::AscendingOrder);
   installEventFilter (this);
 
-  for (int i=0; i<NUM_COLUMNS; ++i)
+  for (int i=FIRST_VISIBLE_COLUMN; i<=LAST_VISIBLE_COLUMN; ++i)
     header()->setResizeMode(i, QHeaderView::Interactive);
 
   connect (this, SIGNAL(clicked(const QModelIndex&)),
@@ -817,29 +871,24 @@ void
 FileTreeView :: onClicked (const QModelIndex& proxyIndex)
 {
   const QModelIndex modelIndex = myProxy->mapToSource (proxyIndex);
-std::cerr << __FILE__ << ':' << __LINE__ << " calling myModel.clicked()" << std::endl;
   myModel.clicked (modelIndex);
 }
 
 bool
 FileTreeView :: eventFilter (QObject * o, QEvent * event)
 {
-  if (o != this)
-    return false;
-
   // this is kind of a hack to get the last three columns be the
   // right size, and to have the filename column use whatever
   // space is left over...
-  if (event->type() == QEvent::Resize)
+  if ((o == this) && (event->type() == QEvent::Resize))
     {
       QResizeEvent * r = dynamic_cast<QResizeEvent*>(event);
       int left = r->size().width();
       const QFontMetrics fontMetrics(font());
-      for (int column=0; column<NUM_COLUMNS; ++column)
+      for (int column=FIRST_VISIBLE_COLUMN; column<=LAST_VISIBLE_COLUMN; ++column)
         {
           if (column == COL_NAME)
             continue;
-
           if (isColumnHidden (column))
             continue;
 
@@ -850,32 +899,7 @@ FileTreeView :: eventFilter (QObject * o, QEvent * event)
         }
       left -= 20; // not sure why this is necessary.  it works in different themes + font sizes though...
       setColumnWidth(COL_NAME, std::max(left,0));
-      return false;
-    }
-
-#if 0
-  // handle using the keyboard to toggle the
-  // wanted/unwanted state or the file priority
-  else if (event->type() == QEvent::KeyPress)
-    {
-std::cerr << __FILE__ << ':' << __LINE__ << " " << qPrintable(dynamic_cast<QKeyEvent*>(event)->text()) << std::endl;
-      switch(dynamic_cast<QKeyEvent*>(event)->key())
-        {
-          case Qt::Key_Space:
-            std::cerr << __FILE__ << ':' << __LINE__ << " calling COL_WANTED.clicked()" << std::endl;
-            foreach (QModelIndex i, selectionModel()->selectedRows(COL_WANTED))
-              clicked (i);
-            return false;
-
-          case Qt::Key_Enter:
-          case Qt::Key_Return:
-            std::cerr << __FILE__ << ':' << __LINE__ << " calling COL_PRIORITY.clicked()" << std::endl;
-            foreach (QModelIndex i, selectionModel()->selectedRows(COL_PRIORITY))
-              clicked (i);
-            return false;
-        }
     }
-#endif
 
   return false;
 }
@@ -889,11 +913,9 @@ FileTreeView :: update (const FileList& files)
 void
 FileTreeView :: update (const FileList& files, bool updateFields)
 {
-std::cerr << "update updateFields " << updateFields << std::endl;
   foreach (const TrFile file, files)
     {
       QList<QModelIndex> added;
-std::cerr << __FILE__ << ':' << __LINE__ << " add file " << qPrintable(file.filename) << " wanted " << file.wanted << std::endl;
       myModel.addFile (file.index, file.filename, file.wanted, file.priority, file.size, file.have, added, updateFields);
       foreach (QModelIndex i, added)
         expand (myProxy->mapFromSource(i));
@@ -903,6 +925,5 @@ std::cerr << __FILE__ << ':' << __LINE__ << " add file " << qPrintable(file.file
 void
 FileTreeView :: clear ()
 {
-std::cerr << __FILE__ << ':' << __LINE__ << " clear" << std::endl;
   myModel.clear();
 }
index 0f1ddeae29519f911f1e15460f6287fd1f7cbb2e..98687fbedac90df66eb4274ccc4de41c79bba8e7 100644 (file)
@@ -43,14 +43,14 @@ class FileTreeItem: public QObject
 
     virtual ~FileTreeItem();
 
-    FileTreeItem (int fileIndex, const QString& name=""):
+    FileTreeItem (const QString& name="", int fileIndex=-1, uint64_t size=0):
       myIndex (fileIndex),
       myParent (0),
       myName (name),
       myPriority (0),
       myIsWanted (0),
       myHaveSize (0),
-      myTotalSize (0),
+      myTotalSize (size),
       myFirstUnhashedRow (0) { }
 
   public:
@@ -63,9 +63,13 @@ class FileTreeItem: public QObject
     int row () const;
     const QString& name () const { return myName; }
     QVariant data (int column, int role) const;
-    bool update (int index, bool want, int priority, uint64_t total, uint64_t have, bool updateFields);
+    bool update (const QString& name, bool want, int priority, uint64_t have, bool updateFields);
     void twiddleWanted (QSet<int>& fileIds, bool&);
     void twiddlePriority (QSet<int>& fileIds, int&);
+    int fileIndex () const { return myIndex; }
+    uint64_t totalSize () const { return myTotalSize; }
+    
+    
 
   private:
     void setSubtreePriority (int priority, QSet<int>& fileIds);
@@ -77,16 +81,16 @@ class FileTreeItem: public QObject
     int priority () const;
     int isSubtreeWanted () const;
 
-    int myIndex;
+    const int myIndex;
     FileTreeItem * myParent;
     QList<FileTreeItem*> myChildren;
     QHash<QString,int> myChildRows;
-    QHash<QString,int>& getMyChildRows();
-    const QString myName;
+    const QHash<QString,int>& getMyChildRows();
+    QString myName;
     int myPriority;
     bool myIsWanted;
     uint64_t myHaveSize;
-    uint64_t myTotalSize;
+    const uint64_t myTotalSize;
     size_t myFirstUnhashedRow;
 };
 
@@ -95,7 +99,7 @@ class FileTreeModel: public QAbstractItemModel
     Q_OBJECT
 
   public:
-    FileTreeModel (QObject *parent = 0);
+    FileTreeModel (QObject *parent = 0, bool isEditable = true);
     ~FileTreeModel ();
 
   public:
@@ -123,13 +127,18 @@ class FileTreeModel: public QAbstractItemModel
                   bool torrentChanged);
 
   private:
+    void itemChanged (FileTreeItem *);
     void clearSubtree (const QModelIndex &);
     QModelIndex indexOf (FileTreeItem *, int column) const;
     void parentsChanged (const QModelIndex &, int column);
     void subtreeChanged (const QModelIndex &, int column);
+    FileTreeItem * findItemForFileIndex (int fileIndex) const;
+
+
 
   private:
-    FileTreeItem * rootItem;
+    FileTreeItem * myRootItem;
+    const bool myIsEditable;
 
   public slots:
     void clicked (const QModelIndex & index);
@@ -153,7 +162,7 @@ class FileTreeView: public QTreeView
     Q_OBJECT
 
   public:
-    FileTreeView (QWidget * parent=0);
+    FileTreeView (QWidget * parent=0, bool editable=true);
     virtual ~FileTreeView ();
     void clear ();
     void update (const FileList& files);
index fe7e60a66e1d9dde7dcac0a20ee22d399eb8fafa..495c72f7162645a9f00ae2be7ced3215fa8312cb 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include <cstdio>
-#include <iostream>
 
 #include <QApplication>
 #include <QCheckBox>
@@ -139,7 +138,7 @@ Options :: Options( Session& session, const Prefs& prefs, const AddData& addme,
         l->setBuddy( e );
     }
 
-    myTree = new FileTreeView;
+    myTree = new FileTreeView (0, false);
     layout->addWidget( myTree, ++row, 0, 1, 2 );
     if( !session.isLocal( ) )
         myTree->hideColumn( 1 ); // hide the % done, since we've no way of knowing
@@ -358,7 +357,7 @@ Options :: onAccepted( )
         }
 
         default:
-            std::cerr << "unhandled AddData.type: " << myAdd.type << std::endl;
+            qWarning ("unhandled AddData.type: %d", myAdd.type);
     }
 
     // paused
@@ -403,7 +402,6 @@ Options :: onAccepted( )
     connect( &mySession, SIGNAL(executed(int64_t,const QString&, struct tr_variant*)),
              fileAdded, SLOT(executed(int64_t,const QString&, struct tr_variant*)));
 
-//std::cerr << tr_variantToStr(&top,TR_FMT_JSON,NULL) << std::endl;
     mySession.exec( &top );
 
     tr_variantFree( &top );
@@ -486,7 +484,6 @@ Options :: clearVerify( )
 void
 Options :: onVerify( )
 {
-    //std::cerr << "starting to verify..." << std::endl;
     clearVerify( );
     myVerifyFlags.insert( 0, myInfo.pieceCount, false );
     myVerifyTimer.setSingleShot( false );
@@ -512,7 +509,6 @@ Options :: onTimeout( )
     {
         const QFileInfo fileInfo( myDestination, QString::fromUtf8( file->name ) );
         myVerifyFile.setFileName( fileInfo.absoluteFilePath( ) );
-        //std::cerr << "opening file" << qPrintable(fileInfo.absoluteFilePath()) << std::endl;
         myVerifyFile.open( QIODevice::ReadOnly );
     }
 
@@ -560,7 +556,6 @@ Options :: onTimeout( )
 
     if( leftInFile == 0 )
     {
-        //std::cerr << "closing file" << std::endl;
         myVerifyFile.close( );
         ++myVerifyFileIndex;
         myVerifyFilePos = 0;
index 574399fc45257396f446220918bae37d55741729..3c0e8804ba1b1381bc810b4620b10722f4e65389 100644 (file)
@@ -824,7 +824,7 @@ Session :: parseResponse( const char * json, size_t jsonLength )
                     else if (tr_variantDictFindInt (args, TR_KEY_id, &id) && id)
                       {
                         // let's get the updated file list
-                        char * req = tr_strdup_printf ("{ \"arguments\": { \"fields\": [ \"files\", \"id\", \"name\" ], \"ids\": %d }, \"method\": \"torrent-get\", \"tag\": %d }",
+                        char * req = tr_strdup_printf ("{ \"arguments\": { \"fields\": [ \"fileStats\", \"files\", \"id\", \"name\" ], \"ids\": %d }, \"method\": \"torrent-get\", \"tag\": %d }",
                                                        int(id),
                                                        int(TAG_SOME_TORRENTS));
                         exec (req);
index 46ccec6f5c32c6414c51628812522216819b9c6b..10456262de8d73d8651ec914e8221d99c47a7498 100644 (file)
@@ -572,7 +572,6 @@ Torrent :: update (tr_variant * d)
 
       updateMimeIcon ();
       changed = true;
-      emit torrentFileListRebuilt (id ());
     }
 
   if (tr_variantDictFindList (d, TR_KEY_fileStats, &files))
index 1542f8e2e4a6c0cee37855f3ec7748ee13a14fe6..792f12be2e0325abc156395d8b68886e75b3c90f 100644 (file)
@@ -187,7 +187,6 @@ class Torrent: public QObject
     signals:
         void torrentChanged( int id );
         void torrentCompleted( int id );
-        void torrentFileListRebuilt( int id );
 
     private: