Fixed #1870 (Wrong path in report)

Current directory was set from first file in the list. That file
could be in subdirectory when wrong path was set. Also getting
absolute path was buggy.
This commit is contained in:
Kimmo Varis 2010-07-18 12:57:48 +03:00
parent c16b5d6f3a
commit 50b41a25de
1 changed files with 3 additions and 2 deletions

View File

@ -235,8 +235,8 @@ void MainWindow::DoCheckFiles(const QStringList &files)
mUI.mResults->CheckingStarted(fileNames.count());
mThread->SetFiles(RemoveUnacceptedFiles(fileNames));
QFileInfo inf(fileNames[0]);
QString absDirectory = inf.absoluteDir().path();
QDir inf(mCurrentDirectory);
const QString absDirectory = inf.absolutePath();
mSettings->setValue(SETTINGS_CHECK_PATH, absDirectory);
EnableCheckButtons(false);
mUI.mActionSettings->setEnabled(false);
@ -278,6 +278,7 @@ QStringList MainWindow::SelectFilesToCheck(QFileDialog::FileMode mode)
mSettings->value(SETTINGS_CHECK_PATH, "").toString());
if (!dir.isEmpty())
{
qDebug() << "Setting current directory to: " << dir;
mCurrentDirectory = dir;
selected.append(dir);
dir = QDir::toNativeSeparators(dir);