1
mirror of https://github.com/monero-project/monero-gui synced 2024-12-21 03:45:53 +01:00

src: fix qt 5.15 warnings

This commit is contained in:
selsta 2020-04-23 03:13:13 +02:00
parent 585fb2810d
commit 02eec351b9
No known key found for this signature in database
GPG Key ID: 2EA0A99A8B07AE5E
4 changed files with 20 additions and 3 deletions

View File

@ -200,9 +200,9 @@ bool DaemonManager::stopWatcher(NetworkType::Type nettype) const
if(counter >= 5) { if(counter >= 5) {
qDebug() << "Killing it! "; qDebug() << "Killing it! ";
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QProcess::execute("taskkill /F /IM monerod.exe"); QProcess::execute("taskkill", {"/F", "/IM", "monerod.exe"});
#else #else
QProcess::execute("pkill monerod"); QProcess::execute("pkill", {"monerod"});
#endif #endif
} }

View File

@ -34,6 +34,7 @@
#include <QDebug> #include <QDebug>
#include <QReadLocker> #include <QReadLocker>
#include <QWriteLocker> #include <QWriteLocker>
#include <QtGlobal>
bool TransactionHistory::transaction(int index, std::function<void (TransactionInfo &)> callback) bool TransactionHistory::transaction(int index, std::function<void (TransactionInfo &)> callback)
@ -58,7 +59,11 @@ bool TransactionHistory::transaction(int index, std::function<void (TransactionI
void TransactionHistory::refresh(quint32 accountIndex) void TransactionHistory::refresh(quint32 accountIndex)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QDateTime firstDateTime = QDate(2014, 4, 18).startOfDay();
#else
QDateTime firstDateTime = QDateTime(QDate(2014, 4, 18)); // the genesis block QDateTime firstDateTime = QDateTime(QDate(2014, 4, 18)); // the genesis block
#endif
QDateTime lastDateTime = QDateTime::currentDateTime().addDays(1); // tomorrow (guard against jitter and timezones) QDateTime lastDateTime = QDateTime::currentDateTime().addDays(1); // tomorrow (guard against jitter and timezones)
emit refreshStarted(); emit refreshStarted();
@ -143,7 +148,11 @@ bool TransactionHistory::TransactionHistory::locked() const
TransactionHistory::TransactionHistory(Monero::TransactionHistory *pimpl, QObject *parent) TransactionHistory::TransactionHistory(Monero::TransactionHistory *pimpl, QObject *parent)
: QObject(parent), m_pimpl(pimpl), m_minutesToUnlock(0), m_locked(false) : QObject(parent), m_pimpl(pimpl), m_minutesToUnlock(0), m_locked(false)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
m_firstDateTime = QDate(2014, 4, 18).startOfDay();
#else
m_firstDateTime = QDateTime(QDate(2014, 4, 18)); // the genesis block m_firstDateTime = QDateTime(QDate(2014, 4, 18)); // the genesis block
#endif
m_lastDateTime = QDateTime::currentDateTime().addDays(1); // tomorrow (guard against jitter and timezones) m_lastDateTime = QDateTime::currentDateTime().addDays(1); // tomorrow (guard against jitter and timezones)
} }

View File

@ -30,6 +30,7 @@
#include "TransactionHistoryModel.h" #include "TransactionHistoryModel.h"
#include <QDebug> #include <QDebug>
#include <QtGlobal>
namespace { namespace {
/** /**
@ -204,9 +205,14 @@ bool TransactionHistorySortFilterModel::filterAcceptsRow(int source_row, const Q
break; break;
case TransactionHistoryModel::TransactionTimeStampRole: case TransactionHistoryModel::TransactionTimeStampRole:
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QDateTime from = dateFromFilter().startOfDay();
QDateTime to = dateToFilter().endOfDay();
#else
QDateTime from = QDateTime(dateFromFilter()); QDateTime from = QDateTime(dateFromFilter());
QDateTime to = QDateTime(dateToFilter()); QDateTime to = QDateTime(dateToFilter());
to = to.addDays(1); // including upperbound to = to.addDays(1); // including upperbound
#endif
QDateTime timestamp = data.toDateTime(); QDateTime timestamp = data.toDateTime();
bool matchFrom = from.isNull() || timestamp.isNull() || timestamp >= from; bool matchFrom = from.isNull() || timestamp.isNull() || timestamp >= from;
bool matchTo = to.isNull() || timestamp.isNull() || timestamp <= to; bool matchTo = to.isNull() || timestamp.isNull() || timestamp <= to;

View File

@ -28,6 +28,7 @@
#include <QtCore> #include <QtCore>
#include <QApplication> #include <QApplication>
#include <QtGlobal>
#include "TailsOS.h" #include "TailsOS.h"
#include "utils.h" #include "utils.h"
@ -68,7 +69,8 @@ QByteArray fileOpen(QString path) {
bool fileWrite(QString path, QString data) { bool fileWrite(QString path, QString data) {
QFile file(path); QFile file(path);
if(file.open(QIODevice::WriteOnly)){ if(file.open(QIODevice::WriteOnly)){
QTextStream out(&file); out << data << endl; QTextStream out(&file);
out << data << '\n';
file.close(); file.close();
return true; return true;
} }