diff options
| author | Al <26797547+Al12rs@users.noreply.github.com> | 2020-02-17 13:22:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-17 13:22:13 +0100 |
| commit | cfb05d72be19ce0413f1de776eb3b2c150807e83 (patch) | |
| tree | 696f4332b1806849fe3fad4925d34b25e45e527e /src | |
| parent | 86c5b64ab5d1b57f0bc1f184983adb0936e6de3f (diff) | |
| parent | 423db567816bb3b71ae907195d4a92b9c293e5e9 (diff) | |
Merge pull request #998 from Al12rs/warnings
Change Qtime to QElapsedtimer in some palaces to remove the warnings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/downloadmanager.cpp | 2 | ||||
| -rw-r--r-- | src/downloadmanager.h | 3 | ||||
| -rw-r--r-- | src/modlist.h | 2 | ||||
| -rw-r--r-- | src/pluginlist.h | 3 |
4 files changed, 6 insertions, 4 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 7b416d50..1fc7e184 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -2027,7 +2027,7 @@ void DownloadManager::downloadFinished(int index) foreach (const QVariant &server, info->m_FileInfo->userData["downloadMap"].toList()) { QVariantMap serverMap = server.toMap(); if (serverMap["URI"].toString() == url) { - int deltaTime = info->m_StartTime.secsTo(QTime::currentTime()); + int deltaTime = info->m_StartTime.elapsed() / 1000; if (deltaTime > 5) { emit downloadSpeed(serverMap["short_name"].toString(), (info->m_TotalSize - info->m_PreResumeSize) / deltaTime); } // no division by zero please! Also, if the download is shorter than a few seconds, the result is way to inprecise diff --git a/src/downloadmanager.h b/src/downloadmanager.h index 4fc61cad..140970b8 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -31,6 +31,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <QNetworkReply> #include <QTime> #include <QTimer> +#include <QElapsedTimer> #include <QVector> #include <QMap> #include <QStringList> @@ -77,7 +78,7 @@ private: QString m_FileName; QFile m_Output; QNetworkReply *m_Reply; - QTime m_StartTime; + QElapsedTimer m_StartTime; qint64 m_PreResumeSize; std::pair<int, QString> m_Progress; std::tuple<int, int, int, int, int> m_SpeedDiff; diff --git a/src/modlist.h b/src/modlist.h index 3626c50c..9a44b761 100644 --- a/src/modlist.h +++ b/src/modlist.h @@ -363,7 +363,7 @@ private: std::map<ModInfo::EContent, std::tuple<QString, QString> > m_ContentIcons;
- QTime m_LastCheck;
+ QElapsedTimer m_LastCheck;
PluginContainer *m_PluginContainer;
diff --git a/src/pluginlist.h b/src/pluginlist.h index 004b1590..fb6d0543 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -31,6 +31,7 @@ namespace MOBase { class IPluginGame; } #include <QListWidget>
#include <QTimer>
#include <QTime>
+#include <QElapsedTimer>
#include <QTemporaryFile>
#pragma warning(push)
@@ -381,7 +382,7 @@ private: QTemporaryFile m_TempFile;
- QTime m_LastCheck;
+ QElapsedTimer m_LastCheck;
const MOBase::IPluginGame *m_GamePlugin;
|
