[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kate] kate: - ask user for confirmation when dropping a directory
From:       Alex Neundorf <null () kde ! org>
Date:       2017-08-31 20:32:58
Message-ID: E1dnW94-0007OL-Ej () code ! kde ! org
[Download RAW message or body]

Git commit 7a1146443c1ccf486ede21e51545241184579ec5 by Alex Neundorf.
Committed on 31/08/2017 at 20:26.
Pushed by neundorf into branch 'master'.

- ask user for confirmation when dropping a directory

When dropping a directory into kate, now there is a messagebox which asks
the user whether he really wants to load all files contained in that
directory. To me this usually happened accidentially and basically killed kate
(because it started to load hundreds of files).

Alex

M  +8    -3    kate/katemainwindow.cpp

https://commits.kde.org/kate/7a1146443c1ccf486ede21e51545241184579ec5

diff --git a/kate/katemainwindow.cpp b/kate/katemainwindow.cpp
index 862e44920..39dd96e85 100644
--- a/kate/katemainwindow.cpp
+++ b/kate/katemainwindow.cpp
@@ -708,9 +708,14 @@ void KateMainWindow::slotDropEvent(QDropEvent *event)
             KFileItem kitem(url);
             kitem.setDelayedMimeTypes(true);
             if (kitem.isDir()) {
-                KIO::ListJob *list_job = KIO::listRecursive(url, KIO::DefaultFlags, \
                false);
-                connect(list_job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)),
-                        this, \
SLOT(slotListRecursiveEntries(KIO::Job*,KIO::UDSEntryList))); +                if \
(KMessageBox::questionYesNo(this, +                                               \
i18n("You dropped the directory %1 into Kate. " +                                     \
"Do you want to load all files contained in it ?", url.url()), +                      \
i18n("Load files recursively?")) == KMessageBox::Yes) { +                    \
KIO::ListJob *list_job = KIO::listRecursive(url, KIO::DefaultFlags, false); +         \
connect(list_job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), +                     \
this, SLOT(slotListRecursiveEntries(KIO::Job*,KIO::UDSEntryList))); +                \
}  } else {
                 m_viewManager->openUrl(url);
             }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic