1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 14:10:34 +00:00
transmission/qt/WatchDir.h
Charles Kerr 070a7f2ffc
refactor: use snake_case field naming in qt client (#1262)
* refactor: use snake_case field naming in qt client

* fix: some missed symbols

* chore: make uncrustify happy

* fixup! refactor: use snake_case field naming in qt client
2020-05-27 16:53:12 -05:00

53 lines
884 B
C++

/*
* This file Copyright (C) 2009-2015 Mnemosyne LLC
*
* It may be used under the GNU GPL versions 2 or 3
* or any future license endorsed by Mnemosyne LLC.
*
*/
#pragma once
#include <QObject>
#include <QSet>
#include <QString>
class QFileSystemWatcher;
class TorrentModel;
class WatchDir : public QObject
{
Q_OBJECT
public:
WatchDir(TorrentModel const&);
void setPath(QString const& path, bool is_enabled);
signals:
void torrentFileAdded(QString const& filename);
private:
enum
{
OK,
DUPLICATE,
ERROR
};
private:
int metainfoTest(QString const& filename) const;
private slots:
void watcherActivated(QString const& path);
void onTimeout();
void rescanAllWatchedDirectories();
private:
TorrentModel const& model_;
QSet<QString> watch_dir_files_;
QFileSystemWatcher* watcher_ = {};
};