# HG changeset patch # User Chris Cannam # Date 1300277930 0 # Node ID b422d1bcfb3c3fb4d7e592c19d97243817b90e85 # Parent 987a094047c97f2ad2d004424a6df8fa00688133# Parent 076c2b3de51be3f470b4bb8dfad55a2fbe4cd120 Merge from branch "bug_92" diff -r 987a094047c9 -r b422d1bcfb3c mainwindow.cpp --- a/mainwindow.cpp Wed Mar 16 10:46:10 2011 +0000 +++ b/mainwindow.cpp Wed Mar 16 12:18:50 2011 +0000 @@ -1243,14 +1243,25 @@ QString MainWindow::complainAboutCloneToExistingFolder(QString arg, QString remote) { - // If the directory "arg" exists but "arg" plus the last path - // component of "remote" does not, then offer the latter as an - // alternative path + // If the directory "arg" exists but is empty, then we accept it. + + // If the directory "arg" exists and is non-empty, but "arg" plus + // the last path component of "remote" does not exist, then offer + // the latter as an alternative path. QString offer; QDir d(arg); + if (d.exists()) { + + if (d.entryList(QDir::Dirs | QDir::Files | + QDir::NoDotAndDotDot | + QDir::Hidden | QDir::System).empty()) { + // directory is empty; accept it + return arg; + } + if (QRegExp("^\\w+://").indexIn(remote) >= 0) { QString rpath = QUrl(remote).path(); if (rpath != "") {