diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index bb3b9a55..2b4d10fc 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -504,7 +504,7 @@ void MainWindow::startBarrier() // launched the process (e.g. when launched with elevation). setting the // profile dir on launch ensures it uses the same profile dir is used // no matter how its relaunched. - args << "--profile-dir" << getProfileRootForArg(); + args << "--profile-dir" << QString::fromStdString("\"" + DataDirectories::profile() + "\""); #endif if ((barrierType() == barrierClient && !clientArgs(args, app)) @@ -1253,20 +1253,6 @@ void MainWindow::bonjourInstallFinished() m_pCheckBoxAutoConfig->setChecked(true); } -QString MainWindow::getProfileRootForArg() -{ - auto dir = QString::fromStdString(DataDirectories::profile()); - - // HACK: strip our app name since we're returning the root dir. -#if defined(Q_OS_WIN) - dir.replace("\\Barrier", ""); -#else - dir.replace("/.barrier", ""); -#endif - - return QString("\"%1\"").arg(dir); -} - void MainWindow::windowStateChanged() { if (windowState() == Qt::WindowMinimized && appConfig().getMinimizeToTray()) diff --git a/src/gui/src/MainWindow.h b/src/gui/src/MainWindow.h index 27b30d11..5bb28950 100644 --- a/src/gui/src/MainWindow.h +++ b/src/gui/src/MainWindow.h @@ -166,7 +166,6 @@ public slots: bool isBonjourRunning(); void downloadBonjour(); void promptAutoConfig(); - QString getProfileRootForArg(); void checkConnected(const QString& line); void checkFingerprint(const QString& line); void restartBarrier();