Added symbolic link creation to linux and macos #4696
This commit is contained in:
parent
0061969cf2
commit
ad9cfd64af
|
@ -25,6 +25,8 @@
|
||||||
#include "Fingerprint.h"
|
#include "Fingerprint.h"
|
||||||
#include "Plugin.h"
|
#include "Plugin.h"
|
||||||
|
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
@ -84,6 +86,7 @@ void PluginManager::copyPlugins()
|
||||||
// If it doesn't exist, there is nothing to do
|
// If it doesn't exist, there is nothing to do
|
||||||
QString srcDirName(m_InstalledDir.append(QDir::separator())
|
QString srcDirName(m_InstalledDir.append(QDir::separator())
|
||||||
.append(Plugin::getOsSpecificInstallerLocation()));
|
.append(Plugin::getOsSpecificInstallerLocation()));
|
||||||
|
|
||||||
QDir srcDir(srcDirName);
|
QDir srcDir(srcDirName);
|
||||||
if (!srcDir.exists()) {
|
if (!srcDir.exists()) {
|
||||||
emit info(
|
emit info(
|
||||||
|
@ -95,6 +98,7 @@ void PluginManager::copyPlugins()
|
||||||
// Get the directory where Plugins are installed into Synergy
|
// Get the directory where Plugins are installed into Synergy
|
||||||
// If it doesn't exist make it
|
// If it doesn't exist make it
|
||||||
QString destDirName = m_PluginDir;
|
QString destDirName = m_PluginDir;
|
||||||
|
|
||||||
QDir destDir(destDirName);
|
QDir destDir(destDirName);
|
||||||
if (!destDir.exists()) {
|
if (!destDir.exists()) {
|
||||||
destDir.mkpath(".");
|
destDir.mkpath(".");
|
||||||
|
@ -114,7 +118,11 @@ void PluginManager::copyPlugins()
|
||||||
newFile.remove();
|
newFile.remove();
|
||||||
}
|
}
|
||||||
// make a copy of the plugin in the new location
|
// make a copy of the plugin in the new location
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
bool result = file.copy(newName);
|
bool result = file.copy(newName);
|
||||||
|
#else
|
||||||
|
bool result = file.link(newName);
|
||||||
|
#endif
|
||||||
if ( !result ) {
|
if ( !result ) {
|
||||||
emit error(
|
emit error(
|
||||||
tr("Failed to copy plugin '%1' to: %2\n%3")
|
tr("Failed to copy plugin '%1' to: %2\n%3")
|
||||||
|
|
Loading…
Reference in New Issue