Skip to content

Commit

Permalink
[filemanager] Add FileEngine::dirExists method. Contributes to JB#45287
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Kristóf committed Jun 9, 2019
1 parent 64b2926 commit cc4bf1c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/plugin/fileengine.cpp
Expand Up @@ -170,6 +170,16 @@ bool FileEngine::exists(QString fileName)
return QFile::exists(fileName);
}

bool FileEngine::dirExists(const QString &path)
{
if (path.isEmpty()) {
return false;
}

QDir dir(path);
return dir.exists();
}

bool FileEngine::mkdir(QString path, QString name, bool nonprivileged)
{
if (!m_fileWorker->mkdir(path, name, nonprivileged)) {
Expand Down
1 change: 1 addition & 0 deletions src/plugin/fileengine.h
Expand Up @@ -96,6 +96,7 @@ class FileEngine : public QObject

// synchronous methods
Q_INVOKABLE bool exists(QString fileName);
Q_INVOKABLE bool dirExists(const QString &path);
Q_INVOKABLE bool mkdir(QString path, QString name, bool nonprivileged = false);
Q_INVOKABLE bool rename(QString fullOldFileName, QString newName, bool nonprivileged = false);
Q_INVOKABLE bool chmod(QString path,
Expand Down

0 comments on commit cc4bf1c

Please sign in to comment.