Changeset View
Changeset View
Standalone View
Standalone View
shell/currentcontainmentactionsmodel.cpp
Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Line(s) | 185 | { | |||
---|---|---|---|---|---|
209 | } | 209 | } | ||
210 | 210 | | |||
211 | configDlg->setWindowTitle(title.isEmpty() ? i18n("Configure Mouse Actions Plugin") :title); | 211 | configDlg->setWindowTitle(title.isEmpty() ? i18n("Configure Mouse Actions Plugin") :title); | ||
212 | //put buttons below | 212 | //put buttons below | ||
213 | QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, | 213 | QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, | ||
214 | Qt::Horizontal, configDlg); | 214 | Qt::Horizontal, configDlg); | ||
215 | lay->addWidget(buttons); | 215 | lay->addWidget(buttons); | ||
216 | 216 | | |||
217 | connect(buttons, &QDialogButtonBox::accepted, configDlg, &QDialog::accept); | 217 | connect(buttons, &QDialogButtonBox::accepted, configDlg, &QDialog::accept); | ||
broulik: Hmm I pass in "this" but it's nowhere guarded :/ | |||||
yeah, it may crash.. whatever is in the 3rd param of the connect is the one you can not worry about, the other one may get dangling.. mart: yeah, it may crash.. whatever is in the 3rd param of the connect is the one you can not worry… | |||||
218 | connect(buttons, &QDialogButtonBox::rejected, configDlg, &QDialog::reject); | 218 | connect(buttons, &QDialogButtonBox::rejected, configDlg, &QDialog::reject); | ||
219 | 219 | | |||
220 | QObject::connect(configDlg, &QDialog::accepted, pluginInstance, | 220 | QObject::connect(configDlg, &QDialog::accepted, pluginInstance, | ||
221 | [configDlg, pluginInstance] () { | 221 | [configDlg, pluginInstance] () { | ||
222 | pluginInstance->configurationAccepted(); | 222 | pluginInstance->configurationAccepted(); | ||
223 | }); | 223 | }); | ||
224 | 224 | | |||
225 | connect(configDlg, &QDialog::accepted, this, &CurrentContainmentActionsModel::configurationChanged); | ||||
226 | | ||||
225 | connect(pluginInstance, &QObject::destroyed, configDlg, &QDialog::reject); | 227 | connect(pluginInstance, &QObject::destroyed, configDlg, &QDialog::reject); | ||
226 | 228 | | |||
227 | configDlg->show(); | 229 | configDlg->show(); | ||
228 | } | 230 | } | ||
229 | 231 | | |||
230 | void CurrentContainmentActionsModel::showAbout(int row, QQuickItem *ctx) | 232 | void CurrentContainmentActionsModel::showAbout(int row, QQuickItem *ctx) | ||
231 | { | 233 | { | ||
232 | const QString action = itemData(index(row, 0)).value(ActionRole).toString(); | 234 | const QString action = itemData(index(row, 0)).value(ActionRole).toString(); | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
Hmm I pass in "this" but it's nowhere guarded :/