+class TorrentsStorage
+{
+public:
+
+ TorrentsStorage(ServerDb &db)
+ : torrents_("SELECT hash, path, savepath from torrents") { }
+
+
+ bool nextTorrent(TorrentDownloadInfo &info) {
+ if (!torrents_.next()) {
+ return false;
+ }
+ info.hash = torrents_.value(0).toString();
+ info.path = torrents_.value(1).toString();
+ info.download_path = torrents_.value(2).toString();
+ return true;
+ }
+
+
+private:
+ QSqlQuery torrents_;
+};
+