mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-23 14:39:34 -05:00
added years to userFriendlyDuration
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1687 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
09cfa7e070
commit
12450ececa
@ -309,7 +309,7 @@ class misc : public QObject{
|
|||||||
}
|
}
|
||||||
int minutes = seconds / 60;
|
int minutes = seconds / 60;
|
||||||
if(minutes < 60) {
|
if(minutes < 60) {
|
||||||
return tr("%1m","e.g: 10minutes").arg(QString::QString::fromUtf8(misc::toString(minutes).c_str()));
|
return tr("%1 minutes","e.g: 10minutes").arg(QString::QString::fromUtf8(misc::toString(minutes).c_str()));
|
||||||
}
|
}
|
||||||
int hours = minutes / 60;
|
int hours = minutes / 60;
|
||||||
minutes = minutes - hours*60;
|
minutes = minutes - hours*60;
|
||||||
@ -321,6 +321,11 @@ class misc : public QObject{
|
|||||||
if(days < 365) {
|
if(days < 365) {
|
||||||
return tr("%1d %2h %3m", "e.g: 2days 10hours 2minutes").arg(QString::fromUtf8(misc::toString(days).c_str())).arg(QString::fromUtf8(misc::toString(hours).c_str())).arg(QString::fromUtf8(misc::toString(minutes).c_str()));
|
return tr("%1d %2h %3m", "e.g: 2days 10hours 2minutes").arg(QString::fromUtf8(misc::toString(days).c_str())).arg(QString::fromUtf8(misc::toString(hours).c_str())).arg(QString::fromUtf8(misc::toString(minutes).c_str()));
|
||||||
}
|
}
|
||||||
|
int years = days / 365;
|
||||||
|
days = days - years * 365;
|
||||||
|
if(years > 1) {
|
||||||
|
return tr("%1y %1d %2h %3m", "e.g: 2 years 2days 10hours 2minutes").arg(QString::fromUtf8(misc::toString(years).c_str())).arg(QString::fromUtf8(misc::toString(days).c_str())).arg(QString::fromUtf8(misc::toString(hours).c_str())).arg(QString::fromUtf8(misc::toString(minutes).c_str()));
|
||||||
|
}
|
||||||
return tr("Unknown");
|
return tr("Unknown");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user