When a folder that does NOT contain any files is dropped, descent into its sub-folders (if any).

This commit is contained in:
LoRd_MuldeR 2011-09-05 15:36:58 +02:00
parent b687666ac9
commit 9e9b3ed25e
2 changed files with 22 additions and 9 deletions

View File

@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 3
#define VER_LAMEXP_TYPE Beta
#define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 680
#define VER_LAMEXP_BUILD 681
///////////////////////////////////////////////////////////////////////////////
// Tools versions

View File

@ -534,7 +534,7 @@ void MainWindow::addFolder(const QString &path, bool recursive, bool delayed)
}
QDir currentDir(folderInfoList.takeFirst().canonicalFilePath());
QFileInfoList fileInfoList = currentDir.entryInfoList(QDir::Files);
QFileInfoList fileInfoList = currentDir.entryInfoList(QDir::Files | QDir::NoSymLinks);
while(!fileInfoList.isEmpty())
{
@ -732,11 +732,12 @@ void MainWindow::dropEvent(QDropEvent *event)
ABORT_IF_BUSY;
QStringList droppedFiles;
const QList<QUrl> urls = event->mimeData()->urls();
QList<QUrl> urls = event->mimeData()->urls();
for(int i = 0; i < urls.count(); i++)
while(!urls.isEmpty())
{
QFileInfo file(urls.at(i).toLocalFile());
QUrl currentUrl = urls.takeFirst();
QFileInfo file(currentUrl.toLocalFile());
if(!file.exists())
{
continue;
@ -747,15 +748,27 @@ void MainWindow::dropEvent(QDropEvent *event)
droppedFiles << file.canonicalFilePath();
continue;
}
else if(file.isDir())
if(file.isDir())
{
qDebug64("Dropped Folder: %1", file.canonicalFilePath());
QList<QFileInfo> list = QDir(file.canonicalFilePath()).entryInfoList(QDir::Files);
QList<QFileInfo> list = QDir(file.canonicalFilePath()).entryInfoList(QDir::Files | QDir::NoSymLinks);
if(list.count() > 0)
{
for(int j = 0; j < list.count(); j++)
{
droppedFiles << list.at(j).canonicalFilePath();
}
}
else
{
list = QDir(file.canonicalFilePath()).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
for(int j = 0; j < list.count(); j++)
{
qDebug64("Descending to Folder: %1", list.at(j).canonicalFilePath());
urls.prepend(QUrl::fromLocalFile(list.at(j).canonicalFilePath()));
}
}
}
}
if(!droppedFiles.isEmpty())