aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Neundorf <[email protected]>2017-08-31 22:26:46 +0200
committerAlex Neundorf <[email protected]>2017-08-31 22:26:46 +0200
commit7a1146443c1ccf486ede21e51545241184579ec5 (patch)
tree478425d6f7910f25dec3ad655b00b11d0385f0ff
parent32c9788b0e95520c9e606fb288e7b79c1b25654a (diff)
- 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
-rw-r--r--kate/katemainwindow.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/kate/katemainwindow.cpp b/kate/katemainwindow.cpp
index 862e449..39dd96e 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);
}