Editors: Support drag & drop from bookmarks pane

Change-Id: I9b68d35b04968779f111885ba7a24f18fecfada5
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Eike Ziller
2014-09-12 12:52:34 +02:00
parent 72c33cbadd
commit fd9b2af921
13 changed files with 136 additions and 55 deletions

View File

@@ -73,7 +73,7 @@
#include <coreplugin/progressmanager/progressmanager_p.h>
#include <coreplugin/progressmanager/progressview.h>
#include <coreplugin/settingsdatabase.h>
#include <utils/fileutils.h>
#include <utils/algorithm.h>
#include <utils/historycompleter.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
@@ -212,8 +212,8 @@ MainWindow::MainWindow() :
auto dropSupport = new Utils::FileDropSupport(this, [](QDropEvent *event) {
return event->source() == 0; // only accept drops from the "outside" (e.g. file manager)
});
connect(dropSupport, SIGNAL(filesDropped(QStringList)),
this, SLOT(openDroppedFiles(QStringList)));
connect(dropSupport, &Utils::FileDropSupport::filesDropped,
this, &MainWindow::openDroppedFiles);
}
void MainWindow::setSidebarVisible(bool visible)
@@ -384,10 +384,14 @@ void MainWindow::closeEvent(QCloseEvent *event)
event->accept();
}
void MainWindow::openDroppedFiles(const QStringList &files)
void MainWindow::openDroppedFiles(const QList<Utils::FileDropSupport::FileSpec> &files)
{
raiseWindow();
openFiles(files, ICore::SwitchMode);
QStringList filePaths = Utils::transform(files,
[](const Utils::FileDropSupport::FileSpec &spec) -> QString {
return spec.filePath;
});
openFiles(filePaths, ICore::SwitchMode);
}
IContext *MainWindow::currentContextObject() const