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_MINOR_LO 3
#define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_TYPE Beta
#define VER_LAMEXP_PATCH 1 #define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 680 #define VER_LAMEXP_BUILD 681
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Tools versions // Tools versions

View File

@ -534,7 +534,7 @@ void MainWindow::addFolder(const QString &path, bool recursive, bool delayed)
} }
QDir currentDir(folderInfoList.takeFirst().canonicalFilePath()); QDir currentDir(folderInfoList.takeFirst().canonicalFilePath());
QFileInfoList fileInfoList = currentDir.entryInfoList(QDir::Files); QFileInfoList fileInfoList = currentDir.entryInfoList(QDir::Files | QDir::NoSymLinks);
while(!fileInfoList.isEmpty()) while(!fileInfoList.isEmpty())
{ {
@ -732,11 +732,12 @@ void MainWindow::dropEvent(QDropEvent *event)
ABORT_IF_BUSY; ABORT_IF_BUSY;
QStringList droppedFiles; 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()) if(!file.exists())
{ {
continue; continue;
@ -747,13 +748,25 @@ void MainWindow::dropEvent(QDropEvent *event)
droppedFiles << file.canonicalFilePath(); droppedFiles << file.canonicalFilePath();
continue; continue;
} }
else if(file.isDir()) if(file.isDir())
{ {
qDebug64("Dropped Folder: %1", file.canonicalFilePath()); 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);
for(int j = 0; j < list.count(); j++) if(list.count() > 0)
{ {
droppedFiles << list.at(j).canonicalFilePath(); 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()));
}
} }
} }
} }