From cd0f92e16de666f23885614c23d7fa33dab8ad9f Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sat, 1 Aug 2026 15:53:03 +0200 Subject: [PATCH] session rename: fix renameSession, use setProgram/setArguments --- gui/main.qml | 5 +++++ gui/ollie9pclient.cpp | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gui/main.qml b/gui/main.qml index c071c06..a322df8 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -602,6 +602,11 @@ ApplicationWindow { border.color: theme.highlightColor radius: 2 } + onTextChanged: { + if (index === renamingIndex) { + renamingText = text + } + } Keys.onReturnPressed: commitRename() Keys.onEscapePressed: cancelRename() onAccepted: commitRename() diff --git a/gui/ollie9pclient.cpp b/gui/ollie9pclient.cpp index 8e73ea2..3c6b378 100644 --- a/gui/ollie9pclient.cpp +++ b/gui/ollie9pclient.cpp @@ -27,6 +27,12 @@ static QString serverAddr() return "unix!" + ns + "/ollie"; } +// Returns the path to ollie-9p binary, or empty string if not found. +static QString ollie9pBin() +{ + return QStandardPaths::findExecutable("ollie-9p"); +} + Ollie9pClient::Ollie9pClient(QObject *parent) : QObject(parent) { @@ -275,15 +281,16 @@ bool Ollie9pClient::renameSession(const QString &sessionId, const QString &newNa { if (sessionId.isEmpty() || newName.isEmpty()) return false; - // Use ollie-9p mv (which uses 9P Twstat to rename the session directory). - QString bin = QStandardPaths::findExecutable("ollie-9p"); + QString bin = ollie9pBin(); if (bin.isEmpty()) { qDebug() << "renameSession: ollie-9p not found, cannot rename"; return false; } QProcess proc; - proc.start(bin, {"-a", serverAddr(), "mv", "session/" + sessionId, "session/" + newName}); + proc.setProgram(bin); + proc.setArguments({"-a", serverAddr(), "mv", "session/" + sessionId, "session/" + newName}); + proc.start(); proc.waitForFinished(5000); if (proc.exitCode() != 0) {