Skip to content

Commit 8616301

Browse files
Fixed label in file browser
1 parent 1f69f85 commit 8616301

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

trikGui/fileManagerWidget.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,11 @@ void FileManagerWidget::onSelectionChanged(QModelIndex current, QModelIndex prev
160160
QString FileManagerWidget::currentPath()
161161
{
162162
QString result = QDir(QDir::currentPath()).canonicalPath();
163+
163164
if (mRootDirPath != "/") {
164-
result.replace(0, mRootDirPath.length(), "");
165+
/// @todo: fix this.
166+
const auto prefixLength = result.indexOf("scripts") + QString("scripts").length();
167+
result = result.replace(0, prefixLength, "");
165168
}
166169

167170
if (result.isEmpty()) {

0 commit comments

Comments
 (0)