File tree 2 files changed +13
-0
lines changed
src/plugin/folderlistmodel
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -452,9 +452,15 @@ void DirModel::setPathFromCurrentLocation()
452
452
{
453
453
mPathList .append (mCurrentDir );
454
454
}
455
+
456
+ emit canGoBackChanged ();
455
457
emit pathChanged (mCurLocation ->urlPath ());
456
458
}
457
459
460
+ bool DirModel::canGoBack () const
461
+ {
462
+ return mPathList .count () > 1 ;
463
+ }
458
464
459
465
void DirModel::goBack ()
460
466
{
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ class ExternalFSWatcher;
52
52
class DirModel : public DirItemAbstractListModel
53
53
{
54
54
Q_OBJECT
55
+
55
56
public:
56
57
enum Roles {
57
58
FileNameRole = Qt::UserRole,
@@ -119,7 +120,12 @@ class DirModel : public DirItemAbstractListModel
119
120
Q_INVOKABLE QString curPathModifiedDateLocaleShort () const ;
120
121
Q_INVOKABLE bool curPathIsWritable () const ;
121
122
123
+ Q_PROPERTY (bool canGoBack READ canGoBack NOTIFY canGoBackChanged)
124
+
125
+ bool canGoBack () const ;
126
+
122
127
Q_PROPERTY (bool awaitingResults READ awaitingResults NOTIFY awaitingResultsChanged)
128
+
123
129
bool awaitingResults () const ;
124
130
125
131
Q_INVOKABLE void rm (const QStringList &paths);
@@ -150,6 +156,7 @@ public slots:
150
156
void onItemsFetched ();
151
157
152
158
signals:
159
+ void canGoBackChanged ();
153
160
void awaitingResultsChanged ();
154
161
void nameFiltersChanged ();
155
162
void filterDirectoriesChanged ();
You can’t perform that action at this time.
0 commit comments