diff --git a/src/blackcore/context/contextapplication.h b/src/blackcore/context/contextapplication.h index 6aa76cfaf..e29bd3030 100644 --- a/src/blackcore/context/contextapplication.h +++ b/src/blackcore/context/contextapplication.h @@ -146,18 +146,6 @@ namespace BlackCore //! Identifier of application, remote side if distributed virtual BlackMisc::CIdentifier getApplicationIdentifier() const = 0; - //! Remote enabled version of writing a text file - virtual bool writeToFile(const QString &fileName, const QString &content) = 0; - - //! Remote enabled version of reading a text file - virtual QString readFromFile(const QString &fileName) const = 0; - - //! 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) const = 0; - //! Forward to facade virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override; diff --git a/src/blackcore/context/contextapplicationempty.h b/src/blackcore/context/contextapplicationempty.h index 1ee04dad4..2959c5fce 100644 --- a/src/blackcore/context/contextapplicationempty.h +++ b/src/blackcore/context/contextapplicationempty.h @@ -103,15 +103,6 @@ namespace BlackCore logEmptyContextWarning(Q_FUNC_INFO); } - //! \copydoc IContextApplication::writeToFile - virtual bool writeToFile(const QString &fileName, const QString &content) override - { - Q_UNUSED(fileName); - Q_UNUSED(content); - logEmptyContextWarning(Q_FUNC_INFO); - return false; - } - //! \copydoc IContextApplication::registerApplication virtual BlackMisc::CIdentifier registerApplication(const BlackMisc::CIdentifier &application) override { @@ -141,30 +132,6 @@ namespace BlackCore return BlackMisc::CIdentifier(); } - //! \copydoc IContextApplication::readFromFile - virtual QString readFromFile(const QString &fileName) const override - { - Q_UNUSED(fileName); - logEmptyContextWarning(Q_FUNC_INFO); - return QString(); - } - - //! \copydoc IContextApplication::removeFile - virtual bool removeFile(const QString &fileName) override - { - Q_UNUSED(fileName); - logEmptyContextWarning(Q_FUNC_INFO); - return false; - } - - //! \copydoc IContextApplication::existsFile - virtual bool existsFile(const QString &fileName) const override - { - Q_UNUSED(fileName); - logEmptyContextWarning(Q_FUNC_INFO); - return false; - } - //! \copydoc IContextApplication::dotCommandsHtmlHelp virtual QString dotCommandsHtmlHelp() const override { diff --git a/src/blackcore/context/contextapplicationimpl.cpp b/src/blackcore/context/contextapplicationimpl.cpp index 391c04d33..e9654773e 100644 --- a/src/blackcore/context/contextapplicationimpl.cpp +++ b/src/blackcore/context/contextapplicationimpl.cpp @@ -104,20 +104,6 @@ namespace BlackCore::Context } } - bool CContextApplication::writeToFile(const QString &fileName, const QString &content) - { - if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << fileName << content.left(25); } - if (fileName.isEmpty()) { return false; } - QFile file(fileName); - if (file.open(QIODevice::WriteOnly | QIODevice::Text)) - { - QTextStream out(&file); - out << content; - return true; - } - return false; - } - CIdentifier CContextApplication::registerApplication(const CIdentifier &application) { if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << application; } @@ -161,35 +147,6 @@ namespace BlackCore::Context return this->identifier(); } - QString CContextApplication::readFromFile(const QString &fileName) const - { - if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << fileName; } - QFile file(fileName); - QString content; - if (fileName.isEmpty()) return content; - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) - { - QTextStream in(&file); - in >> content; - file.close(); - } - return content; - } - - bool CContextApplication::removeFile(const QString &fileName) - { - if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << fileName; } - if (fileName.isEmpty()) { return false; } - return QFile::remove(fileName); - } - - bool CContextApplication::existsFile(const QString &fileName) const - { - if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << fileName; } - if (fileName.isEmpty()) return false; - return QFile::exists(fileName); - } - QString CContextApplication::dotCommandsHtmlHelp() const { return CSimpleCommandParser::commandsHtmlHelp(); diff --git a/src/blackcore/context/contextapplicationimpl.h b/src/blackcore/context/contextapplicationimpl.h index 9da5cc12e..257bb95dc 100644 --- a/src/blackcore/context/contextapplicationimpl.h +++ b/src/blackcore/context/contextapplicationimpl.h @@ -71,9 +71,6 @@ namespace BlackCore //! \copydoc BlackCore::Context::IContextApplication::callHotkeyActionRemotely virtual void callHotkeyActionRemotely(const QString &action, bool argument, const BlackMisc::CIdentifier &origin) override; - //! \copydoc BlackCore::Context::IContextApplication::writeToFile - virtual bool writeToFile(const QString &fileName, const QString &content) override; - //! \copydoc BlackCore::Context::IContextApplication::registerApplication virtual BlackMisc::CIdentifier registerApplication(const BlackMisc::CIdentifier &application) override; @@ -86,15 +83,6 @@ namespace BlackCore //! \copydoc BlackCore::Context::IContextApplication::getApplicationIdentifier virtual BlackMisc::CIdentifier getApplicationIdentifier() const override; - //! \copydoc BlackCore::Context::IContextApplication::readFromFile - virtual QString readFromFile(const QString &fileName) const override; - - //! \copydoc BlackCore::Context::IContextApplication::removeFile - virtual bool removeFile(const QString &fileName) override; - - //! \copydoc BlackCore::Context::IContextApplication::existsFile - virtual bool existsFile(const QString &fileName) const override; - //! \copydoc BlackCore::Context::IContextApplication::dotCommandsHtmlHelp virtual QString dotCommandsHtmlHelp() const override; diff --git a/src/blackcore/context/contextapplicationproxy.cpp b/src/blackcore/context/contextapplicationproxy.cpp index cf0e734b2..6e2d6de23 100644 --- a/src/blackcore/context/contextapplicationproxy.cpp +++ b/src/blackcore/context/contextapplicationproxy.cpp @@ -129,30 +129,6 @@ namespace BlackCore::Context return m_dBusInterface->callDBusRet(QLatin1String("getApplicationIdentifier")); } - bool CContextApplicationProxy::writeToFile(const QString &fileName, const QString &content) - { - if (fileName.isEmpty()) { return false; } - return m_dBusInterface->callDBusRet(QLatin1String("writeToFile"), fileName, content); - } - - QString CContextApplicationProxy::readFromFile(const QString &fileName) const - { - if (fileName.isEmpty()) { return {}; } - return m_dBusInterface->callDBusRet(QLatin1String("readFromFile"), fileName); - } - - bool CContextApplicationProxy::removeFile(const QString &fileName) - { - if (fileName.isEmpty()) { return false; } - return m_dBusInterface->callDBusRet(QLatin1String("removeFile"), fileName); - } - - bool CContextApplicationProxy::existsFile(const QString &fileName) const - { - if (fileName.isEmpty()) { return false; } - return m_dBusInterface->callDBusRet(QLatin1String("existsFile"), fileName); - } - QString CContextApplicationProxy::dotCommandsHtmlHelp() const { return m_dBusInterface->callDBusRet(QLatin1String("dotCommandsHtmlHelp")); diff --git a/src/blackcore/context/contextapplicationproxy.h b/src/blackcore/context/contextapplicationproxy.h index 776931a45..c7344f83b 100644 --- a/src/blackcore/context/contextapplicationproxy.h +++ b/src/blackcore/context/contextapplicationproxy.h @@ -86,18 +86,6 @@ namespace BlackCore //! \copydoc BlackCore::Context::IContextApplication::getApplicationIdentifier virtual BlackMisc::CIdentifier getApplicationIdentifier() const override; - //! \copydoc BlackCore::Context::IContextApplication::writeToFile - virtual bool writeToFile(const QString &fileName, const QString &content) override; - - //! \copydoc BlackCore::Context::IContextApplication::readFromFile - virtual QString readFromFile(const QString &fileName) const override; - - //! \copydoc BlackCore::Context::IContextApplication::removeFile - virtual bool removeFile(const QString &fileName) override; - - //! \copydoc BlackCore::Context::IContextApplication::existsFile - virtual bool existsFile(const QString &fileName) const override; - //! \copydoc BlackCore::Context::IContextApplication::dotCommandsHtmlHelp virtual QString dotCommandsHtmlHelp() const override;