KIO

jobuidelegate.cpp
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2000 Stephan Kulow <[email protected]>
4  SPDX-FileCopyrightText: 2000 David Faure <[email protected]>
5  SPDX-FileCopyrightText: 2006 Kevin Ottens <[email protected]>
6  SPDX-FileCopyrightText: 2013 Dawit Alemayehu <[email protected]>
7  SPDX-FileCopyrightText: 2022 Harald Sitter <[email protected]>
8 
9  SPDX-License-Identifier: LGPL-2.0-or-later
10 */
11 
12 #include "jobuidelegate.h"
13 #include "kio_widgets_debug.h"
14 #include "kiogui_export.h"
15 #include "widgetsaskuseractionhandler.h"
16 #include "widgetsopenorexecutefilehandler.h"
17 #include "widgetsopenwithhandler.h"
18 #include "widgetsuntrustedprogramhandler.h"
19 #include <kio/jobuidelegatefactory.h>
20 
21 #include <KConfigGroup>
22 #include <KJob>
23 #include <KJobWidgets>
24 #include <KLocalizedString>
25 #include <KMessageBox>
26 #include <KSharedConfig>
27 #include <clipboardupdater_p.h>
28 #include <ksslinfodialog.h>
29 
30 #ifndef KIO_ANDROID_STUB
31 #include <QDBusInterface>
32 #endif
33 #include <QGuiApplication>
34 #include <QIcon>
35 #include <QPointer>
36 #include <QRegularExpression>
37 #include <QUrl>
38 #include <QWidget>
39 
40 class KIO::JobUiDelegatePrivate
41 {
42 public:
43  JobUiDelegatePrivate(KIO::JobUiDelegate *qq, const QList<QObject *> &ifaces)
44  {
45  for (auto iface : ifaces) {
46  iface->setParent(qq);
47  if (auto obj = qobject_cast<UntrustedProgramHandlerInterface *>(iface)) {
48  m_untrustedProgramHandler = obj;
49  } else if (auto obj = qobject_cast<OpenWithHandlerInterface *>(iface)) {
50  m_openWithHandler = obj;
51  } else if (auto obj = qobject_cast<OpenOrExecuteFileInterface *>(iface)) {
52  m_openOrExecuteFileHandler = obj;
53  } else if (auto obj = qobject_cast<AskUserActionInterface *>(iface)) {
54  m_askUserActionHandler = obj;
55  }
56  }
57 
58  if (!m_untrustedProgramHandler) {
59  m_untrustedProgramHandler = new WidgetsUntrustedProgramHandler(qq);
60  }
61  if (!m_openWithHandler) {
62  m_openWithHandler = new WidgetsOpenWithHandler(qq);
63  }
64  if (!m_openOrExecuteFileHandler) {
65  m_openOrExecuteFileHandler = new WidgetsOpenOrExecuteFileHandler(qq);
66  }
67  if (!m_askUserActionHandler) {
68  m_askUserActionHandler = new WidgetsAskUserActionHandler(qq);
69  }
70  }
71 
72  UntrustedProgramHandlerInterface *m_untrustedProgramHandler = nullptr;
73  OpenWithHandlerInterface *m_openWithHandler = nullptr;
74  OpenOrExecuteFileInterface *m_openOrExecuteFileHandler = nullptr;
75  AskUserActionInterface *m_askUserActionHandler = nullptr;
76 };
77 
78 #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 98)
80  : JobUiDelegate(Version::V2)
81 {
82 }
83 #endif
84 
86 
87 /*
88  Returns the top most window associated with widget.
89 
90  Unlike QWidget::window(), this function does its best to find and return the
91  main application window associated with the given widget.
92 
93  If widget itself is a dialog or its parent is a dialog, and that dialog has a
94  parent widget then this function will iterate through all those widgets to
95  find the top most window, which most of the time is the main window of the
96  application. By contrast, QWidget::window() would simply return the first
97  file dialog it encountered since it is the "next ancestor widget that has (or
98  could have) a window-system frame".
99 */
100 static QWidget *topLevelWindow(QWidget *widget)
101 {
102  QWidget *w = widget;
103  while (w && w->parentWidget()) {
104  w = w->parentWidget();
105  }
106  return (w ? w->window() : nullptr);
107 }
108 
109 class JobUiDelegateStatic : public QObject
110 {
111  Q_OBJECT
112 public:
113  void registerWindow(QWidget *wid)
114  {
115  if (!wid) {
116  return;
117  }
118 
119  QWidget *window = topLevelWindow(wid);
120  QObject *obj = static_cast<QObject *>(window);
121  if (!m_windowList.contains(obj)) {
122  // We must store the window Id because by the time
123  // the destroyed signal is emitted we can no longer
124  // access QWidget::winId() (already destructed)
125  WId windowId = window->winId();
126  m_windowList.insert(obj, windowId);
127  connect(window, &QObject::destroyed, this, &JobUiDelegateStatic::slotUnregisterWindow);
128 #ifndef KIO_ANDROID_STUB
129  QDBusInterface(QStringLiteral("org.kde.kded5"), QStringLiteral("/kded"), QStringLiteral("org.kde.kded5"))
130  .call(QDBus::NoBlock, QStringLiteral("registerWindowId"), qlonglong(windowId));
131 #endif
132  }
133  }
134 public Q_SLOTS:
135  void slotUnregisterWindow(QObject *obj)
136  {
137  if (!obj) {
138  return;
139  }
140 
141  QMap<QObject *, WId>::Iterator it = m_windowList.find(obj);
142  if (it == m_windowList.end()) {
143  return;
144  }
145  WId windowId = it.value();
146  disconnect(it.key(), &QObject::destroyed, this, &JobUiDelegateStatic::slotUnregisterWindow);
147  m_windowList.erase(it);
148 #ifndef KIO_ANDROID_STUB
149  QDBusInterface(QStringLiteral("org.kde.kded5"), QStringLiteral("/kded"), QStringLiteral("org.kde.kded5"))
150  .call(QDBus::NoBlock, QStringLiteral("unregisterWindowId"), qlonglong(windowId));
151 #endif
152  }
153 
154 private:
155  QMap<QObject *, WId> m_windowList;
156 };
157 
158 Q_GLOBAL_STATIC(JobUiDelegateStatic, s_static)
159 
160 #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 98)
162  : JobUiDelegate(Version::V2, flags, window)
163 {
164  setWindow(window);
165 }
166 #endif
167 
169 {
171 
172  if (auto obj = qobject_cast<WidgetsUntrustedProgramHandler *>(d->m_openWithHandler)) {
173  obj->setWindow(window);
174  }
175  if (auto obj = qobject_cast<WidgetsOpenWithHandler *>(d->m_untrustedProgramHandler)) {
176  obj->setWindow(window);
177  }
178  if (auto obj = qobject_cast<WidgetsOpenOrExecuteFileHandler *>(d->m_openOrExecuteFileHandler)) {
179  obj->setWindow(window);
180  }
181  if (auto obj = qobject_cast<WidgetsAskUserActionHandler *>(d->m_askUserActionHandler)) {
182  obj->setWindow(window);
183  }
184 
185  s_static()->registerWindow(window);
186 }
187 
189 {
190  s_static()->slotUnregisterWindow(window);
191 }
192 
194  const QString &title,
195  const QUrl &src,
196  const QUrl &dest,
198  QString &newDest,
199  KIO::filesize_t sizeSrc,
200  KIO::filesize_t sizeDest,
201  const QDateTime &ctimeSrc,
202  const QDateTime &ctimeDest,
203  const QDateTime &mtimeSrc,
204  const QDateTime &mtimeDest)
205 {
206  // qDebug() << "job=" << job;
207  // We now do it in process, so that opening the rename dialog
208  // doesn't start uiserver for nothing if progressId=0 (e.g. F2 in konq)
209  KIO::RenameDialog dlg(KJobWidgets::window(job), title, src, dest, options, sizeSrc, sizeDest, ctimeSrc, ctimeDest, mtimeSrc, mtimeDest);
211  connect(job, &KJob::finished, &dlg, &QDialog::reject); // #192976
212  KIO::RenameDialog_Result res = static_cast<RenameDialog_Result>(dlg.exec());
213  if (res == Result_AutoRename) {
214  newDest = dlg.autoDestUrl().path();
215  } else {
216  newDest = dlg.newDestUrl().path();
217  }
218  return res;
219 }
220 
222 {
223  KIO::SkipDialog dlg(KJobWidgets::window(job), options, error_text);
225  connect(job, &KJob::finished, &dlg, &QDialog::reject); // #192976
226  return static_cast<KIO::SkipDialog_Result>(dlg.exec());
227 }
228 
230 {
231  QString keyName;
232  bool ask = (confirmationType == ForceConfirmation);
233  if (!ask) {
234  KSharedConfigPtr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::NoGlobals);
235 
236  // The default value for confirmations is true for delete and false
237  // for trash. If you change this, please also update:
238  // dolphin/src/settings/general/confirmationssettingspage.cpp
239  bool defaultValue = true;
240 
241  switch (deletionType) {
242  case Delete:
243  keyName = QStringLiteral("ConfirmDelete");
244  break;
245  case Trash:
246  keyName = QStringLiteral("ConfirmTrash");
247  defaultValue = false;
248  break;
249  case EmptyTrash:
250  keyName = QStringLiteral("ConfirmEmptyTrash");
251  break;
252  }
253 
254  ask = kioConfig->group("Confirmations").readEntry(keyName, defaultValue);
255  }
256  if (ask) {
257  QStringList prettyList;
258  prettyList.reserve(urls.size());
259  for (const QUrl &url : urls) {
260  if (url.scheme() == QLatin1String("trash")) {
261  QString path = url.path();
262  // HACK (#98983): remove "0-foo". Note that it works better than
263  // displaying KFileItem::name(), for files under a subdir.
264  path.remove(QRegularExpression(QStringLiteral("^/[0-9]*-")));
265  prettyList.append(path);
266  } else {
267  prettyList.append(url.toDisplayString(QUrl::PreferLocalFile));
268  }
269  }
270 
271  int result;
272  QWidget *widget = window();
274  switch (deletionType) {
275  case Delete:
276  if (prettyList.count() == 1) {
278  widget,
279  xi18nc("@info",
280  "Do you really want to permanently delete this item?<nl/><filename>%1</filename><nl/><nl/><emphasis strong='true'>This action "
281  "cannot be undone.</emphasis>",
282  prettyList.first()),
283  i18n("Delete Permanently"),
284  KGuiItem(i18nc("@action:button", "Delete Permanently"), QStringLiteral("edit-delete")),
286  keyName,
287  options);
288  } else {
290  widget,
291  xi18ncp(
292  "@info",
293  "Do you really want to permanently delete this item?<nl/><nl/><emphasis strong='true'>This action cannot be undone.</emphasis>",
294  "Do you really want to permanently delete these %1 items?<nl/><nl/><emphasis strong='true'>This action cannot be undone.</emphasis>",
295  prettyList.count()),
296  prettyList,
297  i18n("Delete Permanently"),
298  KGuiItem(i18nc("@action:button", "Delete Permanently"), QStringLiteral("edit-delete")),
300  keyName,
301  options);
302  }
303  break;
304  case EmptyTrash:
306  widget,
307  xi18nc("@info",
308  "Do you want to permanently delete all items from the Trash?<nl/><nl/><emphasis strong='true'>This action cannot be undone.</emphasis>"),
309  i18n("Delete Permanently"),
310  KGuiItem(i18nc("@action:button", "Empty Trash"), QIcon::fromTheme(QStringLiteral("user-trash"))),
312  keyName,
313  options);
314  break;
315  case Trash:
316  default:
317  if (prettyList.count() == 1) {
319  widget,
320  xi18nc("@info", "Do you really want to move this item to the Trash?<nl/><filename>%1</filename>", prettyList.first()),
321  i18n("Move to Trash"),
322  KGuiItem(i18n("Move to Trash"), QStringLiteral("user-trash")),
324  keyName,
325  options);
326  } else {
328  widget,
329  i18np("Do you really want to move this item to the Trash?", "Do you really want to move these %1 items to the Trash?", prettyList.count()),
330  prettyList,
331  i18n("Move to Trash"),
332  KGuiItem(i18n("Move to Trash"), QStringLiteral("user-trash")),
334  keyName,
335  options);
336  }
337  }
338  if (!keyName.isEmpty()) {
339  // Check kmessagebox setting... erase & copy to konquerorrc.
340  KSharedConfig::Ptr config = KSharedConfig::openConfig();
341  KConfigGroup notificationGroup(config, "Notification Messages");
342  if (!notificationGroup.readEntry(keyName, true)) {
343  notificationGroup.writeEntry(keyName, true);
344  notificationGroup.sync();
345 
346  KSharedConfigPtr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::NoGlobals);
347  kioConfig->group("Confirmations").writeEntry(keyName, false);
348  }
349  }
350  return (result == KMessageBox::Continue);
351  }
352  return true;
353 }
354 
356  const QString &text,
357  const QString &title,
358  const QString &primaryActionText,
359  const QString &secondaryActionText,
360  const QString &primaryActionIconName,
361  const QString &secondaryActionIconName,
362  const QString &dontAskAgainName,
363  const KIO::MetaData &metaData)
364 {
365  int result = -1;
366 
367  // qDebug() << type << text << "title=" << title;
368 
369  KConfig config(QStringLiteral("kioslaverc"));
371 
372 #if KWIDGETSADDONS_BUILD_DEPRECATED_SINCE(5, 100)
373  QT_WARNING_PUSH
374  QT_WARNING_DISABLE_DEPRECATED
375  KGuiItem primaryActionTextGui = KStandardGuiItem::yes();
376  KGuiItem secondaryActionTextGui = KStandardGuiItem::no();
377  QT_WARNING_POP
378 
379  if (!primaryActionText.isEmpty()) {
380  primaryActionTextGui.setText(primaryActionText);
381  }
382  if (!primaryActionIconName.isNull()) {
383  primaryActionTextGui.setIconName(primaryActionIconName);
384  }
385 
386  if (!secondaryActionText.isEmpty()) {
387  secondaryActionTextGui.setText(secondaryActionText);
388  }
389  if (!secondaryActionIconName.isNull()) {
390  secondaryActionTextGui.setIconName(secondaryActionIconName);
391  }
392 #else
393  KGuiItem primaryActionTextGui(primaryActionText, primaryActionIconName);
394  KGuiItem secondaryActionTextGui(secondaryActionText, secondaryActionIconName);
395 #endif
396 
398 
399  switch (type) {
400  case QuestionTwoActions:
401  result = KMessageBox::questionTwoActions(window(), text, title, primaryActionTextGui, secondaryActionTextGui, dontAskAgainName, options);
402  break;
403  case WarningTwoActions:
404  result = KMessageBox::warningTwoActions(window(),
405  text,
406  title,
407  primaryActionTextGui,
408  secondaryActionTextGui,
409  dontAskAgainName,
410  options | KMessageBox::Dangerous);
411  break;
412  case WarningTwoActionsCancel:
413  result = KMessageBox::warningTwoActionsCancel(window(),
414  text,
415  title,
416  primaryActionTextGui,
417  secondaryActionTextGui,
419  dontAskAgainName,
420  options);
421  break;
422  case WarningContinueCancel:
423  result = KMessageBox::warningContinueCancel(window(), text, title, primaryActionTextGui, KStandardGuiItem::cancel(), dontAskAgainName, options);
424  break;
425  case Information:
426  KMessageBox::information(window(), text, title, dontAskAgainName, options);
427  result = 1; // whatever
428  break;
429  case SSLMessageBox: {
430  QPointer<KSslInfoDialog> kid(new KSslInfoDialog(window()));
431  // ### this is boilerplate code and appears in khtml_part.cpp almost unchanged!
432  const QStringList sl = metaData.value(QStringLiteral("ssl_peer_chain")).split(QLatin1Char('\x01'), Qt::SkipEmptyParts);
433  QList<QSslCertificate> certChain;
434  bool decodedOk = true;
435  for (const QString &s : sl) {
436  certChain.append(QSslCertificate(s.toLatin1())); // or is it toLocal8Bit or whatever?
437  if (certChain.last().isNull()) {
438  decodedOk = false;
439  break;
440  }
441  }
442 
443  if (decodedOk) {
444  result = 1; // whatever
445  kid->setSslInfo(certChain,
446  metaData.value(QStringLiteral("ssl_peer_ip")),
447  text, // the URL
448  metaData.value(QStringLiteral("ssl_protocol_version")),
449  metaData.value(QStringLiteral("ssl_cipher")),
450  metaData.value(QStringLiteral("ssl_cipher_used_bits")).toInt(),
451  metaData.value(QStringLiteral("ssl_cipher_bits")).toInt(),
452  KSslInfoDialog::certificateErrorsFromString(metaData.value(QStringLiteral("ssl_cert_errors"))));
453  kid->exec();
454  } else {
455  result = -1;
456  KMessageBox::information(window(), i18n("The peer SSL certificate chain appears to be corrupt."), i18n("SSL"), QString(), options);
457  }
458  // KSslInfoDialog deletes itself (Qt::WA_DeleteOnClose).
459  delete kid;
460  break;
461  }
462  case WarningContinueCancelDetailed: {
463  const QString details = metaData.value(QStringLiteral("privilege_conf_details"));
465  text,
466  title,
469  dontAskAgainName,
470  options | KMessageBox::Dangerous,
471  details);
472  break;
473  }
474  default:
475  qCWarning(KIO_WIDGETS) << "Unknown type" << type;
476  result = 0;
477  break;
478  }
480  return result;
481 }
482 
483 KIO::ClipboardUpdater *KIO::JobUiDelegate::createClipboardUpdater(Job *job, ClipboardUpdaterMode mode)
484 {
485  if (qobject_cast<QGuiApplication *>(qApp)) {
486  return new KIO::ClipboardUpdater(job, mode);
487  }
488  return nullptr;
489 }
490 
492 {
493  if (qobject_cast<QGuiApplication *>(qApp)) {
494  KIO::ClipboardUpdater::update(src, dest);
495  }
496 }
497 
498 KIO::JobUiDelegate::JobUiDelegate(Version version, KJobUiDelegate::Flags /*flags*/, QWidget *window, const QList<QObject *> &ifaces)
499  : d(new JobUiDelegatePrivate(this, ifaces))
500 {
501  // TODO KF6: drop the version argument and replace the deprecated constructor
502  // TODO KF6: change the API to accept QWindows rather than QWidgets (this also carries through to the Interfaces)
503  if (window) {
504  s_static()->registerWindow(window);
505  setWindow(window);
506  }
507 
508  Q_UNUSED(version); // only serves to disambiguate constructors
509 }
510 
511 class KIOWidgetJobUiDelegateFactory : public KIO::JobUiDelegateFactoryV2
512 {
513 public:
514  using KIO::JobUiDelegateFactoryV2::JobUiDelegateFactoryV2;
515 
516  KJobUiDelegate *createDelegate() const override
517  {
518  return new KIO::JobUiDelegate(KIO::JobUiDelegate::Version::V2);
519  }
520 
521  KJobUiDelegate *createDelegate(KJobUiDelegate::Flags flags, QWidget *window) const override
522  {
523  return new KIO::JobUiDelegate(KIO::JobUiDelegate::Version::V2, flags, window);
524  }
525 
526  static void registerJobUiDelegate()
527  {
528  static KIOWidgetJobUiDelegateFactory factory;
530 
531  static KIO::JobUiDelegate delegate(KIO::JobUiDelegate::Version::V2);
533  }
534 };
535 
536 // Simply linking to this library, creates a GUI job delegate and delegate extension for all KIO jobs
537 static void registerJobUiDelegate()
538 {
539  // Inside the factory class so it is a friend of the delegate and can construct it.
540  KIOWidgetJobUiDelegateFactory::registerJobUiDelegate();
541 }
542 
543 Q_CONSTRUCTOR_FUNCTION(registerJobUiDelegate)
544 
545 #include "jobuidelegate.moc"
void append(const T &value)
QString xi18ncp(const char *context, const char *singular, const char *plural, const TYPE &arg...)
T & first()
DeletionType
The type of deletion: real deletion, moving the files to the trash or emptying the trash Used by askD...
QString readEntry(const char *key, const char *aDefault=nullptr) const
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
bool isNull() const const
RenameDialog_Result askFileRename(KJob *job, const QString &title, const QUrl &src, const QUrl &dest, KIO::RenameDialog_Options options, QString &newDest, KIO::filesize_t sizeSrc=KIO::filesize_t(-1), KIO::filesize_t sizeDest=KIO::filesize_t(-1), const QDateTime &ctimeSrc=QDateTime(), const QDateTime &ctimeDest=QDateTime(), const QDateTime &mtimeSrc=QDateTime(), const QDateTime &mtimeDest=QDateTime()) override
QWidget * window() const const
QString xi18nc(const char *context, const char *text, const TYPE &arg...)
void finished(KJob *job)
void setDontShowAgainConfig(KConfig *cfg)
virtual void reject()
ButtonCode warningContinueCancel(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
qulonglong filesize_t
64-bit file size
Definition: global.h:39
const T value(const Key &key, const T &defaultValue) const const
int count(const T &value) const const
WindowModal
ClipboardUpdater * createClipboardUpdater(Job *job, ClipboardUpdaterMode mode) override
Creates a clipboard updater.
QIcon fromTheme(const QString &name)
bool isNull() const const
QDBusMessage call(const QString &method, Args &&... args)
KIOCORE_EXPORT void setDefaultJobUiDelegateExtension(JobUiDelegateExtension *extension)
Internal.
static KSharedConfig::Ptr openConfig(const QString &fileName=QString(), OpenFlags mode=FullConfig, QStandardPaths::StandardLocation type=QStandardPaths::GenericConfigLocation)
void setWindow(QWidget *window) override
Associate this job with a window given by window.
Q_GLOBAL_STATIC(Internal::StaticControl, s_instance) class ControlPrivate
void reserve(int alloc)
KGuiItem cancel()
void destroyed(QObject *obj)
JobUiDelegate()
Constructs a new KIO Job UI delegate.
int size() const const
QString i18n(const char *text, const TYPE &arg...)
QMap::iterator find(const Key &key)
KIOCORE_EXPORT void setDefaultJobUiDelegateFactoryV2(JobUiDelegateFactoryV2 *factory)
Internal.
PreferLocalFile
~JobUiDelegate() override
Destroys the KIO Job UI delegate.
SkipEmptyParts
virtual void setWindow(QWidget *window)
bool isEmpty() const const
void setWindowModality(Qt::WindowModality windowModality)
ButtonCode warningContinueCancelList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
void updateUrlInClipboard(const QUrl &src, const QUrl &dest) override
Update URL in clipboard, if present.
QWidget * window() const
KGuiItem yes()
ConfirmationType
ForceConfirmation: always ask the user for confirmation DefaultConfirmation: don't ask the user if he...
ButtonCode warningTwoActions(QWidget *parent, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName=QString(), Options options=Options(Notify|Dangerous))
virtual int exec()
ButtonCode questionTwoActions(QWidget *parent, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName=QString(), Options options=Notify)
SkipDialog_Result askSkip(KJob *job, KIO::SkipDialog_Options options, const QString &error_text) override
const Key key(const T &value, const Key &defaultKey) const const
void setText(const QString &text)
static void unregisterWindow(QWidget *window)
Unregister the given window from kded.
T & last()
QString & remove(int position, int n)
KDE SSL Information Dialog.
QString i18np(const char *singular, const char *plural, const TYPE &arg...)
QString path(QUrl::ComponentFormattingOptions options) const const
ButtonCode warningContinueCancelDetailed(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify, const QString &details=QString())
KGuiItem cont()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
WId winId() const const
bool sync() override
static QList< QList< QSslError::SslError > > certificateErrorsFromString(const QString &errorsString)
Converts certificate errors as provided in the "ssl_cert_errors" meta data to a list of QSslError::Ss...
void information(QWidget *parent, const QString &text, const QString &title=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
void setIconName(const QString &iconName)
RenameDialog_Result
The result of a rename or skip dialog.
KJOBWIDGETS_EXPORT QWidget * window(KJob *job)
int requestMessageBox(MessageBoxType type, const QString &text, const QString &title, const QString &primaryActionText, const QString &secondaryActionText, const QString &primaryActionIconName=QString(), const QString &secondaryActionIconName=QString(), const QString &dontAskAgainName=QString(), const KIO::MetaData &metaData=KIO::MetaData()) override
This function allows for the delegation user prompts from the KIO workers.
ButtonCode warningTwoActionsCancel(QWidget *parent, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const KGuiItem &cancelAction=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Options(Notify|Dangerous))
QUrl autoDestUrl() const
QWidget * parentWidget() const const
bool askDeleteConfirmation(const QList< QUrl > &urls, DeletionType deletionType, ConfirmationType confirmationType) override
Ask for confirmation before deleting/trashing urls.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 23 2023 03:59:41 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.