mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-25 23:25:41 +00:00
Access CaptureContext & RenderManager by reference, not pointer
* Neither of these can or should be NULL so enforce it explicitly.
This commit is contained in:
@@ -80,7 +80,7 @@ static void setItalic(QTreeWidgetItem *node, bool italic)
|
||||
node->setFont(1, f);
|
||||
}
|
||||
|
||||
RemoteManager::RemoteManager(CaptureContext *ctx, MainWindow *main)
|
||||
RemoteManager::RemoteManager(CaptureContext &ctx, MainWindow *main)
|
||||
: QDialog(NULL), ui(new Ui::RemoteManager), m_Ctx(ctx), m_Main(main)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -108,9 +108,9 @@ RemoteManager::RemoteManager(CaptureContext *ctx, MainWindow *main)
|
||||
vertical->addWidget(lookupsProgressFlow);
|
||||
vertical->addWidget(ui->bottomLayout->parentWidget());
|
||||
|
||||
m_Ctx->Config.AddAndroidHosts();
|
||||
m_Ctx.Config.AddAndroidHosts();
|
||||
|
||||
for(RemoteHost *h : m_Ctx->Config.RemoteHosts)
|
||||
for(RemoteHost *h : m_Ctx.Config.RemoteHosts)
|
||||
addHost(h);
|
||||
|
||||
on_hosts_itemClicked(ui->hosts->topLevelItem(0), 0);
|
||||
@@ -355,9 +355,9 @@ void RemoteManager::addNewHost()
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
for(int i = 0; i < m_Ctx->Config.RemoteHosts.count(); i++)
|
||||
for(int i = 0; i < m_Ctx.Config.RemoteHosts.count(); i++)
|
||||
{
|
||||
if(m_Ctx->Config.RemoteHosts[i]->Hostname.compare(host, Qt::CaseInsensitive) == 0)
|
||||
if(m_Ctx.Config.RemoteHosts[i]->Hostname.compare(host, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
@@ -370,8 +370,8 @@ void RemoteManager::addNewHost()
|
||||
h->Hostname = host;
|
||||
h->RunCommand = ui->runCommand->text().trimmed();
|
||||
|
||||
m_Ctx->Config.RemoteHosts.push_back(h);
|
||||
m_Ctx->Config.Save();
|
||||
m_Ctx.Config.RemoteHosts.push_back(h);
|
||||
m_Ctx.Config.Save();
|
||||
|
||||
addHost(h);
|
||||
}
|
||||
@@ -390,7 +390,7 @@ void RemoteManager::setRunCommand()
|
||||
if(h)
|
||||
{
|
||||
h->RunCommand = ui->runCommand->text().trimmed();
|
||||
m_Ctx->Config.Save();
|
||||
m_Ctx.Config.Save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ void RemoteManager::on_connect_clicked()
|
||||
// shut down
|
||||
if(host->Connected)
|
||||
{
|
||||
m_Ctx->Renderer()->ShutdownServer();
|
||||
m_Ctx.Renderer().ShutdownServer();
|
||||
setRemoteServerLive(node, false, false);
|
||||
}
|
||||
else
|
||||
@@ -660,9 +660,9 @@ void RemoteManager::on_deleteHost_clicked()
|
||||
|
||||
if(res == QMessageBox::Yes)
|
||||
{
|
||||
int idx = m_Ctx->Config.RemoteHosts.indexOf(host);
|
||||
delete m_Ctx->Config.RemoteHosts.takeAt(idx);
|
||||
m_Ctx->Config.Save();
|
||||
int idx = m_Ctx.Config.RemoteHosts.indexOf(host);
|
||||
delete m_Ctx.Config.RemoteHosts.takeAt(idx);
|
||||
m_Ctx.Config.Save();
|
||||
|
||||
deleteChildren(item);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user