Skip to content

Commit b0dcb5a

Browse files
committed
Code polishing
1 parent fb09aa0 commit b0dcb5a

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

src/gui/map/map_find_feature.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
#include <functional>
2424

25-
#include <QAction>
2625
#include <QAbstractButton>
26+
#include <QAction>
2727
#include <QDialog>
2828
#include <QDialogButtonBox>
2929
#include <QGridLayout>
@@ -129,7 +129,7 @@ void MapFindFeature::showDialog()
129129

130130
auto button_box = new QDialogButtonBox(QDialogButtonBox::Close | QDialogButtonBox::Help);
131131
connect(button_box, &QDialogButtonBox::rejected, &*find_dialog, &QDialog::hide);
132-
connect(button_box->button(QDialogButtonBox::Help), &QPushButton::clicked, this, &MapFindFeature::showHelp);
132+
connect(button_box, &QDialogButtonBox::helpRequested, this, &MapFindFeature::showHelp);
133133

134134
editor_stack = new QStackedLayout();
135135
editor_stack->addWidget(text_edit);
@@ -182,6 +182,7 @@ ObjectQuery MapFindFeature::makeQuery() const
182182
}
183183

184184

185+
// slot
185186
void MapFindFeature::findNext()
186187
{
187188
auto query = makeQuery();
@@ -227,6 +228,7 @@ void MapFindFeature::findNext()
227228
}
228229

229230

231+
// slot
230232
void MapFindFeature::findAll()
231233
{
232234
auto map = controller.getMap();
@@ -251,14 +253,13 @@ void MapFindFeature::findAll()
251253
}
252254

253255

254-
256+
// slot
255257
void MapFindFeature::showHelp() const
256258
{
257259
Util::showHelp(controller.getWindow(), "find_objects.html");
258260
}
259261

260262

261-
262263
// slot
263264
void MapFindFeature::tagSelectorToggled(bool active)
264265
{

src/gui/map/map_find_feature.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017 Kai Pastor
2+
* Copyright 2017-2019, 2025 Kai Pastor
33
*
44
* This file is part of OpenOrienteering.
55
*
@@ -56,15 +56,11 @@ class MapFindFeature : public QObject
5656

5757
void setEnabled(bool enabled);
5858

59-
QAction* showDialogAction() { return show_action; }
59+
QAction* showDialogAction() const { return show_action; }
6060

61-
QAction* findNextAction() { return find_next_action; }
62-
63-
private:
64-
void showDialog();
65-
66-
ObjectQuery makeQuery() const;
61+
QAction* findNextAction() const { return find_next_action; }
6762

63+
private slots:
6864
void findNext();
6965

7066
void findAll();
@@ -73,6 +69,12 @@ class MapFindFeature : public QObject
7369

7470
void tagSelectorToggled(bool active);
7571

72+
private:
73+
void showDialog();
74+
75+
ObjectQuery makeQuery() const;
76+
77+
7678
MapEditorController& controller;
7779
QPointer<QDialog> find_dialog; // child of controller's window
7880
QStackedLayout* editor_stack = nullptr; // child of find_dialog
@@ -88,4 +90,4 @@ class MapFindFeature : public QObject
8890

8991
} // namespace OpenOrienteering
9092

91-
#endif
93+
#endif // OPENORIENTEERING_MAP_FIND_FEATURE_H

0 commit comments

Comments
 (0)