From f347ff4825b09f3459156bc5695c5c5cdb58b138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 27 Jun 2019 15:27:20 -0300 Subject: [PATCH] LogDownloadControlle: Remove QString constructor with tr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/AnalyzeView/LogDownloadController.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/AnalyzeView/LogDownloadController.cc b/src/AnalyzeView/LogDownloadController.cc index 8ec38b67d..421d34d1c 100644 --- a/src/AnalyzeView/LogDownloadController.cc +++ b/src/AnalyzeView/LogDownloadController.cc @@ -177,7 +177,7 @@ LogDownloadController::_logEntry(UASInterface* uas, uint32_t time_utc, uint32_t entry->setSize(size); entry->setTime(QDateTime::fromTime_t(time_utc)); entry->setReceived(true); - entry->setStatus(QString(tr("Available"))); + entry->setStatus(tr("Available")); } else { qWarning() << "Received log entry for out-of-bound index:" << id; } @@ -224,7 +224,7 @@ LogDownloadController::_resetSelection(bool canceled) if(entry) { if(entry->selected()) { if(canceled) { - entry->setStatus(QString(tr("Canceled"))); + entry->setStatus(tr("Canceled")); } entry->setSelected(false); } @@ -271,7 +271,7 @@ LogDownloadController::_findMissingEntries() for(int i = 0; i < num_logs; i++) { QGCLogEntry* entry = _logEntriesModel[i]; if(entry && !entry->received()) { - entry->setStatus(QString(tr("Error"))); + entry->setStatus(tr("Error")); } } //-- Give up @@ -357,7 +357,7 @@ LogDownloadController::_logData(UASInterface* uas, uint32_t ofs, uint16_t id, ui _timer.start(timeout_time); //-- Do we have it all? if(_logComplete()) { - _downloadData->entry->setStatus(QString(tr("Downloaded"))); + _downloadData->entry->setStatus(tr("Downloaded")); //-- Check for more _receivedAllData(); } 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"; } if(!result) { - _downloadData->entry->setStatus(QString(tr("Error"))); + _downloadData->entry->setStatus(tr("Error")); } } @@ -423,7 +423,7 @@ LogDownloadController::_findMissingData() } if(_retries++ > 2) { - _downloadData->entry->setStatus(QString(tr("Timed Out"))); + _downloadData->entry->setStatus(tr("Timed Out")); //-- Give up qWarning() << "Too many errors retreiving log data. Giving up."; _receivedAllData(); @@ -541,7 +541,7 @@ void LogDownloadController::downloadToDirectory(const QString& dir) QGCLogEntry* entry = _logEntriesModel[i]; if(entry) { if(entry->selected()) { - entry->setStatus(QString(tr("Waiting"))); + entry->setStatus(tr("Waiting")); } } } @@ -632,7 +632,7 @@ LogDownloadController::_prepareLogDownload() if (_downloadData->file.exists()) { _downloadData->file.remove(); } - _downloadData->entry->setStatus(QString(tr("Error"))); + _downloadData->entry->setStatus(tr("Error")); delete _downloadData; _downloadData = NULL; } @@ -686,7 +686,7 @@ LogDownloadController::cancel(void) _receivedAllEntries(); } if(_downloadData) { - _downloadData->entry->setStatus(QString(tr("Canceled"))); + _downloadData->entry->setStatus(tr("Canceled")); if (_downloadData->file.exists()) { _downloadData->file.remove(); } -- 2.22.0