Changeset View
Changeset View
Standalone View
Standalone View
gui/ksysguard.cpp
Context not available. | |||||
51 | #include <QLabel> | 51 | #include <QLabel> | ||
---|---|---|---|---|---|
52 | #include <QSplitter> | 52 | #include <QSplitter> | ||
53 | #include <QStatusBar> | 53 | #include <QStatusBar> | ||
54 | #include <QMenuBar> | ||||
sitter: That should be sorted alphabetically. | |||||
54 | 55 | | |||
55 | #include <KAboutData> | 56 | #include <KAboutData> | ||
56 | #include <KActionCollection> | 57 | #include <KActionCollection> | ||
Context not available. | |||||
69 | #include <ksgrd/SensorManager.h> | 70 | #include <ksgrd/SensorManager.h> | ||
70 | #include <processui/ksysguardprocesslist.h> | 71 | #include <processui/ksysguardprocesslist.h> | ||
71 | 72 | | |||
73 | | ||||
ngraham: Unrelated whitespace change | |||||
72 | //Comment out to stop ksysguard from forking. Good for debugging | 74 | //Comment out to stop ksysguard from forking. Good for debugging | ||
73 | //#define FORK_KSYSGUARD | 75 | //#define FORK_KSYSGUARD | ||
74 | 76 | | |||
Context not available. | |||||
143 | mConfigureSheetAction = actionCollection()->addAction( QStringLiteral("configure_sheet") ); | 145 | mConfigureSheetAction = actionCollection()->addAction( QStringLiteral("configure_sheet") ); | ||
144 | mConfigureSheetAction->setIcon( QIcon::fromTheme(QStringLiteral("configure")) ); | 146 | mConfigureSheetAction->setIcon( QIcon::fromTheme(QStringLiteral("configure")) ); | ||
145 | connect(mConfigureSheetAction, &QAction::triggered, this, &TopLevel::configureCurrentSheet); | 147 | connect(mConfigureSheetAction, &QAction::triggered, this, &TopLevel::configureCurrentSheet); | ||
146 | 148 | | |||
ngraham: Extra whitespace | |||||
@broulik just pointed out that KStandardAction has gained support for the more modern slot syntax. So, ideally this line should be changed to mShowMenuBarAction = KStandardAction::showMenubar(this, &TopLevel::toggleShowMenuBar, actionCollection()); Which has the advantage of letting the compiler assert slot compatibility, whereas the old SLOT() syntax turns it into a runtime problem which is easy to miss should it break in the future. Not technically a blocking issue though. sitter: @broulik just pointed out that KStandardAction has gained support for the more modern slot… | |||||
149 | // setup 'Settings' menu | ||||
Minor nitpick: "setup" is a noun; it should be "set up" so that there's a verb in the sentence. ngraham: Minor nitpick: "setup" is a noun; it should be "set up" so that there's a verb in the sentence. | |||||
150 | KToggleAction* showMenuBar = KStandardAction::showMenubar(nullptr, nullptr, actionCollection()); | ||||
151 | connect(showMenuBar, &KToggleAction::triggered, | ||||
152 | this, &TopLevel::toggleShowMenuBar, Qt::QueuedConnection); | ||||
153 | | ||||
147 | retranslateUi(); | 154 | retranslateUi(); | ||
148 | } | 155 | } | ||
149 | 156 | | |||
157 | void TopLevel::toggleShowMenuBar() | ||||
158 | { | ||||
159 | const bool visible = menuBar()->isVisible(); | ||||
160 | menuBar()->setVisible(!visible); | ||||
161 | } | ||||
162 | | ||||
150 | void TopLevel::setLocalProcessController(ProcessController * localProcessController) | 163 | void TopLevel::setLocalProcessController(ProcessController * localProcessController) | ||
151 | { | 164 | { | ||
152 | Q_ASSERT(!mLocalProcessController); | 165 | Q_ASSERT(!mLocalProcessController); | ||
Context not available. |
That should be sorted alphabetically.