2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
|
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
|
+
+
-
+
-
+
|
}
}
//------------------------------------------------------------------------------
void MainWindow::dragEnterEvent(QDragEnterEvent *event)
{
// Ignore drops from the same window
if(event->source() != this)
event->acceptProposedAction();
event->acceptProposedAction();
}
//------------------------------------------------------------------------------
void MainWindow::dropEvent(QDropEvent *event)
{
QList<QUrl> urls = event->mimeData()->urls();
if(urls.length()==0)
return;
// When dropping a folder or a checkout file, open the associated worksspace
QFileInfo finfo(urls.first().toLocalFile());
if(finfo.isDir() || finfo.suffix() == FOSSIL_EXT || finfo.fileName() == FOSSIL_CHECKOUT1 || finfo.fileName() == FOSSIL_CHECKOUT2 )
{
event->acceptProposedAction();
openWorkspace(finfo.absoluteFilePath());
}
else // Otherwise add
else // Otherwise if not a workspace file and within a workspace, add
{
QStringList newfiles;
Q_FOREACH(const QUrl &url, urls)
{
QFileInfo finfo(url.toLocalFile());
QString abspath = finfo.absoluteFilePath();
|