| 401 | } |
| 402 | |
| 403 | void OpenWithPlugin::rememberDefaultChoice(const FileOpener& opener, const QString& name) |
| 404 | { |
| 405 | if (m_defaultOpener.isValid() && opener == m_defaultOpener) { |
| 406 | return; |
| 407 | } |
| 408 | |
| 409 | const auto setDefault = KMessageBox::questionTwoActions( |
| 410 | qApp->activeWindow(), |
| 411 | i18nc("%1: mime type name, %2: app/part name", "Do you want to open all '%1' files by default with %2?", |
| 412 | m_mimeType, name), |
| 413 | i18nc("@title:window", "Set as Default?"), |
| 414 | KGuiItem(i18nc("@action:button", "Set as Default"), QStringLiteral("dialog-ok")), |
| 415 | KGuiItem(i18nc("@action:button", "Do Not Set"), QStringLiteral("dialog-cancel")), |
| 416 | QStringLiteral("OpenWith-%1").arg(m_mimeType)); |
| 417 | |
| 418 | if (setDefault == KMessageBox::PrimaryAction) { |
| 419 | m_defaultOpener = opener; |
| 420 | defaultsConfig().writeEntry(m_mimeType, m_defaultOpener.toConfigEntryValue()); |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | QMimeType OpenWithPlugin::updateMimeTypeForUrls() |
| 425 | { |
nothing calls this directly
no test coverage detected