Opened 10 years ago

Closed 8 years ago

#5077 closed Bug (fixed)

Remove .torrent doesn't work on watchdir

Reported by: rb07 Owned by: mike.dld
Priority: Normal Milestone: 2.90
Component: Qt Client Version: 2.71
Severity: Normal Keywords: watchdir
Cc:

Description

The preference setting doesn't have the effect expected when the options panel is not used.

The remove .torrent file logic is all in the Options and FileAdded? classes, the signal 'executed' is probably sent from Session, but there is no FileAdded? object to catch it.

To test:

  • Preference "auto. add torrents from" enabled and set.
  • Preference "remove .torrent" set.
  • Preference "start when added" set.
  • Preference "show options dialog" not set.

Add a .torrent file to the watch directory.

Result: torrent is added, but the file is not deleted.

Attachments (3)

011-delete-torrent-on-watchdir.patch (2.2 KB) - added by rb07 10 years ago.
014-delete-torrent-on-watchdir.patch (1.6 KB) - added by rb07 10 years ago.
Change pushed into Session
012-delete-torrent-on-watchdir.patch (1.2 KB) - added by rb07 10 years ago.
Compact and optimized.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 10 years ago by rb07

Fixed with the attached patch.

Corrections to the description:

  • This is with a local session.
  • The "start when added" preference is irrelevant.

Changed 10 years ago by rb07

comment:2 Changed 10 years ago by rb07

Hold on, I seem to have broken all .torrent file deletions, except those on the watchdir.

comment:3 Changed 10 years ago by rb07

Nope, I didn't break anything, its the same bug I was fixing but in a different place (TrMainWindow::addTorrent with no Options panel has no FileAdded object to do the removing).

I'll post a new patch (fixing both bugs) later, after I test the changes.

comment:4 Changed 10 years ago by jordan

rb07, the new code in app.cc and mainwin.cc look very similar to each other and to the code in options.cc, at least superficially. Do you think it make sense to extract any of it into a standalone function that all three blocks could use?

comment:5 Changed 10 years ago by rb07

Jordan, Yes (I even copied the comment ;-), I was thinking along the same line, maybe push the functionality into the Session class?

I don't think it is straightforward, but looks like it could be the common point in the execution flow (only Options goes directly to libtransmission, doing something very similar to Session::addTorrent, but with more parameters sent... and I already started by adding the tag parameter).

Last edited 10 years ago by rb07 (previous) (diff)

comment:6 follow-up: Changed 10 years ago by jordan

Session is probably the right place for this. Do you want to take the first shot at it? :)

Changed 10 years ago by rb07

Change pushed into Session

comment:7 in reply to: ↑ 6 Changed 10 years ago by rb07

Replying to jordan:

Session is probably the right place for this. Do you want to take the first shot at it? :)

Done.

Changed 10 years ago by rb07

Compact and optimized.

comment:8 Changed 8 years ago by mike.dld

  • Owner changed from jordan to mike.dld
  • Status changed from new to assigned

comment:9 Changed 8 years ago by mike.dld

  • Milestone changed from None Set to 2.90
  • Resolution set to fixed
  • Status changed from assigned to closed

Thanks, committed as r14349. Some modifications were required though (things changed in 2 years) and I optimized it a bit as well.

Note: See TracTickets for help on using tickets.