Skip to content

Commit

Permalink
Improve lag on startup when REToolSync doesn't connect
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Nov 3, 2023
1 parent 47df68d commit 64a9158
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 77 deletions.
8 changes: 0 additions & 8 deletions src/cross/minidump/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ MainWindow::MainWindow(QWidget* parent)
{
loadMinidump(args.at(1));
}
#if defined(Q_OS_DARWIN) || 1
else
{
loadMinidump(":/dmp/HarnessMinimal_x64.dmp");
mDisassembly->disassembleAt(0x7FFC9E0D1010, false, -1);
mHexDump->printDumpAt(0x7FFC9E203010);
}
#endif
}

MainWindow::~MainWindow()
Expand Down
1 change: 1 addition & 0 deletions src/cross/minidump/REToolSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ bool REToolSync::connect(const QString & endpoint)
// Ping the server
mEndpoint = endpoint;
httplib::Client client(mEndpoint.toUtf8().data());
client.set_connection_timeout(0, 300000);
{
auto response = client.Get("/api/ping");
if(!response || response->status != 200)
Expand Down
78 changes: 39 additions & 39 deletions src/cross/remote_table/OverlayFrame.cpp
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
#include "OverlayFrame.h"
#include "ui_OverlayFrame.h"

#include <QVBoxLayout>
#include <QHBoxLayout>

OverlayFrame* OverlayFrame::embed(QWidget* parent, bool visible)
{
// TODO: confirm the memory management is correct
auto frame = new OverlayFrame(parent);
frame->setVisible(visible);
auto hlayout = new QHBoxLayout(frame);
hlayout->addWidget(frame);
auto vlayout = new QVBoxLayout(parent);
vlayout->addLayout(hlayout);
return frame;
}

OverlayFrame::OverlayFrame(QWidget *parent) :
QFrame(parent),
ui(new Ui::OverlayFrame)
{
ui->setupUi(this);
}

OverlayFrame::~OverlayFrame()
{
delete ui;
}

QPushButton* OverlayFrame::button()
{
return ui->pushButton;
}

QLabel* OverlayFrame::label()
{
return ui->label;
}
#include "OverlayFrame.h"
#include "ui_OverlayFrame.h"

#include <QVBoxLayout>
#include <QHBoxLayout>

OverlayFrame* OverlayFrame::embed(QWidget* parent, bool visible)
{
// TODO: confirm the memory management is correct
auto frame = new OverlayFrame(parent);
frame->setVisible(visible);
auto hlayout = new QHBoxLayout(frame);
hlayout->addWidget(frame);
auto vlayout = new QVBoxLayout(parent);
vlayout->addLayout(hlayout);
return frame;
}

OverlayFrame::OverlayFrame(QWidget* parent) :
QFrame(parent),
ui(new Ui::OverlayFrame)
{
ui->setupUi(this);
}

OverlayFrame::~OverlayFrame()
{
delete ui;
}

QPushButton* OverlayFrame::button()
{
return ui->pushButton;
}

QLabel* OverlayFrame::label()
{
return ui->label;
}
53 changes: 27 additions & 26 deletions src/cross/remote_table/OverlayFrame.h
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
#pragma once

#include <QFrame>
#include <QPushButton>
#include <QLabel>

namespace Ui {
class OverlayFrame;
}

class OverlayFrame : public QFrame
{
Q_OBJECT

public:
static OverlayFrame* embed(QWidget* parent, bool visible = true);

explicit OverlayFrame(QWidget* parent = nullptr);
~OverlayFrame();

QPushButton* button();
QLabel* label();

private:
Ui::OverlayFrame* ui = nullptr;
};
#pragma once

#include <QFrame>
#include <QPushButton>
#include <QLabel>

namespace Ui
{
class OverlayFrame;
}

class OverlayFrame : public QFrame
{
Q_OBJECT

public:
static OverlayFrame* embed(QWidget* parent, bool visible = true);

explicit OverlayFrame(QWidget* parent = nullptr);
~OverlayFrame();

QPushButton* button();
QLabel* label();

private:
Ui::OverlayFrame* ui = nullptr;
};
4 changes: 2 additions & 2 deletions src/cross/remote_table/OverlayFrame.ui
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>3</number>
<number>1</number>
</property>
<property name="midLineWidth">
<number>0</number>
Expand Down Expand Up @@ -90,7 +90,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Connecting...</string>
<string>Loading...</string>
</property>
</widget>
</item>
Expand Down
4 changes: 2 additions & 2 deletions src/cross/remote_table/RemoteTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ QString RemoteTable::getCellContent(duint row, duint col)
}
if(relativeRow < mRemoteData.size())
{
const auto& remoteRow = mRemoteData[relativeRow];
const auto & remoteRow = mRemoteData[relativeRow];
QString data;
if(col < remoteRow.size())
{
Expand Down Expand Up @@ -204,7 +204,7 @@ void RemoteTable::handleTableResponse(const TableResponse & response)
mMaxResponseTime = 0;
mMinResponseTime = UINT64_MAX;
mAvgResponseTime = 0;
for(const auto& responseTime : mResponseTimes)
for(const auto & responseTime : mResponseTimes)
{
mMaxResponseTime = std::max(mMaxResponseTime, responseTime);
mMinResponseTime = std::min(mMinResponseTime, responseTime);
Expand Down

0 comments on commit 64a9158

Please sign in to comment.