Skip to content

Commit

Permalink
Merge branch 'jb47766-filemodel-permissions' into 'master'
Browse files Browse the repository at this point in the history
[nemo-filemanager] Don't make FileModel loading depending on access permissions. JB#47766

See merge request mer-core/nemo-qml-plugin-filemanager!28
  • Loading branch information
blam committed Apr 20, 2020
2 parents 1084494 + 1d03d36 commit 7f97543
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugin/filemodel.cpp
Expand Up @@ -59,11 +59,11 @@ enum {
BaseNameRole
};

int access(QString fileName, int how)
int euidaccess(QString fileName, int how)
{
QByteArray fab = fileName.toUtf8();
char *fn = fab.data();
return ::access(fn, how);
return ::euidaccess(fn, how);
}

QVector<StatFileInfo> directoryEntries(const QDir &dir)
Expand Down Expand Up @@ -461,7 +461,7 @@ void FileModel::readAllEntries()
return;
}

if (access(dir.path(), R_OK) == -1) {
if (euidaccess(dir.path(), R_OK) == -1) {
qmlInfo(this) << "No permissions to access " << dir.path();
emit error(ErrorReadNoPermissions, dir.path());
return;
Expand All @@ -488,7 +488,7 @@ void FileModel::refreshEntries()
return;
}

if (access(dir.path(), R_OK) == -1) {
if (euidaccess(dir.path(), R_OK) == -1) {
clearModel();
qmlInfo(this) << "No permissions to access " << dir.path();
emit error(ErrorReadNoPermissions, dir.path());
Expand Down

0 comments on commit 7f97543

Please sign in to comment.