Skip to content

Commit 0807342

Browse files
committed
chaneged CurrentPathLabel in 'Files'
1 parent 0cb0e02 commit 0807342

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

trikGui/fileManagerWidget.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,21 @@ void FileManagerWidget::keyPressEvent(QKeyEvent *event)
9696
}
9797
}
9898

99+
QString FileManagerWidget::showCurrentPath()
100+
{
101+
QString result = QDir::currentPath();
102+
result.remove(mRootDirPath);
103+
104+
if (result.isEmpty()) {
105+
result = "/";
106+
}
107+
108+
return result;
109+
}
110+
99111
void FileManagerWidget::showCurrentDir()
100112
{
101-
mCurrentPathLabel.setText(QDir::currentPath());
113+
mCurrentPathLabel.setText(showCurrentPath());
102114

103115
QDir::Filters filters = mFileSystemModel.filter();
104116
if (QDir::currentPath() == mRootDirPath) {

trikGui/fileManagerWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ private slots:
6262
private:
6363
void showCurrentDir();
6464
void open();
65+
QString showCurrentPath();
6566

6667
QVBoxLayout mLayout;
6768
QLabel mCurrentPathLabel;

0 commit comments

Comments
 (0)