Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scraper, util, qt: Fix several deprecations and warnings #2131

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gridcoin/scraper/scraper_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CSplitBlob
int addPartData(CDataStream&& vData);

/** Unref all parts referenced by this. Removes parts with no references */
~CSplitBlob();
virtual ~CSplitBlob();

/* We could store the parts in mapRelay and have getdata service for free. */
/** map from part hash to scraper Index, so we can attach incoming Part in Index */
Expand Down
12 changes: 7 additions & 5 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,22 +459,22 @@ class CNode
mapAskFor.insert(std::make_pair(nRequestTime, inv));
}

// A lock on cs_vSend must be taken before calling this function
void BeginMessage(const char* pszCommand)
{
ENTER_CRITICAL_SECTION(cs_vSend);
assert(ssSend.size() == 0);
ssSend << CMessageHeader(pszCommand, 0);
}

// A lock on cs_vSend must be taken before calling this function
void AbortMessage()
{
ssSend.clear();

LEAVE_CRITICAL_SECTION(cs_vSend);

LogPrint(BCLog::LogFlags::NOISY, "(aborted)");
}

// A lock on cs_vSend must be taken before calling this function
void EndMessage()
{
if (ssSend.size() == 0)
Expand All @@ -500,8 +500,6 @@ class CNode
// If write queue empty, attempt "optimistic write"
if (it == vSendMsg.begin())
SocketSendData(this);

LEAVE_CRITICAL_SECTION(cs_vSend);
}

void PushVersion();
Expand All @@ -521,6 +519,8 @@ class CNode

void PushMessage(const char* pszCommand)
{
LOCK(cs_vSend);

try
{
BeginMessage(pszCommand);
Expand All @@ -536,6 +536,8 @@ class CNode
template<typename... Args>
void PushMessage(const char* pszCommand, Args... args)
{
LOCK(cs_vSend);

try
{
BeginMessage(pszCommand);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ int StartGridcoinQt(int argc, char *argv[], QApplication& app, OptionsModel& opt
return EXIT_FAILURE;
}

QSplashScreen splash(QPixmap(":/images/splash"), 0);
QSplashScreen splash(QPixmap(":/images/splash"));
if (GetBoolArg("-splash", true) && !GetBoolArg("-min"))
{
splash.setEnabled(false);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace GUIUtil {

QString dateTimeStr(const QDateTime &date)
{
return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm");
return QLocale::system().toString(date, QLocale::ShortFormat) + QString(" ") + date.toString("hh:mm");
}

QString dateTimeStr(qint64 nTime)
Expand Down
4 changes: 4 additions & 0 deletions src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,11 @@ QDate OptionsModel::getLimitTxnDate()

int64_t OptionsModel::getLimitTxnDateTime()
{
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QDateTime limitTxnDateTime(limitTxnDate);
#else
QDateTime limitTxnDateTime = limitTxnDate.startOfDay();
#endif
jamescowens marked this conversation as resolved.
Show resolved Hide resolved

return limitTxnDateTime.toMSecsSinceEpoch() / 1000;
}
Expand Down
5 changes: 5 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ void RPCConsole::setClientModel(ClientModel *model)
connect(banAction24h, &QAction::triggered, signalMapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
connect(banAction7d, &QAction::triggered, signalMapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
connect(banAction365d, &QAction::triggered, signalMapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));

#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(signalMapper, static_cast<void (QSignalMapper::*)(int)>(&QSignalMapper::mapped), this, &RPCConsole::banSelectedNode);
#else
connect(signalMapper, &QSignalMapper::mappedInt, this, &RPCConsole::banSelectedNode);
#endif

// peer table context menu signals
connect(ui->peerWidget, &QTableView::customContextMenuRequested, this, &RPCConsole::showPeersTableContextMenu);
Expand Down