Skip to content

Commit 0adf089

Browse files
akien-mgamihe
authored andcommitted
Various style nitpicks
1 parent 78f1543 commit 0adf089

18 files changed

+75
-63
lines changed

modules/objectdb_profiler/SCsub

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ from misc.utility.scons_hints import *
44
Import("env")
55
Import("env_modules")
66

7-
env_mp = env_modules.Clone()
7+
env_objdb = env_modules.Clone()
88

99
module_obj = []
1010

1111
# Only include in editor and debug builds.
12-
if env_mp.debug_features:
13-
env_mp.add_source_files(module_obj, "*.cpp")
12+
if env_objdb.debug_features:
13+
env_objdb.add_source_files(module_obj, "*.cpp")
1414

1515
# Only the editor needs these files, don't include them in the game.
1616
if env.editor_build:
17-
env_mp.add_source_files(module_obj, "editor/*.cpp")
18-
env_mp.add_source_files(module_obj, "editor/data_viewers/*.cpp")
17+
env_objdb.add_source_files(module_obj, "editor/*.cpp")
18+
env_objdb.add_source_files(module_obj, "editor/data_viewers/*.cpp")
1919

2020
env.modules_sources += module_obj

modules/objectdb_profiler/config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# config.py
2-
3-
41
def can_build(env, platform):
52
return env.debug_features
63

modules/objectdb_profiler/editor/data_viewers/class_view.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
#include "class_view.h"
3232

33+
#include "shared_controls.h"
34+
3335
#include "editor/editor_node.h"
3436
#include "editor/themes/editor_scale.h"
35-
#include "scene/gui/panel_container.h"
3637
#include "scene/gui/split_container.h"
37-
#include "shared_controls.h"
3838

3939
int ClassData::instance_count(GameStateSnapshot *p_snapshot) {
4040
int count = 0;

modules/objectdb_profiler/editor/data_viewers/json_view.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
#include "json_view.h"
3232

33+
#include "shared_controls.h"
34+
3335
#include "core/io/json.h"
3436
#include "scene/gui/center_container.h"
35-
#include "scene/gui/panel_container.h"
3637
#include "scene/gui/split_container.h"
37-
#include "shared_controls.h"
3838

3939
SnapshotJsonView::SnapshotJsonView() {
4040
set_name(TTR("JSON"));
@@ -65,7 +65,7 @@ void SnapshotJsonView::show_snapshot(GameStateSnapshot *p_data, GameStateSnapsho
6565
String hdr_a_text = diff_data ? TTR("Snapshot A JSON") : TTR("Snapshot JSON");
6666
SpanningHeader *hdr_a = memnew(SpanningHeader(hdr_a_text));
6767
if (diff_data) {
68-
hdr_a->set_tooltip_text(TTR("Snapshot A: ") + snapshot_data->name);
68+
hdr_a->set_tooltip_text(TTR("Snapshot A:") + " " + snapshot_data->name);
6969
}
7070
json_box->add_child(hdr_a);
7171

@@ -86,7 +86,7 @@ void SnapshotJsonView::show_snapshot(GameStateSnapshot *p_data, GameStateSnapsho
8686
box->add_child(diff_json_box);
8787
String hrd_b_text = TTR("Snapshot B JSON");
8888
SpanningHeader *hdr_b = memnew(SpanningHeader(hrd_b_text));
89-
hdr_b->set_tooltip_text(TTR("Snapshot B: ") + diff_data->name);
89+
hdr_b->set_tooltip_text(TTR("Snapshot B:") + " " + diff_data->name);
9090
diff_json_box->add_child(hdr_b);
9191

9292
diff_json_content = memnew(EditorJsonVisualizer);

modules/objectdb_profiler/editor/data_viewers/json_view.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
#pragma once
3232

3333
#include "../snapshot_data.h"
34-
#include "editor/editor_json_visualizer.h"
3534
#include "snapshot_view.h"
3635

36+
#include "editor/editor_json_visualizer.h"
37+
3738
class SnapshotJsonView : public SnapshotView {
3839
GDCLASS(SnapshotJsonView, SnapshotView);
3940

modules/objectdb_profiler/editor/data_viewers/node_view.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void SnapshotNodeView::_node_selected(Tree *p_tree_selected_from) {
130130
return;
131131
}
132132
if (objects.size() == 1) {
133-
EditorNode::get_singleton()->push_item((Object *)(objects.get(0)));
133+
EditorNode::get_singleton()->push_item((Object *)objects.get(0));
134134
}
135135
if (objects.size() == 2) {
136136
// This happens if we're in the combined diff view and the node exists in both trees

modules/objectdb_profiler/editor/data_viewers/refcounted_view.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void SnapshotRefCountedView::show_snapshot(GameStateSnapshot *p_data, GameStateS
106106
refs_list->set_column_title(offset + 5, TTR("ObjectDB Cycles"));
107107
refs_list->set_column_expand(offset + 5, false);
108108
refs_list->set_column_title_tooltip_text(offset + 5, TTR("Cycles detected in the ObjectDB"));
109-
refs_list->connect("item_selected", callable_mp(this, &SnapshotRefCountedView::_refcounted_selected));
109+
refs_list->connect(SceneStringName(item_selected), callable_mp(this, &SnapshotRefCountedView::_refcounted_selected));
110110
refs_list->set_h_size_flags(SizeFlags::SIZE_EXPAND_FILL);
111111
refs_list->set_v_size_flags(SizeFlags::SIZE_EXPAND_FILL);
112112

modules/objectdb_profiler/editor/data_viewers/shared_controls.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "editor/editor_string_names.h"
3535
#include "editor/themes/editor_scale.h"
3636
#include "scene/gui/label.h"
37+
#include "scene/gui/line_edit.h"
3738
#include "scene/gui/menu_button.h"
3839
#include "scene/resources/style_box_flat.h"
3940

modules/objectdb_profiler/editor/data_viewers/shared_controls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
#pragma once
3232

3333
#include "scene/gui/box_container.h"
34-
#include "scene/gui/line_edit.h"
3534
#include "scene/gui/panel_container.h"
3635
#include "scene/gui/tree.h"
3736

37+
class LineEdit;
3838
class MenuButton;
3939

4040
class SpanningHeader : public PanelContainer {

modules/objectdb_profiler/editor/data_viewers/snapshot_view.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
#include "snapshot_view.h"
3232

33-
#include "scene/gui/label.h"
34-
#include "scene/gui/rich_text_label.h"
3533
#include "scene/gui/tree.h"
3634

3735
void SnapshotView::clear_snapshot() {

0 commit comments

Comments
 (0)