1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-12 07:48:04 +00:00

Remove default argument from TorrentPersistentData::setAddedDate()

This commit is contained in:
Ivan Sorokin 2014-10-25 16:11:18 +04:00
parent 16eb407453
commit 8f0d49bb1b
2 changed files with 8 additions and 4 deletions

View File

@ -30,6 +30,7 @@
#include "torrentpersistentdata.h" #include "torrentpersistentdata.h"
#include <QDateTime>
#include <QDebug> #include <QDebug>
#include <QVariant> #include <QVariant>
@ -247,7 +248,7 @@ QDateTime TorrentPersistentData::getAddedDate(const QString &hash) {
const QHash<QString, QVariant> data = all_data.value(hash).toHash(); const QHash<QString, QVariant> data = all_data.value(hash).toHash();
QDateTime dt = data.value("add_date").toDateTime(); QDateTime dt = data.value("add_date").toDateTime();
if (!dt.isValid()) { if (!dt.isValid()) {
setAddedDate(hash); setAddedDate(hash, QDateTime::currentDateTime());
dt = QDateTime::currentDateTime(); dt = QDateTime::currentDateTime();
} }
return dt; return dt;
@ -312,7 +313,7 @@ void TorrentPersistentData::saveTorrentPersistentData(const QTorrentHandle &h, c
settings.setValue("torrents", all_data); settings.setValue("torrents", all_data);
qDebug("TorrentPersistentData: Saving save_path %s, hash: %s", qPrintable(h.save_path()), qPrintable(h.hash())); qDebug("TorrentPersistentData: Saving save_path %s, hash: %s", qPrintable(h.save_path()), qPrintable(h.hash()));
// Set Added date // Set Added date
setAddedDate(h.hash()); setAddedDate(h.hash(), QDateTime::currentDateTime());
// Finally, remove temp data // Finally, remove temp data
TorrentTempData::deleteTempData(h.hash()); TorrentTempData::deleteTempData(h.hash());
} }

View File

@ -31,11 +31,14 @@
#ifndef TORRENTPERSISTENTDATA_H #ifndef TORRENTPERSISTENTDATA_H
#define TORRENTPERSISTENTDATA_H #define TORRENTPERSISTENTDATA_H
#include <QDateTime>
#include <QHash> #include <QHash>
#include <QStringList> #include <QStringList>
#include <vector> #include <vector>
QT_BEGIN_NAMESPACE
class QDateTime;
QT_END_NAMESPACE
class QTorrentHandle; class QTorrentHandle;
class TorrentTempData { class TorrentTempData {
@ -119,7 +122,7 @@ public:
static void setRatioLimit(const QString &hash, const qreal &ratio); static void setRatioLimit(const QString &hash, const qreal &ratio);
static qreal getRatioLimit(const QString &hash); static qreal getRatioLimit(const QString &hash);
static bool hasPerTorrentRatioLimit() ; static bool hasPerTorrentRatioLimit() ;
static void setAddedDate(const QString &hash, const QDateTime &time = QDateTime::currentDateTime()); static void setAddedDate(const QString &hash, const QDateTime &time);
static QDateTime getAddedDate(const QString &hash); static QDateTime getAddedDate(const QString &hash);
static void setErrorState(const QString &hash, const bool has_error); static void setErrorState(const QString &hash, const bool has_error);
static bool hasError(const QString &hash); static bool hasError(const QString &hash);