D17599: Confirm closing muliple tabs.

Milian Wolff noreply at phabricator.kde.org
Sat Jan 12 12:32:25 GMT 2019


mwolff resigned from this revision.
mwolff added inline comments.

INLINE COMMENTS

> katemainwindow.cpp:1200
> +
> +    if (closedByUser && KateApp::self()->documentManager()->documentList().count() > 1 && KateApp::self()->mainWindowsCount() == 1) {
> +        KGuiItem yes(i18nc("@action:button 'Quit Kate' button", "&Quit %1", QGuiApplication::applicationDisplayName()),

introduce three more locals to make this line less long:

  const bool closedByUser = !qApp->isSavingSession();
  const bool numDocuments = KateApp::self()->documentManager()->documentList().count();
  const bool numWindows = KateApp::self()->mainWindowsCount();
  const bool askConfirmation = closedByUser && numDocuments > 1 && numWindows == 1;
  
  if (askConfirmation) {
   ...

why is the number of windows affecting this btw? I mean when I close a window with multiple tabs, it should ask for confirmation, no? Why is this only asked when there is just one window?

Note that closing a single window is different from quitting the application.

REPOSITORY
  R40 Kate

REVISION DETAIL
  https://phabricator.kde.org/D17599

To: shubham, dhaumann, #kate, sars
Cc: mwolff, ngraham, pino, kwrite-devel, hase, michaelh, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190112/45a00778/attachment.html>


More information about the KWrite-Devel mailing list