[Pkg-owncloud-commits] [owncloud-client] 15/219: AccountSettings: be less verbose in the status string
Sandro Knauß
hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:04 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit bb7f63dcfd81066bb266c015de3965be946c069c
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Wed Aug 27 13:50:38 2014 +0200
AccountSettings: be less verbose in the status string
---
src/mirall/accountsettings.cpp | 36 ++++++++++++++++++++++++------------
src/mirall/progressdispatcher.cpp | 4 ++--
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/src/mirall/accountsettings.cpp b/src/mirall/accountsettings.cpp
index 2bdafd6..c278617 100644
--- a/src/mirall/accountsettings.cpp
+++ b/src/mirall/accountsettings.cpp
@@ -643,12 +643,18 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
if (Progress::isSizeDependent(curItem._instruction)) {
QString s1 = Utility::octetsToString( curItemProgress );
QString s2 = Utility::octetsToString( curItem._size );
- //: Example text: "uploading foobar.png (1MB of 2MB) time left 2 minutes at a rate of 24Kb/s"
- fileProgressString = tr("%1 %2 (%3 of %4) %5 left at a rate of %6/s")
- .arg(kindString, itemFileName, s1, s2,
- Utility::timeToDescriptiveString(progress.getFileEstimate(curItem).getEtaEstimate(), 3, " ", true),
- Utility::octetsToString(progress.getFileEstimate(curItem).getEstimatedBandwidth()) );
- } else {
+ quint64 estimatedBw = progress.getFileEstimate(curItem).getEstimatedBandwidth();
+ if (estimatedBw) {
+ //: Example text: "uploading foobar.png (1MB of 2MB) time left 2 minutes at a rate of 24Kb/s"
+ fileProgressString = tr("%1 %2 (%3 of %4) %5 left at a rate of %6/s")
+ .arg(kindString, itemFileName, s1, s2,
+ Utility::timeToDescriptiveString(progress.getFileEstimate(curItem).getEtaEstimate(), 3, " ", true),
+ Utility::octetsToString(estimatedBw) );
+ } else {
+ //: Example text: "uploading foobar.png (2MB of 2MB)"
+ fileProgressString = tr("%1 %2 (%3 of %4)") .arg(kindString, itemFileName, s1, s2);
+ }
+ } else if (!kindString.isEmpty()) {
//: Example text: "uploading foobar.png"
fileProgressString = tr("%1 %2").arg(kindString, itemFileName);
}
@@ -657,12 +663,18 @@ void AccountSettings::slotSetProgress(const QString& folder, const Progress::Inf
// overall progress
quint64 completedSize = progress.completedSize();
quint64 currentFile = progress._completedFileCount + progress._currentItems.count();
- QString s1 = Utility::octetsToString( completedSize );
- QString s2 = Utility::octetsToString( progress._totalSize );
- QString overallSyncString = tr("%1 of %2, file %3 of %4\nTotal time left %5")
- .arg(s1, s2)
- .arg(currentFile).arg(progress._totalFileCount)
- .arg( Utility::timeToDescriptiveString(progress.totalEstimate().getEtaEstimate(), 3, " ", true) );
+ QString overallSyncString;
+ if (progress._totalSize > 0) {
+ QString s1 = Utility::octetsToString( completedSize );
+ QString s2 = Utility::octetsToString( progress._totalSize );
+ overallSyncString = tr("%1 of %2, file %3 of %4\nTotal time left %5")
+ .arg(s1, s2)
+ .arg(currentFile).arg(progress._totalFileCount)
+ .arg( Utility::timeToDescriptiveString(progress.totalEstimate().getEtaEstimate(), 3, " ", true) );
+ } else if (progress._totalFileCount > 0) {
+ // Don't attemt to estimate the time left if there is no kb to transfer.
+ overallSyncString = tr("file %1 of %2") .arg(currentFile).arg(progress._totalFileCount);
+ }
item->setData( overallSyncString, FolderStatusDelegate::SyncProgressOverallString );
diff --git a/src/mirall/progressdispatcher.cpp b/src/mirall/progressdispatcher.cpp
index ccf4025..b0f8a0b 100644
--- a/src/mirall/progressdispatcher.cpp
+++ b/src/mirall/progressdispatcher.cpp
@@ -75,9 +75,9 @@ QString Progress::asActionString( const SyncFileItem &item )
return QCoreApplication::translate( "progress", "error");
case CSYNC_INSTRUCTION_NONE:
case CSYNC_INSTRUCTION_EVAL:
- return QCoreApplication::translate( "progress", "unknown");
+ break;
}
- return QCoreApplication::translate( "progress", "unknown");
+ return QString();
}
bool Progress::isWarningKind( SyncFileItem::Status kind)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list