Changeset 14349 for trunk/qt/session.h


Ignore:
Timestamp:
Dec 1, 2014, 7:24:07 PM (8 years ago)
Author:
mikedld
Message:

#5077: Remove torrent file from watch directory even if "show options dialog" is not set (patch from rb07 + some improvements)

Refactor Session::addTorrent (add new method) to eliminate duplicate
code in options.cc and ensure that FileAdded? object is being created
on torrent addition even with non-interactive workflow.
Move FileAdded? class from options.{h,cc} to session.{h,cc}.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/session.h

    r14241 r14349  
    3535
    3636class Prefs;
     37
     38class FileAdded: public QObject
     39{
     40    Q_OBJECT
     41
     42  public:
     43    FileAdded (int tag, const QString& name): myTag (tag), myName (name) {}
     44    ~FileAdded () {}
     45    void setFileToDelete (const QString& file) { myDelFile = file; }
     46
     47  public slots:
     48    void executed (int64_t tag, const QString& result, struct tr_variant * arguments);
     49
     50  private:
     51    const int64_t myTag;
     52    const QString myName;
     53    QString myDelFile;
     54};
    3755
    3856class Session: public QObject
     
    102120    void torrentSetLocation (const QSet<int>& ids, const QString& path, bool doMove);
    103121    void torrentRenamePath (const QSet<int>& ids, const QString& oldpath, const QString& newname);
     122    void addTorrent (const AddData& addme, tr_variant& top, bool trashOriginal);
    104123
    105124  public slots:
Note: See TracChangeset for help on using the changeset viewer.