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