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 006c9f17d4
commit d8077cf2f7
1 changed files with 3 additions and 2 deletions

View File

@ -229,8 +229,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);
@ -272,6 +272,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);