Skip to content

Commit

Permalink
Merge branch 'polish_filemodel_errorhandling' into 'master'
Browse files Browse the repository at this point in the history
Polish filemodel errorhandling

See merge request mer-core/nemo-qml-plugin-filemanager!39
  • Loading branch information
pvuorela committed Jan 26, 2021
2 parents 17c4b7f + 5e5f279 commit 7d57db0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/plugin/filemodel.cpp
Expand Up @@ -90,6 +90,7 @@ QVector<StatFileInfo> directoryEntries(const QDir &dir)

FileModel::FileModel(QObject *parent) :
QAbstractListModel(parent),
m_errorType(NoError),
m_sortBy(SortByName),
m_directorySort(SortDirectoriesWithFiles),
m_sortOrder(Qt::AscendingOrder),
Expand Down
7 changes: 2 additions & 5 deletions tests/auto/tst_filemodel.qml
Expand Up @@ -35,13 +35,10 @@ import QtQuick 2.0
import Nemo.FileManager 1.0

Item {
property int lastError

FileModel {
id: fileModel
path: "folder"
active: true
onError: lastError = error
}

Repeater {
Expand Down Expand Up @@ -175,11 +172,11 @@ Item {
}

function test_errors() {
compare(lastError, FileModel.NoError)
compare(fileModel.errorType, FileModel.NoError)

fileModel.path = "hiddenfolder"
wait(0)
compare(lastError, FileModel.ErrorReadNoPermissions)
compare(fileModel.errorType, FileModel.ErrorReadNoPermissions)
}
}
}
Expand Down

0 comments on commit 7d57db0

Please sign in to comment.