forked from quickshell/quickshell
core!: refactor launch sequence
Also includes slight changes to the command syntax. See --help for details.
This commit is contained in:
parent
da043e092a
commit
94e881e6b0
12 changed files with 729 additions and 651 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue