Changeset View
Changeset View
Standalone View
Standalone View
sublime/idealcontroller.cpp
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 105 | } else { | |||
---|---|---|---|---|---|
111 | toolBar->setWindowTitle(i18n("%1 Tool Bar", w->windowTitle())); | 111 | toolBar->setWindowTitle(i18n("%1 Tool Bar", w->windowTitle())); | ||
112 | toolBar->setFloatable(false); | 112 | toolBar->setFloatable(false); | ||
113 | toolBar->setMovable(false); | 113 | toolBar->setMovable(false); | ||
114 | toolBar->addActions(toolBarActions); | 114 | toolBar->addActions(toolBarActions); | ||
115 | toolView->setCentralWidget(w); | 115 | toolView->setCentralWidget(w); | ||
116 | toolView->setFocusProxy(w); | 116 | toolView->setFocusProxy(w); | ||
117 | toolView->addToolBar(toolBar); | 117 | toolView->addToolBar(toolBar); | ||
118 | dock->setWidget(toolView); | 118 | dock->setWidget(toolView); | ||
119 | | ||||
120 | KConfigGroup cg(KSharedConfig::openConfig(), "UiSettings/Docks/ToolbarEnabled"); | ||||
121 | toolBar->setVisible(cg.readEntry(qPrintable(toolBar->windowTitle()), | ||||
kfunk: There's no need for the indirection through `QVariant`, is there?
You can just use `readEntry(. | |||||
mwolff: spaces after commas, here and below | |||||
the windowTitle is a translated string, and it's not guaranteed to be unique, is it? I don't think it's a good idea to use that as an identifier. Can you instead use the dockObjectName (see above)? mwolff: the windowTitle is a translated string, and it's not guaranteed to be unique, is it? I don't… | |||||
122 | QVariant::fromValue(true)).toBool()); | ||||
please introduce a newline before the this and indent the lambda body connect(toolBar->toggleViewAction(), &QAction::toggled, this, [toolBar, dockObjectName]() { ... }); mwolff: please introduce a newline before the this and indent the lambda body
```
connect(toolBar… | |||||
123 | connect(toolBar->toggleViewAction(), &QAction::toggled, this, [toolBar](){ | ||||
antonanikin: add `this` as signal receiver. | |||||
124 | KConfigGroup cg(KSharedConfig::openConfig(), "UiSettings/Docks/ToolbarEnabled"); | ||||
125 | cg.writeEntry(qPrintable(toolBar->windowTitle()), | ||||
126 | QVariant::fromValue(toolBar->toggleViewAction()->isChecked())); | ||||
kfunk: Dito, just use `writeEntry(..., foo->isChecked())`? | |||||
tcanabrava: Too Much QSettings makes tomaz misbehave. | |||||
127 | }); | ||||
119 | } | 128 | } | ||
120 | 129 | | |||
121 | dock->setWindowTitle(view->widget()->windowTitle()); | 130 | dock->setWindowTitle(view->widget()->windowTitle()); | ||
122 | dock->setWindowIcon(view->widget()->windowIcon()); | 131 | dock->setWindowIcon(view->widget()->windowIcon()); | ||
123 | dock->setFocusProxy(dock->widget()); | 132 | dock->setFocusProxy(dock->widget()); | ||
124 | 133 | | |||
125 | if (IdealButtonBarWidget* bar = barForDockArea(area)) { | 134 | if (IdealButtonBarWidget* bar = barForDockArea(area)) { | ||
126 | QAction* action = bar->addWidget(dock, static_cast<MainWindow*>(parent())->area(), view); | 135 | QAction* action = bar->addWidget(dock, static_cast<MainWindow*>(parent())->area(), view); | ||
▲ Show 20 Lines • Show All 373 Lines • Show Last 20 Lines |
There's no need for the indirection through QVariant, is there?
You can just use readEntry(..., true) here.