core!: refactor launch sequence

Also includes slight changes to the command syntax.
See --help for details.
This commit is contained in:
outfoxxed 2024-09-01 14:17:39 -07:00
parent da043e092a
commit 94e881e6b0
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
12 changed files with 729 additions and 651 deletions

View file

@ -104,16 +104,16 @@ void IpcClient::onError(QLocalSocket::LocalSocketError error) {
qCCritical(logIpc) << "Socket Error" << error;
}
bool IpcClient::connect(const QString& id, const std::function<void(IpcClient& client)>& callback) {
int IpcClient::connect(const QString& id, const std::function<void(IpcClient& client)>& callback) {
auto path = QsPaths::ipcPath(id);
auto client = IpcClient(path);
qCDebug(logIpc) << "Connecting to instance" << id << "at" << path;
client.waitForConnected();
if (!client.isConnected()) return false;
if (!client.isConnected()) return -1;
qCDebug(logIpc) << "Connected.";
callback(client);
return true;
return 0;
}
} // namespace qs::ipc