Browse Source

LogDownloadControlle: Remove QString constructor with tr

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
QGC4.4
Patrick José Pereira 6 years ago
parent
commit
f347ff4825
  1. 18
      src/AnalyzeView/LogDownloadController.cc

18
src/AnalyzeView/LogDownloadController.cc

@ -177,7 +177,7 @@ LogDownloadController::_logEntry(UASInterface* uas, uint32_t time_utc, uint32_t
entry->setSize(size); entry->setSize(size);
entry->setTime(QDateTime::fromTime_t(time_utc)); entry->setTime(QDateTime::fromTime_t(time_utc));
entry->setReceived(true); entry->setReceived(true);
entry->setStatus(QString(tr("Available"))); entry->setStatus(tr("Available"));
} else { } else {
qWarning() << "Received log entry for out-of-bound index:" << id; qWarning() << "Received log entry for out-of-bound index:" << id;
} }
@ -224,7 +224,7 @@ LogDownloadController::_resetSelection(bool canceled)
if(entry) { if(entry) {
if(entry->selected()) { if(entry->selected()) {
if(canceled) { if(canceled) {
entry->setStatus(QString(tr("Canceled"))); entry->setStatus(tr("Canceled"));
} }
entry->setSelected(false); entry->setSelected(false);
} }
@ -271,7 +271,7 @@ LogDownloadController::_findMissingEntries()
for(int i = 0; i < num_logs; i++) { for(int i = 0; i < num_logs; i++) {
QGCLogEntry* entry = _logEntriesModel[i]; QGCLogEntry* entry = _logEntriesModel[i];
if(entry && !entry->received()) { if(entry && !entry->received()) {
entry->setStatus(QString(tr("Error"))); entry->setStatus(tr("Error"));
} }
} }
//-- Give up //-- Give up
@ -357,7 +357,7 @@ LogDownloadController::_logData(UASInterface* uas, uint32_t ofs, uint16_t id, ui
_timer.start(timeout_time); _timer.start(timeout_time);
//-- Do we have it all? //-- Do we have it all?
if(_logComplete()) { if(_logComplete()) {
_downloadData->entry->setStatus(QString(tr("Downloaded"))); _downloadData->entry->setStatus(tr("Downloaded"));
//-- Check for more //-- Check for more
_receivedAllData(); _receivedAllData();
} else if (_chunkComplete()) { } else if (_chunkComplete()) {
@ -376,7 +376,7 @@ LogDownloadController::_logData(UASInterface* uas, uint32_t ofs, uint16_t id, ui
qWarning() << "Received log offset greater than expected"; qWarning() << "Received log offset greater than expected";
} }
if(!result) { if(!result) {
_downloadData->entry->setStatus(QString(tr("Error"))); _downloadData->entry->setStatus(tr("Error"));
} }
} }
@ -423,7 +423,7 @@ LogDownloadController::_findMissingData()
} }
if(_retries++ > 2) { if(_retries++ > 2) {
_downloadData->entry->setStatus(QString(tr("Timed Out"))); _downloadData->entry->setStatus(tr("Timed Out"));
//-- Give up //-- Give up
qWarning() << "Too many errors retreiving log data. Giving up."; qWarning() << "Too many errors retreiving log data. Giving up.";
_receivedAllData(); _receivedAllData();
@ -541,7 +541,7 @@ void LogDownloadController::downloadToDirectory(const QString& dir)
QGCLogEntry* entry = _logEntriesModel[i]; QGCLogEntry* entry = _logEntriesModel[i];
if(entry) { if(entry) {
if(entry->selected()) { if(entry->selected()) {
entry->setStatus(QString(tr("Waiting"))); entry->setStatus(tr("Waiting"));
} }
} }
} }
@ -632,7 +632,7 @@ LogDownloadController::_prepareLogDownload()
if (_downloadData->file.exists()) { if (_downloadData->file.exists()) {
_downloadData->file.remove(); _downloadData->file.remove();
} }
_downloadData->entry->setStatus(QString(tr("Error"))); _downloadData->entry->setStatus(tr("Error"));
delete _downloadData; delete _downloadData;
_downloadData = NULL; _downloadData = NULL;
} }
@ -686,7 +686,7 @@ LogDownloadController::cancel(void)
_receivedAllEntries(); _receivedAllEntries();
} }
if(_downloadData) { if(_downloadData) {
_downloadData->entry->setStatus(QString(tr("Canceled"))); _downloadData->entry->setStatus(tr("Canceled"));
if (_downloadData->file.exists()) { if (_downloadData->file.exists()) {
_downloadData->file.remove(); _downloadData->file.remove();
} }

Loading…
Cancel
Save