Skip to content

Commit a7331df

Browse files
committed
Fix file browser
1 parent b97aaac commit a7331df

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

gcodeworkshop/src/gcodeworkshop.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2219,6 +2219,7 @@ void GCodeWorkShop::loadFile(const DocumentInfo::Ptr& info, bool checkAlreadyLoa
22192219
setLastOpenedPath(file.path());
22202220
updateStatusBar();
22212221
m_recentFiles->add(info->filePath);
2222+
fileTreeViewChangeRootDir();
22222223
} else {
22232224
QMessageBox::warning(this, tr("GCodeWorkShop"), tr("Cannot read file \"%1\".\n %2")
22242225
.arg(doc->filePath()).arg(doc->ioErrorString()));
@@ -3222,7 +3223,7 @@ void GCodeWorkShop::fileTreeViewChangeRootDir()
32223223
return;
32233224
}
32243225

3225-
if (ui->currentPathCheckBox->isChecked() && (activeDocument() != nullptr)) {
3226+
if (ui->currentPathCheckBox->isChecked() && (activeDocument() != nullptr) && !activeDocument()->isUntitled()) {
32263227
path = activeDocument()->filePath();
32273228

32283229
if (QFileInfo(path).exists()) {

0 commit comments

Comments
 (0)