mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-18 10:02:41 -05:00
Removed most of the usages of std::ostringstream in the gui.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5056 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9ef7d08d2b
commit
4cb844c44d
38 changed files with 190 additions and 354 deletions
|
|
@ -175,21 +175,21 @@ QString misc::userFriendlyDuration(qlonglong seconds)
|
|||
}
|
||||
int minutes = seconds / 60;
|
||||
if(minutes < 60) {
|
||||
return tr("%1 minutes","e.g: 10minutes").arg(QString::QString::fromUtf8(misc::toString(minutes).c_str()));
|
||||
return tr("%1 minutes","e.g: 10minutes").arg(minutes);
|
||||
}
|
||||
int hours = minutes / 60;
|
||||
minutes = minutes - hours*60;
|
||||
if(hours < 24) {
|
||||
return tr("%1h %2m", "e.g: 3hours 5minutes").arg(QString::fromUtf8(misc::toString(hours).c_str())).arg(QString::fromUtf8(misc::toString(minutes).c_str()));
|
||||
return tr("%1h %2m", "e.g: 3hours 5minutes").arg(hours).arg(minutes);
|
||||
}
|
||||
int days = hours / 24;
|
||||
hours = hours - days * 24;
|
||||
if(days < 365) {
|
||||
return tr("%1d %2h", "e.g: 2days 10hours").arg(QString::fromUtf8(misc::toString(days).c_str())).arg(QString::fromUtf8(misc::toString(hours).c_str()));
|
||||
return tr("%1d %2h", "e.g: 2days 10hours").arg(days).arg(hours);
|
||||
}
|
||||
int years = days / 365;
|
||||
days = days - years * 365;
|
||||
return tr("%1y %2d", "e.g: 2 years 2days ").arg(QString::fromUtf8(misc::toString(years).c_str())).arg(QString::fromUtf8(misc::toString(days).c_str()));
|
||||
return tr("%1y %2d", "e.g: 2 years 2days ").arg(years).arg(days);
|
||||
}
|
||||
|
||||
QString misc::userFriendlyUnit(double count, unsigned int decimal, double factor)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue