From b1a991e8cd224e9d0d265666c4617211713ce528 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Tue, 27 Sep 2016 13:05:55 +0100 Subject: [PATCH] #5617 Revert "Remove plugin directory support" This reverts commit fc697d2ab79bbd2d607c97658c986b629a1280ed. --- src/lib/arch/unix/ArchFileUnix.cpp | 20 ++++++++++++++++++++ src/lib/arch/win32/ArchFileWindows.cpp | 18 ++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/lib/arch/unix/ArchFileUnix.cpp b/src/lib/arch/unix/ArchFileUnix.cpp index 4aaddae4..9dcc0b07 100644 --- a/src/lib/arch/unix/ArchFileUnix.cpp +++ b/src/lib/arch/unix/ArchFileUnix.cpp @@ -104,6 +104,20 @@ ArchFileUnix::getLogDirectory() return "/var/log"; } +std::string +ArchFileUnix::getPluginDirectory() +{ + if (!m_pluginDirectory.empty()) { + return m_pluginDirectory; + } + +#if WINAPI_XWINDOWS + return getProfileDirectory().append("/plugins"); +#else + return getProfileDirectory().append("/Plugins"); +#endif +} + std::string ArchFileUnix::getProfileDirectory() { @@ -141,3 +155,9 @@ ArchFileUnix::setProfileDirectory(const String& s) { m_profileDirectory = s; } + +void +ArchFileUnix::setPluginDirectory(const String& s) +{ + m_pluginDirectory = s; +} diff --git a/src/lib/arch/win32/ArchFileWindows.cpp b/src/lib/arch/win32/ArchFileWindows.cpp index 322323a4..373df72c 100644 --- a/src/lib/arch/win32/ArchFileWindows.cpp +++ b/src/lib/arch/win32/ArchFileWindows.cpp @@ -139,6 +139,18 @@ ArchFileWindows::getLogDirectory() return getInstalledDirectory(); } +std::string +ArchFileWindows::getPluginDirectory() +{ + if (!m_pluginDirectory.empty()) { + return m_pluginDirectory; + } + + std::string dir = getProfileDirectory(); + dir.append("\\Plugins"); + return dir; +} + std::string ArchFileWindows::getProfileDirectory() { @@ -183,3 +195,9 @@ ArchFileWindows::setProfileDirectory(const String& s) { m_profileDirectory = s; } + +void +ArchFileWindows::setPluginDirectory(const String& s) +{ + m_pluginDirectory = s; +}