mirror of
https://github.com/debauchee/barrier.git
synced 2026-07-03 18:37:24 +08:00
Fixed: Plugins dir may change depending on user #4168
This commit is contained in:
@@ -107,6 +107,10 @@ ArchFileUnix::getLogDirectory()
|
||||
std::string
|
||||
ArchFileUnix::getPluginDirectory()
|
||||
{
|
||||
if (!m_pluginDirectory.empty()) {
|
||||
return m_pluginDirectory;
|
||||
}
|
||||
|
||||
#if WINAPI_XWINDOWS
|
||||
return getProfileDirectory().append("/plugins");
|
||||
#else
|
||||
@@ -117,11 +121,19 @@ ArchFileUnix::getPluginDirectory()
|
||||
std::string
|
||||
ArchFileUnix::getProfileDirectory()
|
||||
{
|
||||
String dir;
|
||||
if (!m_profileDirectory.empty()) {
|
||||
dir = m_profileDirectory;
|
||||
}
|
||||
else {
|
||||
#if WINAPI_XWINDOWS
|
||||
return getUserDirectory().append("/.synergy");
|
||||
dir = getUserDirectory().append("/.synergy");
|
||||
#else
|
||||
return getUserDirectory().append("/Library/Synergy");
|
||||
dir = getUserDirectory().append("/Library/Synergy");
|
||||
#endif
|
||||
}
|
||||
return dir;
|
||||
|
||||
}
|
||||
|
||||
std::string
|
||||
@@ -137,3 +149,15 @@ ArchFileUnix::concatPath(const std::string& prefix,
|
||||
path += suffix;
|
||||
return path;
|
||||
}
|
||||
|
||||
void
|
||||
ArchFileUnix::setProfileDirectory(const String& s)
|
||||
{
|
||||
m_profileDirectory = s;
|
||||
}
|
||||
|
||||
void
|
||||
ArchFileUnix::setPluginDirectory(const String& s)
|
||||
{
|
||||
m_pluginDirectory = s;
|
||||
}
|
||||
|
||||
@@ -38,4 +38,10 @@ public:
|
||||
virtual std::string getProfileDirectory();
|
||||
virtual std::string concatPath(const std::string& prefix,
|
||||
const std::string& suffix);
|
||||
virtual void setProfileDirectory(const String& s);
|
||||
virtual void setPluginDirectory(const String& s);
|
||||
|
||||
private:
|
||||
String m_profileDirectory;
|
||||
String m_pluginDirectory;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user