Index: plasma/desktop/applets/trash/trash.cpp =================================================================== --- plasma/desktop/applets/trash/trash.cpp (révision 1109486) +++ plasma/desktop/applets/trash/trash.cpp (copie de travail) @@ -199,14 +199,37 @@ } emit releaseVisualFocus(); - const QString text(i18nc("@info", "Do you really want to empty the trash? All items will be deleted.")); - //FIXME: should use KMessageBox::createKMessageBox so that it doesn't block the whole app! - const bool del = KMessageBox::warningContinueCancel(&m_menu, + bool del = true ; + QString keyName = "ConfirmEmptyTrash" ; + KSharedConfigPtr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::NoGlobals); + bool ask = kioConfig->group("Confirmations").readEntry(keyName, true); + + if (ask) { + const QString text(i18nc("@info", "Do you really want to empty the trash? All items will be deleted.")); + //FIXME: should use KMessageBox::createKMessageBox so that it doesn't block the whole app! + + del = KMessageBox::warningContinueCancel(&m_menu, text, QString(), KGuiItem(i18nc("@action:button", "Empty Trash"), - KIcon("user-trash")) + KIcon("user-trash")), + KStandardGuiItem::cancel(), + keyName, KMessageBox::Notify ) == KMessageBox::Continue; + + if (!keyName.isEmpty()) { + // Check kmessagebox setting... erase & copy to konquerorrc. + KSharedConfig::Ptr config = KGlobal::config(); + KConfigGroup notificationGroup(config, "Notification Messages"); + if (!notificationGroup.readEntry(keyName, true)) { + notificationGroup.writeEntry(keyName, true); + notificationGroup.sync(); + + KSharedConfigPtr kioConfig = KSharedConfig::openConfig("kiorc", KConfig::NoGlobals); + kioConfig->group("Confirmations").writeEntry(keyName, false); + } + } + } if (del) { // We can't use KonqOperations here. To avoid duplicating its code (small, though),