Change int to qint64
This commit is contained in:
@@ -55,7 +55,7 @@ inline void AddMetadata(const QString &key, const QDateTime &metadata, QVariantM
|
|||||||
if (metadata.isValid()) (*map)[key] = metadata;
|
if (metadata.isValid()) (*map)[key] = metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QString AsMPRISDateTimeType(const int time) {
|
inline QString AsMPRISDateTimeType(const qint64 time) {
|
||||||
return time != -1 ? QDateTime::fromSecsSinceEpoch(time).toString(Qt::ISODate) : "";
|
return time != -1 ? QDateTime::fromSecsSinceEpoch(time).toString(Qt::ISODate) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ qint64 Song::ctime() const { return d->ctime_; }
|
|||||||
|
|
||||||
int Song::playcount() const { return d->playcount_; }
|
int Song::playcount() const { return d->playcount_; }
|
||||||
int Song::skipcount() const { return d->skipcount_; }
|
int Song::skipcount() const { return d->skipcount_; }
|
||||||
int Song::lastplayed() const { return d->lastplayed_; }
|
qint64 Song::lastplayed() const { return d->lastplayed_; }
|
||||||
|
|
||||||
bool Song::compilation_detected() const { return d->compilation_detected_; }
|
bool Song::compilation_detected() const { return d->compilation_detected_; }
|
||||||
bool Song::compilation_off() const { return d->compilation_off_; }
|
bool Song::compilation_off() const { return d->compilation_off_; }
|
||||||
@@ -441,7 +441,7 @@ void Song::set_unavailable(bool v) { d->unavailable_ = v; }
|
|||||||
|
|
||||||
void Song::set_playcount(int v) { d->playcount_ = v; }
|
void Song::set_playcount(int v) { d->playcount_ = v; }
|
||||||
void Song::set_skipcount(int v) { d->skipcount_ = v; }
|
void Song::set_skipcount(int v) { d->skipcount_ = v; }
|
||||||
void Song::set_lastplayed(int v) { d->lastplayed_ = v; }
|
void Song::set_lastplayed(qint64 v) { d->lastplayed_ = v; }
|
||||||
|
|
||||||
void Song::set_compilation_detected(bool v) { d->compilation_detected_ = v; }
|
void Song::set_compilation_detected(bool v) { d->compilation_detected_ = v; }
|
||||||
void Song::set_compilation_on(bool v) { d->compilation_on_ = v; }
|
void Song::set_compilation_on(bool v) { d->compilation_on_ = v; }
|
||||||
@@ -958,7 +958,7 @@ void Song::InitFromQuery(const SqlRow &q, bool reliable_metadata, int col) {
|
|||||||
d->skipcount_ = q.value(x).isNull() ? 0 : q.value(x).toInt();
|
d->skipcount_ = q.value(x).isNull() ? 0 : q.value(x).toInt();
|
||||||
}
|
}
|
||||||
else if (Song::kColumns.value(i) == "lastplayed") {
|
else if (Song::kColumns.value(i) == "lastplayed") {
|
||||||
d->lastplayed_ = toint(x);
|
d->lastplayed_ = tolonglong(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (Song::kColumns.value(i) == "compilation_detected") {
|
else if (Song::kColumns.value(i) == "compilation_detected") {
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ class Song {
|
|||||||
|
|
||||||
int playcount() const;
|
int playcount() const;
|
||||||
int skipcount() const;
|
int skipcount() const;
|
||||||
int lastplayed() const;
|
qint64 lastplayed() const;
|
||||||
|
|
||||||
bool compilation_detected() const;
|
bool compilation_detected() const;
|
||||||
bool compilation_off() const;
|
bool compilation_off() const;
|
||||||
@@ -337,7 +337,7 @@ class Song {
|
|||||||
|
|
||||||
void set_playcount(int v);
|
void set_playcount(int v);
|
||||||
void set_skipcount(int v);
|
void set_skipcount(int v);
|
||||||
void set_lastplayed(int v);
|
void set_lastplayed(qint64 v);
|
||||||
|
|
||||||
void set_compilation_detected(bool v);
|
void set_compilation_detected(bool v);
|
||||||
void set_compilation_on(bool v);
|
void set_compilation_on(bool v);
|
||||||
|
|||||||
@@ -152,11 +152,11 @@ QString WordyTimeNanosec(qint64 nanoseconds) {
|
|||||||
return WordyTime(nanoseconds / kNsecPerSec);
|
return WordyTime(nanoseconds / kNsecPerSec);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Ago(int seconds_since_epoch, const QLocale &locale) {
|
QString Ago(qint64 seconds_since_epoch, const QLocale &locale) {
|
||||||
|
|
||||||
const QDateTime now = QDateTime::currentDateTime();
|
const QDateTime now = QDateTime::currentDateTime();
|
||||||
const QDateTime then = QDateTime::fromSecsSinceEpoch(seconds_since_epoch);
|
const QDateTime then = QDateTime::fromSecsSinceEpoch(seconds_since_epoch);
|
||||||
const int days_ago = then.date().daysTo(now.date());
|
const qint64 days_ago = then.date().daysTo(now.date());
|
||||||
const QString time = then.time().toString(locale.timeFormat(QLocale::ShortFormat));
|
const QString time = then.time().toString(locale.timeFormat(QLocale::ShortFormat));
|
||||||
|
|
||||||
if (days_ago == 0) return tr("Today") + " " + time;
|
if (days_ago == 0) return tr("Today") + " " + time;
|
||||||
@@ -170,7 +170,7 @@ QString Ago(int seconds_since_epoch, const QLocale &locale) {
|
|||||||
QString PrettyFutureDate(const QDate &date) {
|
QString PrettyFutureDate(const QDate &date) {
|
||||||
|
|
||||||
const QDate now = QDate::currentDate();
|
const QDate now = QDate::currentDate();
|
||||||
const int delta_days = now.daysTo(date);
|
const qint64 delta_days = now.daysTo(date);
|
||||||
|
|
||||||
if (delta_days < 0) return QString();
|
if (delta_days < 0) return QString();
|
||||||
if (delta_days == 0) return tr("Today");
|
if (delta_days == 0) return tr("Today");
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ QString PrettySize(quint64 bytes);
|
|||||||
QString PrettySize(const QSize &size);
|
QString PrettySize(const QSize &size);
|
||||||
QString WordyTime(quint64 seconds);
|
QString WordyTime(quint64 seconds);
|
||||||
QString WordyTimeNanosec(qint64 nanoseconds);
|
QString WordyTimeNanosec(qint64 nanoseconds);
|
||||||
QString Ago(int seconds_since_epoch, const QLocale &locale);
|
QString Ago(qint64 seconds_since_epoch, const QLocale &locale);
|
||||||
QString PrettyFutureDate(const QDate &date);
|
QString PrettyFutureDate(const QDate &date);
|
||||||
|
|
||||||
QString ColorToRgba(const QColor &color);
|
QString ColorToRgba(const QColor &color);
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ QString DateItemDelegate::displayText(const QVariant &value, const QLocale &loca
|
|||||||
Q_UNUSED(locale);
|
Q_UNUSED(locale);
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
int time = value.toInt(&ok);
|
qint64 time = value.toLongLong(&ok);
|
||||||
|
|
||||||
if (!ok || time == -1)
|
if (!ok || time == -1)
|
||||||
return QString();
|
return QString();
|
||||||
@@ -338,7 +338,7 @@ QString DateItemDelegate::displayText(const QVariant &value, const QLocale &loca
|
|||||||
QString LastPlayedItemDelegate::displayText(const QVariant &value, const QLocale &locale) const {
|
QString LastPlayedItemDelegate::displayText(const QVariant &value, const QLocale &locale) const {
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
const int time = value.toInt(&ok);
|
const qint64 time = value.toLongLong(&ok);
|
||||||
|
|
||||||
if (!ok || time == -1)
|
if (!ok || time == -1)
|
||||||
return tr("Never");
|
return tr("Never");
|
||||||
|
|||||||
Reference in New Issue
Block a user