Skip to content

Commit 9138dd9

Browse files
committed
naming fix, initialization
1 parent 8015eac commit 9138dd9

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

ui/command_buffer_model.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,11 @@ void CommandBufferModel::OnSelectionChanged(const QModelIndex &index)
255255

256256
// Ensures that the selected index passed belongs to the filter model currently displayed in the
257257
// main window.
258-
QAbstractItemModel *model = const_cast<QAbstractItemModel *>(index.model());
259-
DiveFilterModel *dive_filter_model = dynamic_cast<DiveFilterModel *>(model);
258+
const DiveFilterModel *dive_filter_model = qobject_cast<const DiveFilterModel *>(index.model());
260259
if (dive_filter_model)
261260
{
262-
QModelIndex new_index = dive_filter_model->mapToSource(index);
263-
selected_node_index = (uint64_t)new_index.internalPointer();
261+
const QModelIndex &new_index = dive_filter_model->mapToSource(index);
262+
selected_node_index = (uint64_t)(new_index.internalPointer());
264263
}
265264

266265
emit beginResetModel();

ui/gfxr_vulkan_command_arguments_tab_view.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ GfxrVulkanCommandArgumentsFilterProxyModel *proxy_model,
4040
GfxrVulkanCommandModel *command_hierarchy_model,
4141
QWidget *parent) :
4242
m_vulkan_command_hierarchy(vulkan_command_hierarchy),
43-
m_arg_proxy_Model(proxy_model),
43+
m_arg_proxy_model(proxy_model),
4444
m_command_hierarchy_model(command_hierarchy_model)
4545
{
4646
m_command_hierarchy_view = new DiveTreeView(m_vulkan_command_hierarchy);
4747

48-
m_arg_proxy_Model->setSourceModel(m_command_hierarchy_model);
49-
m_command_hierarchy_view->setModel(m_arg_proxy_Model);
48+
m_arg_proxy_model->setSourceModel(m_command_hierarchy_model);
49+
m_command_hierarchy_view->setModel(m_arg_proxy_model);
5050

5151
m_search_trigger_button = new QPushButton;
5252
m_search_trigger_button->setObjectName(kGfxrVulkanCommandArgumentsSearchButtonName);
@@ -98,7 +98,7 @@ void GfxrVulkanCommandArgumentsTabView::OnSelectionChanged(const QModelIndex &in
9898
{
9999
if (!index.isValid())
100100
{
101-
m_arg_proxy_Model->SetTargetParentSourceIndex(QModelIndex());
101+
m_arg_proxy_model->SetTargetParentSourceIndex(QModelIndex());
102102
return;
103103
}
104104

@@ -116,7 +116,7 @@ void GfxrVulkanCommandArgumentsTabView::OnSelectionChanged(const QModelIndex &in
116116
}
117117

118118
// Always use the source_index, regardless of whether a proxy was involved.
119-
m_arg_proxy_Model->SetTargetParentSourceIndex(source_index);
119+
m_arg_proxy_model->SetTargetParentSourceIndex(source_index);
120120

121121
uint32_t column_count = (uint32_t)m_command_hierarchy_model->columnCount(QModelIndex());
122122
for (uint32_t column = 0; column < column_count; ++column)

ui/gfxr_vulkan_command_arguments_tab_view.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public slots:
6666
SearchBar *m_search_bar = nullptr;
6767

6868
const Dive::CommandHierarchy &m_vulkan_command_hierarchy;
69-
GfxrVulkanCommandFilterProxyModel *m_proxy_Model;
70-
GfxrVulkanCommandArgumentsFilterProxyModel *m_arg_proxy_Model;
69+
GfxrVulkanCommandArgumentsFilterProxyModel *m_arg_proxy_model;
7170
GfxrVulkanCommandModel *m_command_hierarchy_model;
7271
};

ui/gfxr_vulkan_command_tab_view.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public slots:
6868
private:
6969
DiveTreeView *m_command_hierarchy_view;
7070
QPushButton *m_search_trigger_button;
71-
SearchBar *m_search_bar = nullptr;
71+
SearchBar *m_search_bar;
7272

7373
const Dive::CommandHierarchy &m_vulkan_command_hierarchy;
7474
GfxrVulkanCommandFilterProxyModel &m_proxy_Model;

0 commit comments

Comments
 (0)