Commit 7a114644 authored by Alex Neundorf's avatar Alex Neundorf

- 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
parent 32c9788b
...@@ -708,9 +708,14 @@ void KateMainWindow::slotDropEvent(QDropEvent *event) ...@@ -708,9 +708,14 @@ void KateMainWindow::slotDropEvent(QDropEvent *event)
KFileItem kitem(url); KFileItem kitem(url);
kitem.setDelayedMimeTypes(true); kitem.setDelayedMimeTypes(true);
if (kitem.isDir()) { if (kitem.isDir()) {
KIO::ListJob *list_job = KIO::listRecursive(url, KIO::DefaultFlags, false); if (KMessageBox::questionYesNo(this,
connect(list_job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), i18n("You dropped the directory %1 into Kate. "
this, SLOT(slotListRecursiveEntries(KIO::Job*,KIO::UDSEntryList))); "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 { } else {
m_viewManager->openUrl(url); m_viewManager->openUrl(url);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment