mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-13 15:15:21 +08:00
Fixed: Plugins dir may change depending on user #4168
This commit is contained in:
@@ -450,6 +450,8 @@ void MainWindow::startSynergy()
|
||||
args << "--enable-crypto";
|
||||
}
|
||||
|
||||
args << "--profile-dir" << getProfileDirectoryForArg();
|
||||
|
||||
if ((synergyType() == synergyClient && !clientArgs(args, app))
|
||||
|| (synergyType() == synergyServer && !serverArgs(args, app)))
|
||||
{
|
||||
@@ -473,6 +475,8 @@ void MainWindow::startSynergy()
|
||||
|
||||
appendLogNote("starting " + QString(synergyType() == synergyServer ? "server" : "client"));
|
||||
|
||||
qDebug() << args;
|
||||
|
||||
// show command if debug log level...
|
||||
if (appConfig().logLevel() >= 4) {
|
||||
appendLogNote(QString("command: %1 %2").arg(app, args.join(" ")));
|
||||
@@ -1216,3 +1220,29 @@ void MainWindow::bonjourInstallFinished()
|
||||
|
||||
m_pCheckBoxAutoConfig->setChecked(true);
|
||||
}
|
||||
|
||||
QString MainWindow::getProfileDirectory()
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
|
||||
QString qtDataDir = QDesktopServices::storageLocation(
|
||||
QDesktopServices::DataLocation);
|
||||
|
||||
// HACK: core wants the base app data dir, this seems like a very hacky
|
||||
// way to get it (maybe consider using %LOCALAPPDATA% instead?)
|
||||
return qtDataDir.replace("\\Synergy\\Synergy", "");
|
||||
|
||||
#else
|
||||
|
||||
// HACK: this seems hacky, since we're using a hidden folder inside the
|
||||
// user's home dir to store plugins, etc... but we call it profile dir?
|
||||
return QDesktopServices::storageLocation(
|
||||
QDesktopServices::HomeLocation);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
QString MainWindow::getProfileDirectoryForArg()
|
||||
{
|
||||
return QString("\"%1\"").arg(getProfileDirectory());
|
||||
}
|
||||
|
||||
@@ -165,6 +165,8 @@ class MainWindow : public QMainWindow, public Ui::MainWindowBase
|
||||
void downloadBonjour();
|
||||
void promptAutoConfig();
|
||||
void updateEdition();
|
||||
QString getProfileDirectory();
|
||||
QString getProfileDirectoryForArg();
|
||||
|
||||
private:
|
||||
QSettings& m_Settings;
|
||||
|
||||
Reference in New Issue
Block a user