[Konsole-devel] konsolepart and TerminalInterface

Jekyll Wu adaptee at gmail.com
Thu Mar 22 14:31:11 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

@Eike: scorll to the end if you are not interested with following stuff.


Well, I just realized that konsolepart is currently broken as an
implementation of the TerminalInterface.

The problem is that startProgram(program, arguemnts) and
showShellInDir(dir) do not work at all. The following snippet is taken
from kdelibs/interfaces/terminal/kde_terminal_interface.h

  // cast the part to the TerminalInterface..
  // TerminalInterface* t = static_cast<TerminalInterface*>(
p->qt_cast( "TerminalInterface" ) );

  // now use the interface in all sorts of ways, e.g.
  //    t->showShellInDir( QDir::home().path() );
  // or:
  //    QStrList l;
  //    l.append( "python" );
  //    t->startProgram( QString::fromUtf8( "/usr/bin/python" ), l);


Those two methods do not work, because whenever a konsolepart is
created,  a session is automatically created and started as the last
step in the constructor. Setting the startup working directory,
command and arguments is meaningless after a session has started running.

The current broken implementation has one advantage: it makes
developers of most of hosting applications lazier, since they do not
need to write extra code to ask konsolepart to start a session.

But still, konsolepart is broken according to the document of
TerminalInterface . I think that should be fixed, because the current
implementation makes it impossible to start a customized session
without playing around Konsole profiles(especially the default
profile).  We should allow a user/developer to run any command in an
ad-hoc way without knowing and worrying about Konsole profiles.

Clearly, fixing that broken implementation will introduce another
breakage for most/all hosting applications. They must modify their
code to explicitly call startProgram(...) to run a random command, or
call createSession(...)  to run the command predefined in a particular
profile. That is the problem I'm concerned.  Which breakage should we
choose ?


@Eike:

    I know you hope konsolepart can provide the possibility of
creating session using specified profile instead of always the default
profile. I think adding that support is not hard if this broken
implementation is fixed. Actually, adding that support is also
possible with current broken implementation(for example, passing
profile name as extra argument when creating one konsolepart
instance), but I feel the result will really be ugly.

Just some rough thoughts.

Regards
Jekyll
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPazevAAoJEOemZ9znWXlAoSMQAJAhyjM0mBV6Jyg6fv5kQKbb
61jujsb/PnOzN6KvPhqQykI28sMpxjZP613aa2Ie1zY3KybqQYXacSOCdNKrmdbq
uF+AwkQpC9g03fAyEScXHKxsNs52rUTS+gTi9usYZYosOsLx1MlInYMbYhx2DE87
a6N18f2MfQaaDpVYY4KL1h3HZtQsCLdkB3s856selYDk4iEfJmgdTfNGHC2Szq3A
aT6s04ilheZbsAr7kfsmi8t4GcD6WsNtPHpse6aMMfh064k+TqxK5a3ERIAVDNdc
agiY1i1gjYEq0uWC6mHQ5ZJ9J1MAQEPK7yigOVYntyHbGmLt6q2NUukT5GBTTjfs
FBymCL7kfEtuhxaJ0E8NSYy9Ov1ouCtnJaV3g2kxOtdPAo0ZyYLUvB/JjOd5s+Hy
PZN/XaPA2JyvAKKSPoGS68w29+WztAk9KMVfkfNbJMr+CICvnDMjvG7pZwWLqiAc
iPQcBGko2woXpGoqHGhoansRJWfTWKyTplxccfkPwRx1RU7P3M6P7xUAzVf1xcH3
zo/O5uWNXAIdbFpZfMYpwNrOOtvEbMrMEj3ibuI9Dc89xHAWIi6pDEAEslcJWBGk
80syVVFTRDRjhLqgm0kd6yUj2SgOFIi5cthW6Td/wzOFVaNaENoDTN1BnnEyFwnR
Q2HzgoAyA1IoG8RSvAlN
=ufnC
-----END PGP SIGNATURE-----



More information about the konsole-devel mailing list