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) {