refs #209, fileExists method (remote enabled)

This commit is contained in:
Klaus Basan
2014-04-16 23:41:35 +02:00
parent 3c42a91596
commit 7930560be6
4 changed files with 18 additions and 0 deletions

View File

@@ -127,6 +127,9 @@ namespace BlackCore
//! Remote enabled version of deleting a file
virtual bool removeFile(const QString &fileName) = 0;
//! Remote enabled version of file exists
virtual bool existsFile(const QString &fileName) = 0;
private:
//! All contexts, used with messageHandler
static QList<IContextApplication *> s_contexts;

View File

@@ -99,4 +99,13 @@ namespace BlackCore
return QFile::remove(fileName);
}
/*
* Check file
*/
bool CContextApplication::existsFile(const QString &fileName)
{
if (fileName.isEmpty()) return false;
return QFile::exists(fileName);
}
} // namespace

View File

@@ -45,6 +45,9 @@ namespace BlackCore
//! \copydoc IContextApplication::removeFile
virtual bool removeFile(const QString &fileName) override;
//! \copydoc IContextApplication::existsFile
virtual bool existsFile(const QString &fileName) override;
protected:
//! Constructor
CContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime);

View File

@@ -46,6 +46,9 @@ namespace BlackCore
//! \copydoc IContextApplication::removeFile
virtual bool removeFile(const QString &fileName) override;
//! \copydoc IContextApplication::existsFile
virtual bool existsFile(const QString &fileName) override;
protected:
//! Constructor
CContextApplicationProxy(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextApplication(mode, runtime), m_dBusInterface(nullptr) {}