D12565: Improve octave login
Nikita Sirgienko
noreply at phabricator.kde.org
Sat Apr 28 11:11:56 UTC 2018
sirgienko added a comment.
In D12565#255055 <https://phabricator.kde.org/D12565#255055>, @asemke wrote:
> Cleaning up in logout() is ok. Sending emit loginDone() in readOutput() is not very clean. Everything login related should be done in login(). What do you mean with "we emit this signal before we real finish preparation"? Is m_process->waitForReadyRead(); in OctaveSession::login() not enough to collect and to parse the initial output of octave?
Acording to Qt documentation
> `waitForReadyRead()`: Blocks until new data is available for reading and the readyRead() signal has been emitted
And we have `connect ( m_process, SIGNAL ( readyReadStandardOutput() ), SLOT ( readOutput() ) );`
But we wait only for `readyRead()` signal and qt don't garantee, that the slot, connected to this signal, already have be executed.
So, we could emit `loginDone` before backend set m_prompt and m_tempDir. Now it doesn't happends, but it could be possible or I am wrong with it and it's not a problem.
I was thinking about getting the octave prompt like lua backend: connect output to special function for reading prompt, which at the end of work reconnect output to parsing functions and emit loginDone signal.
Well, now lua emit loginDone signal in `login` function, so sometimes I loose first comand in the lua tests, because the backend run expression before reading the prompt and I got something like this:
`reading the intro message "Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio\n> print(2+2)\n4\n> "`
But maybe I have made a mistake, when have move the signal emit statement in this patch.
REPOSITORY
R55 Cantor
REVISION DETAIL
https://phabricator.kde.org/D12565
To: sirgienko, #cantor, asemke
Cc: #cantor, #kde_edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20180428/44045228/attachment.html>
More information about the kde-edu
mailing list