Debian Codegraph @

lib/Session.cpp

raw symbols SCIP
1 /*
2 This file is part of Konsole
3
4 Copyright (C) 2006-2007 by Robert Knight <[email protected]>
5 Copyright (C) 1997,1998 by Lars Doelle <[email protected]>
6
7 Rewritten for QT4 by e_k <e_k at users.sourceforge.net>, Copyright (C)2008
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 02110-1301 USA.
23 */
24
25 // Own
26 #include "Session.h"cxx . . $ `<file>/lib/Session.h`/
27
28 // Standard
29 #include <cstdlib>
30
31 // Qt
32 #include <QApplication>
33 #include <QByteRef>
34 #include <QDir>
35 #include <QFile>
36 #include <QRegExp>
37 #include <QStringList>
38 #include <QFile>
39 #include <QtDebug>
40
41 #include "Pty.h"cxx . . $ `<file>/lib/Pty.h`/
42 //#include "kptyprocess.h"
43 #include "TerminalDisplay.h"cxx . . $ `<file>/lib/TerminalDisplay.h`/
44 #include "ShellCommand.h"cxx . . $ `<file>/lib/ShellCommand.h`/
45 #include "Vt102Emulation.h"cxx . . $ `<file>/lib/Vt102Emulation.h`/
46
47 // QMLTermWidget
48 #include <QQuickWindow>
49
50 using namespace Konsole;
51
52 int Sessioncxx . . $ Konsole/Session#::lastSessionIdcxx . . $ Konsole/Session#lastSessionId. = 0;
53
54 Sessioncxx . . $ Konsole/Session#::Sessioncxx . . $ Konsole/Session#Session(749de1b6ae65bddd).(QObjectcxx . . $ QObject#* parent) :
55 QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent),
56 _shellProcesscxx . . $ Konsole/Session#_shellProcess.(nullptr)
57 , _emulationcxx . . $ Konsole/Session#_emulation.(nullptr)
58 , _monitorActivitycxx . . $ Konsole/Session#_monitorActivity.(false)
59 , _monitorSilencecxx . . $ Konsole/Session#_monitorSilence.(false)
60 , _notifiedActivitycxx . . $ Konsole/Session#_notifiedActivity.(false)
61 , _autoClosecxx . . $ Konsole/Session#_autoClose.(true)
62 , _wantedClosecxx . . $ Konsole/Session#_wantedClose.(false)
63 , _silenceSecondscxx . . $ Konsole/Session#_silenceSeconds.(10)
64 , _isTitleChangedcxx . . $ Konsole/Session#_isTitleChanged.(false)
65 , _addToUtmpcxx . . $ Konsole/Session#_addToUtmp.(false) // disabled by default because of a bug encountered on certain systems
66 // which caused Konsole to hang when closing a tab and then opening a new
67 // one. A 'QProcess destroyed while still running' warning was being
68 // printed to the terminal. Likely a problem in KPty::logout()
69 // or KPty::login() which uses a QProcess to start /usr/bin/utempter
70 , _flowControlcxx . . $ Konsole/Session#_flowControl.(true)
71 , _fullScriptingcxx . . $ Konsole/Session#_fullScripting.(false)
72 , _sessionIdcxx . . $ Konsole/Session#_sessionId.(0)
73 // , _zmodemBusy(false)
74 // , _zmodemProc(0)
75 // , _zmodemProgress(0)
76 , _hasDarkBackgroundcxx . . $ Konsole/Session#_hasDarkBackground.(false)
77 , _foregroundProcessInfocxx . . $ Konsole/Session#_foregroundProcessInfo.(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!)
78 , _foregroundPidcxx . . $ Konsole/Session#_foregroundPid.(0)
79 {
80 //prepare DBus communication
81 // new SessionAdaptor(this);
82 _sessionIdcxx . . $ Konsole/Session#_sessionId. = ++lastSessionIdcxx . . $ Konsole/Session#lastSessionId.;
83 // QDBusConnection::sessionBus().registerObject(QLatin1String("/Sessions/")+QString::number(_sessionId), this);
84
85 //create teletype for I/O with shell process
86 _shellProcesscxx . . $ Konsole/Session#_shellProcess. = new Ptycxx . . $ Konsole/Pty#Pty(749de1b6ae65bddd).();
87 ptySlaveFdcxx . . $ Konsole/Session#ptySlaveFd. = _shellProcesscxx . . $ Konsole/Session#_shellProcess.->ptycxx . . $ KPtyProcess#pty(e0e5ab7122928a46).()->slaveFdcxx . . $ KPty#slaveFd(455f465bc33b4cdf).();
88
89 //create emulation backend
90 _emulationcxx . . $ Konsole/Session#_emulation. = new Vt102Emulationcxx . . $ Konsole/Vt102Emulation#();
91
92 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _emulationcxx . . $ Konsole/Session#_emulation., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( titleChanged( int, const QString & ) ),
93 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( setUserTitle( int, const QString & ) ) );
94 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _emulationcxx . . $ Konsole/Session#_emulation., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( stateSet(int) ),
95 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!( activityStateSet(int) ) );
96 // connect( _emulation, SIGNAL( zmodemDetected() ), this ,
97 // SLOT( fireZModemDetected() ) );
98 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _emulationcxx . . $ Konsole/Session#_emulation., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( changeTabTextColorRequest( int ) ),
99 this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( changeTabTextColorRequest( int ) ) );
100 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _emulationcxx . . $ Konsole/Session#_emulation., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(profileChangeCommandReceived(const QString &)),
101 this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!( profileChangeCommandReceived(const QString &)) );
102
103 connectcxx . . $ QObject#connect(158df1d9a01a3410).(_emulationcxx . . $ Konsole/Session#_emulation., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(imageResizeRequest(QSize)),
104 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onEmulationSizeChange(QSize)));
105 connectcxx . . $ QObject#connect(158df1d9a01a3410).(_emulationcxx . . $ Konsole/Session#_emulation., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(imageSizeChanged(int, int)),
106 this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onViewSizeChange(int, int)));
107 connectcxx . . $ QObject#connect(835f87066c895669).(_emulationcxx . . $ Konsole/Session#_emulation., &Vt102Emulationcxx . . $ Konsole/Vt102Emulation#::cursorChangedcxx . . $ Konsole/Emulation#cursorChanged(e433759c0c286c4c).,
108 this, &Sessioncxx . . $ Konsole/Session#::cursorChangedcxx . . $ Konsole/Session#cursorChanged(e433759c0c286c4c).);
109
110 //connect teletype to emulation backend
111 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setUtf8Modecxx . . $ Konsole/Pty#setUtf8Mode(b45ddcbc8423892c).(_emulationcxx . . $ Konsole/Session#_emulation.->utf8cxx . . $ Konsole/Emulation#utf8(50ce9a9e25b4a850).());
112
113 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _shellProcesscxx . . $ Konsole/Session#_shellProcess.,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(receivedData(const char *,int)),this,
114 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onReceiveBlock(const char *,int)) );
115 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _emulationcxx . . $ Konsole/Session#_emulation.,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(sendData(const char *,int)),_shellProcesscxx . . $ Konsole/Session#_shellProcess.,
116 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(sendData(const char *,int)) );
117 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _emulationcxx . . $ Konsole/Session#_emulation.,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(lockPtyRequest(bool)),_shellProcesscxx . . $ Konsole/Session#_shellProcess.,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(lockPty(bool)) );
118 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _emulationcxx . . $ Konsole/Session#_emulation.,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(useUtf8Request(bool)),_shellProcesscxx . . $ Konsole/Session#_shellProcess.,SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setUtf8Mode(bool)) );
119
120 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _shellProcesscxx . . $ Konsole/Session#_shellProcess.,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(finished(int,QProcess::ExitStatus)), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(done(int)) );
121 // not in kprocess anymore connect( _shellProcess,SIGNAL(done(int)), this, SLOT(done(int)) );
122
123 //setup timer for monitoring session activity
124 _monitorTimercxx . . $ Konsole/Session#_monitorTimer. = new QTimercxx . . $ QTimer#QTimer(749de1b6ae65bddd).(this);
125 _monitorTimercxx . . $ Konsole/Session#_monitorTimer.->setSingleShotcxx . . $ QTimer#setSingleShot(b45ddcbc8423892c).(true);
126 connectcxx . . $ QObject#connect(158df1d9a01a3410).(_monitorTimercxx . . $ Konsole/Session#_monitorTimer., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(timeout()), this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(monitorTimerDone()));
127 }
128
129 WIdcxx . . $ WId# Sessioncxx . . $ Konsole/Session#::windowIdcxx . . $ Konsole/Session#windowId(1c5fc1fd41a99ae7).() const
130 {
131 // On Qt5, requesting window IDs breaks QQuickWidget and the likes,
132 // for example, see the following bug reports:
133 // https://bugreports.qt.io/browse/QTBUG-40765
134 // https://codereview.qt-project.org/#/c/94880/
135 return 0;
136 }
137
138 void Sessioncxx . . $ Konsole/Session#::setDarkBackgroundcxx . . $ Konsole/Session#setDarkBackground(b45ddcbc8423892c).(bool darkBackground)
139 {
140 _hasDarkBackgroundcxx . . $ Konsole/Session#_hasDarkBackground. = darkBackground;
141 }
142 bool Sessioncxx . . $ Konsole/Session#::hasDarkBackgroundcxx . . $ Konsole/Session#hasDarkBackground(50ce9a9e25b4a850).() const
143 {
144 return _hasDarkBackgroundcxx . . $ Konsole/Session#_hasDarkBackground.;
145 }
146 bool Sessioncxx . . $ Konsole/Session#::isRunningcxx . . $ Konsole/Session#isRunning(50ce9a9e25b4a850).() const
147 {
148 return _shellProcesscxx . . $ Konsole/Session#_shellProcess.->statecxx . . $ QProcess#state(12547b18370478e0).() == QProcesscxx . . $ QProcess#::Runningcxx . . $ QProcess#Running.;
149 }
150
151 void Sessioncxx . . $ Konsole/Session#::setCodeccxx . . $ Konsole/Session#setCodec(ca93e7c01f42f36c).(QTextCodeccxx . . $ QTextCodec# * codec) const
152 {
153 emulationcxx . . $ Konsole/Session#emulation(6c49a54d02df9d82).()->setCodeccxx . . $ Konsole/Emulation#setCodec(dba08ac82884e446).(codec);
154 }
155
156 void Sessioncxx . . $ Konsole/Session#::setProgramcxx . . $ Konsole/Session#setProgram(3520e46b33348bf6).(const QStringcxx . . $ QString# & program)
157 {
158 _programcxx . . $ Konsole/Session#_program. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). ShellCommandcxx . . $ Konsole/ShellCommand#::expandcxx . . $ Konsole/ShellCommand#expand(fd988a2ab94d906b).(program);
159 }
160 void Sessioncxx . . $ Konsole/Session#::setInitialWorkingDirectorycxx . . $ Konsole/Session#setInitialWorkingDirectory(3520e46b33348bf6).(const QStringcxx . . $ QString# & dir)
161 {
162 _initialWorkingDircxx . . $ Konsole/Session#_initialWorkingDir. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). ShellCommandcxx . . $ Konsole/ShellCommand#::expandcxx . . $ Konsole/ShellCommand#expand(fd988a2ab94d906b).(dir);
163 }
164 void Sessioncxx . . $ Konsole/Session#::setArgumentscxx . . $ Konsole/Session#setArguments(631c0101495f0328).(const QStringListcxx . . $ QStringList# & arguments)
165 {
166 _argumentscxx . . $ Konsole/Session#_arguments. =cxx . . $ QStringList#`operator=`(335bb966c1744308). ShellCommandcxx . . $ Konsole/ShellCommand#::expandcxx . . $ Konsole/ShellCommand#expand(5a14ab7320a56439).(arguments);
167 }
168
169 QListcxx . . $ QList#<TerminalDisplaycxx . . $ Konsole/TerminalDisplay# *> Sessioncxx . . $ Konsole/Session#::viewscxx . . $ Konsole/Session#views(575deae48586efe3).() const
170 {
171 return _viewscxx . . $ QList#QList(3d2301cfd89f773a).;
172 }
173
174 void Sessioncxx . . $ Konsole/Session#::addViewcxx . . $ Konsole/Session#addView(d1be2bc5a38bdd21).(TerminalDisplaycxx . . $ Konsole/TerminalDisplay# * widget)
175 {
176 Q_ASSERTcxx . . $ `<external>/15045578679651060896/qglobal.h:859:13`!( !_views.contains(widget) );
177
178 _viewscxx . . $ Konsole/Session#_views..appendcxx . . $ QList#append(77d9f17553126ecb).(widget);
179
180 if ( _emulationcxx . . $ Konsole/Session#_emulation. != nullptr ) {
181 // connect emulation - view signals and slots
182 connectcxx . . $ QObject#connect(835f87066c895669).( widget , &TerminalDisplaycxx . . $ Konsole/TerminalDisplay#::keyPressedSignalcxx . . $ Konsole/TerminalDisplay#keyPressedSignal(4ced653b20f45578)., _emulationcxx . . $ Konsole/Session#_emulation. ,
183 &Emulationcxx . . $ Konsole/Emulation#::sendKeyEventcxx . . $ Konsole/Emulation#sendKeyEvent(4ced653b20f45578).);
184 connectcxx . . $ QObject#connect(158df1d9a01a3410).( widget , SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(mouseSignal(int,int,int,int)) , _emulationcxx . . $ Konsole/Session#_emulation. ,
185 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(sendMouseEvent(int,int,int,int)) );
186 connectcxx . . $ QObject#connect(158df1d9a01a3410).( widget , SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(sendStringToEmu(const char *)) , _emulationcxx . . $ Konsole/Session#_emulation. ,
187 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(sendString(const char *)) );
188
189 // allow emulation to notify view when the foreground process
190 // indicates whether or not it is interested in mouse signals
191 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _emulationcxx . . $ Konsole/Session#_emulation. , SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(programUsesMouseChanged(bool)) , widget ,
192 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setUsesMouse(bool)) );
193
194 widget->setUsesMousecxx . . $ Konsole/TerminalDisplay#setUsesMouse(b45ddcbc8423892c).( _emulationcxx . . $ Konsole/Session#_emulation.->programUsesMousecxx . . $ Konsole/Emulation#programUsesMouse(50ce9a9e25b4a850).() );
195
196 connectcxx . . $ QObject#connect(158df1d9a01a3410).( _emulationcxx . . $ Konsole/Session#_emulation. , SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(programBracketedPasteModeChanged(bool)) ,
197 widget , SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(setBracketedPasteMode(bool)) );
198
199 widget->setBracketedPasteModecxx . . $ Konsole/TerminalDisplay#setBracketedPasteMode(b45ddcbc8423892c).(_emulationcxx . . $ Konsole/Session#_emulation.->programBracketedPasteModecxx . . $ Konsole/Emulation#programBracketedPasteMode(50ce9a9e25b4a850).());
200
201 widget->setScreenWindowcxx . . $ Konsole/TerminalDisplay#setScreenWindow(f95587e758ec8843).(_emulationcxx . . $ Konsole/Session#_emulation.->createWindowcxx . . $ Konsole/Emulation#createWindow(402b4ab612c457df).());
202 }
203
204 //connect view signals and slots
205 QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).( widget ,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(changedContentSizeSignal(int,int)),this,
206 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onViewSizeChange(int,int)));
207
208 QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).( widget ,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(destroyed(QObject *)) , this ,
209 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(viewDestroyed(QObject *)) );
210 //slot for close
211 //QObject::connect(this, SIGNAL(finished()), widget, SLOT(close()));
212
213 }
214
215 void Sessioncxx . . $ Konsole/Session#::viewDestroyedcxx . . $ Konsole/Session#viewDestroyed(749de1b6ae65bddd).(QObjectcxx . . $ QObject# * view)
216 {
217 TerminalDisplaycxx . . $ Konsole/TerminalDisplay# * display = (TerminalDisplaycxx . . $ Konsole/TerminalDisplay# *)view;
218
219 Q_ASSERTcxx . . $ `<external>/15045578679651060896/qglobal.h:859:13`!( _views.contains(display) );
220
221 removeViewcxx . . $ Konsole/Session#removeView(d1be2bc5a38bdd21).(display);
222 }
223
224 void Sessioncxx . . $ Konsole/Session#::removeViewcxx . . $ Konsole/Session#removeView(d1be2bc5a38bdd21).(TerminalDisplaycxx . . $ Konsole/TerminalDisplay# * widget)
225 {
226 _viewscxx . . $ Konsole/Session#_views..removeAllcxx . . $ QList#removeAll(dd8e59d271e40448).(widget);
227
228 disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).(widget,nullptr,this,nullptr);
229
230 if ( _emulationcxx . . $ Konsole/Session#_emulation. != nullptr ) {
231 // disconnect
232 // - key presses signals from widget
233 // - mouse activity signals from widget
234 // - string sending signals from widget
235 //
236 // ... and any other signals connected in addView()
237 disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).( widget, nullptr, _emulationcxx . . $ Konsole/Session#_emulation., nullptr);
238
239 // disconnect state change signals emitted by emulation
240 disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).( _emulationcxx . . $ Konsole/Session#_emulation. , nullptr , widget , nullptr);
241 }
242
243 // close the session automatically when the last view is removed
244 if ( _viewscxx . . $ Konsole/Session#_views..countcxx . . $ QList#count(455f465bc33b4cdf).() == 0 ) {
245 closecxx . . $ Konsole/Session#close(49f6e7a06ebc5aa8).();
246 }
247 }
248
249 void Sessioncxx . . $ Konsole/Session#::runcxx . . $ Konsole/Session#run(49f6e7a06ebc5aa8).()
250 {
251 // Upon a KPty error, there is no description on what that error was...
252 // Check to see if the given program is executable.
253
254 /* ok iam not exactly sure where _program comes from - however it was set to /bin/bash on my system
255 * Thats bad for BSD as its /usr/local/bin/bash there - its also bad for arch as its /usr/bin/bash there too!
256 * So i added a check to see if /bin/bash exists - if no then we use $SHELL - if that does not exist either, we fall back to /bin/sh
257 * As far as i know /bin/sh exists on every unix system.. You could also just put some ifdef __FREEBSD__ here but i think these 2 filechecks are worth
258 * their computing time on any system - especially with the problem on arch linux beeing there too.
259 */
260 QStringcxx . . $ QString# exec = QStringcxx . . $ QString#::fromLocal8Bitcxx . . $ QString#fromLocal8Bit(4e15edac36d215be).(QFilecxx . . $ QFile#::encodeNamecxx . . $ QFile#encodeName(743b31b35d83e992).(_programcxx . . $ Konsole/Session#_program.));
261 // if 'exec' is not specified, fall back to default shell. if that
262 // is not set then fall back to /bin/sh
263
264 // here we expect full path. If there is no fullpath let's expect it's
265 // a custom shell (eg. python, etc.) available in the PATH.
266 if (exec.startsWithcxx . . $ QString#startsWith(7cf081d1b6a1defd).(QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).('/')) || exec.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
267 {
268 const QStringcxx . . $ QString# defaultShellcxx . . $ QString#QString(4641beeb24e75d60).{QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).("/bin/sh")};
269
270 QFilecxx . . $ QFile# excheckcxx . . $ QFile#QFile(3520e46b33348bf6).(exec);
271 if ( exec.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() || !excheck.existscxx . . $ QFile#exists(50ce9a9e25b4a850).() ) {
272 exec =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::fromLocal8Bitcxx . . $ QString#fromLocal8Bit(4e15edac36d215be).(qgetenvcxx . . $ qgetenv(531409eeffcde449).("SHELL"));
273 }
274 excheck.setFileNamecxx . . $ QFile#setFileName(3520e46b33348bf6).(exec);
275
276 if ( exec.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() || !excheck.existscxx . . $ QFile#exists(50ce9a9e25b4a850).() ) {
277 qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Neither default shell nor $SHELL is set to a correct path. Fallback to" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). defaultShell;
278 exec =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). defaultShell;
279 }
280 }
281
282 // _arguments sometimes contain ("") so isEmpty()
283 // or count() does not work as expected...
284 QStringcxx . . $ QString# argsTmp(_argumentscxx . . $ Konsole/Session#_arguments..joincxx . . $ QListSpecialMethods#join(227e33e1a3bf1f91).(QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).(' ')).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).());
285 QStringListcxx . . $ QStringList# argumentscxx . . $ QStringList#QStringList(ced63f7c635d850d).;
286 arguments <<cxx . . $ QStringList#`operator<<`(85116071a693d053). exec;
287 if (argsTmp.lengthcxx . . $ QString#length(455f465bc33b4cdf).())
288 arguments <<cxx . . $ QStringList#`operator<<`(cb3c3d1614140851). _argumentscxx . . $ Konsole/Session#_arguments.;
289
290 QStringcxx . . $ QString# cwd = QDircxx . . $ QDir#::currentPathcxx . . $ QDir#currentPath(4365c3963150523e).();
291 if (!_initialWorkingDircxx . . $ Konsole/Session#_initialWorkingDir..isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) {
292 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setWorkingDirectorycxx . . $ QProcess#setWorkingDirectory(3520e46b33348bf6).(_initialWorkingDircxx . . $ Konsole/Session#_initialWorkingDir.);
293 } else {
294 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setWorkingDirectorycxx . . $ QProcess#setWorkingDirectory(3520e46b33348bf6).(cwd);
295 }
296
297 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setFlowControlEnabledcxx . . $ Konsole/Pty#setFlowControlEnabled(b45ddcbc8423892c).(_flowControlcxx . . $ Konsole/Session#_flowControl.);
298 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setErasecxx . . $ Konsole/Pty#setErase(44b6ea1973a07080).(_emulationcxx . . $ Konsole/Session#_emulation.->eraseCharcxx . . $ Konsole/Emulation#eraseChar(1b8b762cbef9c2c9).());
299
300 // this is not strictly accurate use of the COLORFGBG variable. This does not
301 // tell the terminal exactly which colors are being used, but instead approximates
302 // the color scheme as "black on white" or "white on black" depending on whether
303 // the background color is deemed dark or not
304 QStringcxx . . $ QString# backgroundColorHint = _hasDarkBackgroundcxx . . $ QString#QString(4641beeb24e75d60). ? QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).("COLORFGBG=15;0") : QLatin1Stringcxx . . $ QLatin1String#QLatin1String(aac1607cfe1c1740).("COLORFGBG=0;15");
305
306 /* if we do all the checking if this shell exists then we use it ;)
307 * Dont know about the arguments though.. maybe youll need some more checking im not sure
308 * However this works on Arch and FreeBSD now.
309 */
310 int result = _shellProcesscxx . . $ Konsole/Session#_shellProcess.->startcxx . . $ Konsole/Pty#start(12019f053b0a97bc).(exec,
311 arguments,
312 _environmentcxx . . $ Konsole/Session#_environment. <<cxx . . $ QStringList#`operator<<`(85116071a693d053). backgroundColorHint,
313 windowIdcxx . . $ Konsole/Session#windowId(1c5fc1fd41a99ae7).(),
314 _addToUtmpcxx . . $ Konsole/Session#_addToUtmp.);
315
316 if (result < 0) {
317 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "CRASHED! result: " <<cxx . . $ QDebug#`operator<<`(6e3b7ae53f380c3). result;
318 return;
319 }
320
321 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setWriteablecxx . . $ Konsole/Pty#setWriteable(b45ddcbc8423892c).(false); // We are reachable via kwrited.
322 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! startedcxx . . $ Konsole/Session#started(49f6e7a06ebc5aa8).();
323 }
324
325 void Sessioncxx . . $ Konsole/Session#::runEmptyPTYcxx . . $ Konsole/Session#runEmptyPTY(49f6e7a06ebc5aa8).()
326 {
327 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setFlowControlEnabledcxx . . $ Konsole/Pty#setFlowControlEnabled(b45ddcbc8423892c).(_flowControlcxx . . $ Konsole/Session#_flowControl.);
328 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setErasecxx . . $ Konsole/Pty#setErase(44b6ea1973a07080).(_emulationcxx . . $ Konsole/Session#_emulation.->eraseCharcxx . . $ Konsole/Emulation#eraseChar(1b8b762cbef9c2c9).());
329 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setWriteablecxx . . $ Konsole/Pty#setWriteable(b45ddcbc8423892c).(false);
330
331 // disconnet send data from emulator to internal terminal process
332 disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).( _emulationcxx . . $ Konsole/Session#_emulation.,SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(sendData(const char *,int)),
333 _shellProcesscxx . . $ Konsole/Session#_shellProcess., SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(sendData(const char *,int)) );
334
335 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setEmptyPTYPropertiescxx . . $ Konsole/Pty#setEmptyPTYProperties(49f6e7a06ebc5aa8).();
336 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! startedcxx . . $ Konsole/Session#started(49f6e7a06ebc5aa8).();
337 }
338
339 void Sessioncxx . . $ Konsole/Session#::setUserTitlecxx . . $ Konsole/Session#setUserTitle(4b11a7293b4ed91c).( int what, const QStringcxx . . $ QString# & caption )
340 {
341 //set to true if anything is actually changed (eg. old _nameTitle != new _nameTitle )
342 bool modified = false;
343
344 // (btw: what=0 changes _userTitle and icon, what=1 only icon, what=2 only _nameTitle
345 if ((what == 0) || (what == 2)) {
346 _isTitleChangedcxx . . $ Konsole/Session#_isTitleChanged. = true;
347 if ( _userTitlecxx . . $ Konsole/Session#_userTitle. !=cxx . . $ `operator!=`(5bc2975d2d751687). caption ) {
348 _userTitlecxx . . $ Konsole/Session#_userTitle. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). caption;
349 modified = true;
350 }
351 }
352
353 if ((what == 0) || (what == 1)) {
354 _isTitleChangedcxx . . $ Konsole/Session#_isTitleChanged. = true;
355 if ( _iconTextcxx . . $ Konsole/Session#_iconText. !=cxx . . $ `operator!=`(5bc2975d2d751687). caption ) {
356 _iconTextcxx . . $ Konsole/Session#_iconText. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). caption;
357 modified = true;
358 }
359 }
360
361 if (what == 11) {
362 QStringcxx . . $ QString# colorString = caption.sectioncxx . . $ QString#section(6e922cf609fb9683).(QLatin1Charcxx . . $ QChar#QChar(a50889c09eec06d9).(';'),0,0);
363 //qDebug() << __FILE__ << __LINE__ << ": setting background colour to " << colorString;
364 QColorcxx . . $ QColor# backColor = QColorcxx . . $ QColor#QColor(3520e46b33348bf6).(colorString);
365 if (backColor.isValidcxx . . $ QColor#isValid(3482b152b9333168).()) { // change color via \033]11;Color\007
366 if (backColor !=cxx . . $ QColor#`operator!=`(8df5130dab4f572b). _modifiedBackgroundcxx . . $ Konsole/Session#_modifiedBackground.) {
367 _modifiedBackgroundcxx . . $ Konsole/Session#_modifiedBackground. =cxx . . $ QColor#`operator=`(a3db1be773b26671). backColor;
368
369 // bail out here until the code to connect the terminal display
370 // to the changeBackgroundColor() signal has been written
371 // and tested - just so we don't forget to do this.
372 Q_ASSERTcxx . . $ `<external>/15045578679651060896/qglobal.h:859:13`!( 0 );
373
374 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! changeBackgroundColorRequestcxx . . $ Konsole/Session#changeBackgroundColorRequest(129a55e114526ad3).(backColor);
375 }
376 }
377 }
378
379 if (what == 30) {
380 _isTitleChangedcxx . . $ Konsole/Session#_isTitleChanged. = true;
381 if ( _nameTitlecxx . . $ Konsole/Session#_nameTitle. !=cxx . . $ `operator!=`(5bc2975d2d751687). caption ) {
382 setTitlecxx . . $ Konsole/Session#setTitle(3c5ac9fc232d1f59).(Sessioncxx . . $ Konsole/Session#::NameRolecxx . . $ Konsole/Session#NameRole.,caption);
383 return;
384 }
385 }
386
387 if (what == 31) {
388 QStringcxx . . $ QString# cwd=captioncxx . . $ QString#QString(132dd6869045752b).;
389 cwd=cxx . . $ QString#`operator=`(b79fde0b0ce9b948).cwd.replacecxx . . $ QString#replace(612862c8abff0ba5).( QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).(QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).("^~")), QDircxx . . $ QDir#::homePathcxx . . $ QDir#homePath(4365c3963150523e).() );
390 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! openUrlRequestcxx . . $ Konsole/Session#openUrlRequest(3520e46b33348bf6).(cwd);
391 }
392
393 // change icon via \033]32;Icon\007
394 if (what == 32) {
395 _isTitleChangedcxx . . $ Konsole/Session#_isTitleChanged. = true;
396 if ( _iconNamecxx . . $ Konsole/Session#_iconName. !=cxx . . $ `operator!=`(5bc2975d2d751687). caption ) {
397 _iconNamecxx . . $ Konsole/Session#_iconName. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). caption;
398
399 modified = true;
400 }
401 }
402
403 if (what == 50) {
404 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! profileChangeCommandReceivedcxx . . $ Konsole/Session#profileChangeCommandReceived(3520e46b33348bf6).(caption);
405 return;
406 }
407
408 if ( modified ) {
409 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! titleChangedcxx . . $ Konsole/Session#titleChanged(49f6e7a06ebc5aa8).();
410 }
411 }
412
413 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::userTitlecxx . . $ Konsole/Session#userTitle(6ef7b6c27b00b43d).() const
414 {
415 return _userTitlecxx . . $ QString#QString(132dd6869045752b).;
416 }
417 void Sessioncxx . . $ Konsole/Session#::setTabTitleFormatcxx . . $ Konsole/Session#setTabTitleFormat(c8503acaf1ae823a).(TabTitleContextcxx . . $ Konsole/Session#TabTitleContext# context , const QStringcxx . . $ QString# & format)
418 {
419 if ( context == LocalTabTitlecxx . . $ Konsole/Session#LocalTabTitle. ) {
420 _localTabTitleFormatcxx . . $ Konsole/Session#_localTabTitleFormat. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). format;
421 } else if ( context == RemoteTabTitlecxx . . $ Konsole/Session#RemoteTabTitle. ) {
422 _remoteTabTitleFormatcxx . . $ Konsole/Session#_remoteTabTitleFormat. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). format;
423 }
424 }
425 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::tabTitleFormatcxx . . $ Konsole/Session#tabTitleFormat(9aca552be220791).(TabTitleContextcxx . . $ Konsole/Session#TabTitleContext# context) const
426 {
427 if ( context == LocalTabTitlecxx . . $ Konsole/Session#LocalTabTitle. ) {
428 return _localTabTitleFormatcxx . . $ QString#QString(132dd6869045752b).;
429 } else if ( context == RemoteTabTitlecxx . . $ Konsole/Session#RemoteTabTitle. ) {
430 return _remoteTabTitleFormatcxx . . $ QString#QString(132dd6869045752b).;
431 }
432
433 return QStringcxx . . $ QString#QString(ced63f7c635d850d).();
434 }
435
436 void Sessioncxx . . $ Konsole/Session#::monitorTimerDonecxx . . $ Konsole/Session#monitorTimerDone(49f6e7a06ebc5aa8).()
437 {
438 //FIXME: The idea here is that the notification popup will appear to tell the user than output from
439 //the terminal has stopped and the popup will disappear when the user activates the session.
440 //
441 //This breaks with the addition of multiple views of a session. The popup should disappear
442 //when any of the views of the session becomes active
443
444
445 //FIXME: Make message text for this notification and the activity notification more descriptive.
446 if (_monitorSilencecxx . . $ Konsole/Session#_monitorSilence.) {
447 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! silencecxx . . $ Konsole/Session#silence(49f6e7a06ebc5aa8).();
448 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! stateChangedcxx . . $ Konsole/Session#stateChanged(d4f767463ce0a6b3).(NOTIFYSILENCEcxx . . $ Konsole/NOTIFYSILENCE.);
449 } else {
450 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! stateChangedcxx . . $ Konsole/Session#stateChanged(d4f767463ce0a6b3).(NOTIFYNORMALcxx . . $ Konsole/NOTIFYNORMAL.);
451 }
452
453 _notifiedActivitycxx . . $ Konsole/Session#_notifiedActivity.=false;
454 }
455
456 void Sessioncxx . . $ Konsole/Session#::activityStateSetcxx . . $ Konsole/Session#activityStateSet(d4f767463ce0a6b3).(int state)
457 {
458 if (state==NOTIFYBELLcxx . . $ Konsole/NOTIFYBELL.) {
459 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! bellRequestcxx . . $ Konsole/Session#bellRequest(3520e46b33348bf6).(trcxx . . $ Konsole/Session#tr(75d9f1c324b4579d).("Bell in session '%1'").argcxx . . $ QString#arg(bc823072288cbbb5).(_nameTitlecxx . . $ Konsole/Session#_nameTitle.));
460 } else if (state==NOTIFYACTIVITYcxx . . $ Konsole/NOTIFYACTIVITY.) {
461 if (_monitorSilencecxx . . $ Konsole/Session#_monitorSilence.) {
462 _monitorTimercxx . . $ Konsole/Session#_monitorTimer.->startcxx . . $ QTimer#start(d4f767463ce0a6b3).(_silenceSecondscxx . . $ Konsole/Session#_silenceSeconds.*1000);
463 }
464
465 if ( _monitorActivitycxx . . $ Konsole/Session#_monitorActivity. ) {
466 //FIXME: See comments in Session::monitorTimerDone()
467 if (!_notifiedActivitycxx . . $ Konsole/Session#_notifiedActivity.) {
468 _notifiedActivitycxx . . $ Konsole/Session#_notifiedActivity.=true;
469 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! activitycxx . . $ Konsole/Session#activity(49f6e7a06ebc5aa8).();
470 }
471 }
472 }
473
474 if ( state==NOTIFYACTIVITYcxx . . $ Konsole/NOTIFYACTIVITY. && !_monitorActivitycxx . . $ Konsole/Session#_monitorActivity. ) {
475 state = NOTIFYNORMALcxx . . $ Konsole/NOTIFYNORMAL.;
476 }
477 if ( state==NOTIFYSILENCEcxx . . $ Konsole/NOTIFYSILENCE. && !_monitorSilencecxx . . $ Konsole/Session#_monitorSilence. ) {
478 state = NOTIFYNORMALcxx . . $ Konsole/NOTIFYNORMAL.;
479 }
480
481 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! stateChangedcxx . . $ Konsole/Session#stateChanged(d4f767463ce0a6b3).(state);
482 }
483
484 void Sessioncxx . . $ Konsole/Session#::onViewSizeChangecxx . . $ Konsole/Session#onViewSizeChange(3e454b8ccf442868).(int /*height*/, int /*width*/)
485 {
486 updateTerminalSizecxx . . $ Konsole/Session#updateTerminalSize(49f6e7a06ebc5aa8).();
487 }
488 void Sessioncxx . . $ Konsole/Session#::onEmulationSizeChangecxx . . $ Konsole/Session#onEmulationSizeChange(37ecf1dd6fafc2a).(QSizecxx . . $ QSize# size)
489 {
490 setSizecxx . . $ Konsole/Session#setSize(1c5f201b4c2f0aba).(size);
491 }
492
493 void Sessioncxx . . $ Konsole/Session#::updateTerminalSizecxx . . $ Konsole/Session#updateTerminalSize(49f6e7a06ebc5aa8).()
494 {
495 QListIteratorcxx . . $ QListIterator#<TerminalDisplaycxx . . $ Konsole/TerminalDisplay# *> viewItercxx . . $ QListIterator#QListIterator(742a15f66a895bc5).(_viewscxx . . $ Konsole/Session#_views.);
496
497 int minLines = -1;
498 int minColumns = -1;
499
500 // minimum number of lines and columns that views require for
501 // their size to be taken into consideration ( to avoid problems
502 // with new view widgets which haven't yet been set to their correct size )
503 const int VIEW_LINES_THRESHOLD = 2;
504 const int VIEW_COLUMNS_THRESHOLD = 2;
505
506 //select largest number of lines and columns that will fit in all visible views
507 while ( viewIter.hasNextcxx . . $ QListIterator#hasNext(50ce9a9e25b4a850).() ) {
508 TerminalDisplaycxx . . $ Konsole/TerminalDisplay# * view = viewIter.nextcxx . . $ QListIterator#next(1306adbac230aeaa).();
509 if ( //!view->isVisible() == false && QMLTermWidget: We need to disable this check. It has issues when resizing invisible terminal.
510 view->linescxx . . $ Konsole/TerminalDisplay#lines(b126dc7c1de90089).() >= VIEW_LINES_THRESHOLD &&
511 view->columnscxx . . $ Konsole/TerminalDisplay#columns(b126dc7c1de90089).() >= VIEW_COLUMNS_THRESHOLD ) {
512 minLines = (minLines == -1) ? view->linescxx . . $ Konsole/TerminalDisplay#lines(b126dc7c1de90089).() : qMincxx . . $ qMin(2a338fce5842aa6a).( minLines , view->linescxx . . $ Konsole/TerminalDisplay#lines(b126dc7c1de90089).() );
513 minColumns = (minColumns == -1) ? view->columnscxx . . $ Konsole/TerminalDisplay#columns(b126dc7c1de90089).() : qMincxx . . $ qMin(2a338fce5842aa6a).( minColumns , view->columnscxx . . $ Konsole/TerminalDisplay#columns(b126dc7c1de90089).() );
514 }
515 }
516
517 // backend emulation must have a _terminal of at least 1 column x 1 line in size
518 if ( minLines > 0 && minColumns > 0 ) {
519 _emulationcxx . . $ Konsole/Session#_emulation.->setImageSizecxx . . $ Konsole/Emulation#setImageSize(3e454b8ccf442868).( minLines , minColumns );
520 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setWindowSizecxx . . $ Konsole/Pty#setWindowSize(3e454b8ccf442868).( minLines , minColumns );
521 }
522 }
523
524 void Sessioncxx . . $ Konsole/Session#::refreshcxx . . $ Konsole/Session#refresh(49f6e7a06ebc5aa8).()
525 {
526 // attempt to get the shell process to redraw the display
527 //
528 // this requires the program running in the shell
529 // to cooperate by sending an update in response to
530 // a window size change
531 //
532 // the window size is changed twice, first made slightly larger and then
533 // resized back to its normal size so that there is actually a change
534 // in the window size (some shells do nothing if the
535 // new and old sizes are the same)
536 //
537 // if there is a more 'correct' way to do this, please
538 // send an email with method or patches to [email protected]
539
540 const QSizecxx . . $ QSize# existingSize = _shellProcesscxx . . $ Konsole/Session#_shellProcess.->windowSizecxx . . $ Konsole/Pty#windowSize(4b3b776e5ee2b367).();
541 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setWindowSizecxx . . $ Konsole/Pty#setWindowSize(3e454b8ccf442868).(existingSize.heightcxx . . $ QSize#height(ea6fe5115c70a13f).(),existingSize.widthcxx . . $ QSize#width(ea6fe5115c70a13f).()+1);
542 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setWindowSizecxx . . $ Konsole/Pty#setWindowSize(3e454b8ccf442868).(existingSize.heightcxx . . $ QSize#height(ea6fe5115c70a13f).(),existingSize.widthcxx . . $ QSize#width(ea6fe5115c70a13f).());
543 }
544
545 bool Sessioncxx . . $ Konsole/Session#::sendSignalcxx . . $ Konsole/Session#sendSignal(83c267b20bac841a).(int signal)
546 {
547 int result = ::kill(static_cast<pid_t>(_shellProcesscxx . . $ Konsole/Session#_shellProcess.->processIdcxx . . $ QProcess#processId(98833e9ab7de59a4).()),signal);
548
549 if ( result == 0 )
550 {
551 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->waitForFinishedcxx . . $ QProcess#waitForFinished(83c267b20bac841a).();
552 return true;
553 }
554 else
555 return false;
556 }
557
558 void Sessioncxx . . $ Konsole/Session#::closecxx . . $ Konsole/Session#close(49f6e7a06ebc5aa8).()
559 {
560 _autoClosecxx . . $ Konsole/Session#_autoClose. = true;
561 _wantedClosecxx . . $ Konsole/Session#_wantedClose. = true;
562 if (!_shellProcesscxx . . $ Konsole/Session#_shellProcess.->isRunningcxx . . $ KPtyProcess#isRunning(50ce9a9e25b4a850).() || !sendSignalcxx . . $ Konsole/Session#sendSignal(83c267b20bac841a).(SIGHUPcxx . . $ `<external>/11773118241360591791/signum-generic.h:56:9`!)) {
563 // Forced close.
564 QTimercxx . . $ QTimer#::singleShotcxx . . $ QTimer#singleShot(24d02da3284e5f26).(1, this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(finished()));
565 }
566 }
567
568 void Sessioncxx . . $ Konsole/Session#::sendTextcxx . . $ Konsole/Session#sendText(7fba01612ab56717).(const QStringcxx . . $ QString# & text) const
569 {
570 _emulationcxx . . $ Konsole/Session#_emulation.->sendTextcxx . . $ Konsole/Emulation#sendText(3520e46b33348bf6).(text);
571 }
572
573 void Sessioncxx . . $ Konsole/Session#::sendKeyEventcxx . . $ Konsole/Session#sendKeyEvent(9d43d107a3c26aae).(QKeyEventcxx . . $ QKeyEvent#* e) const
574 {
575 _emulationcxx . . $ Konsole/Session#_emulation.->sendKeyEventcxx . . $ Konsole/Emulation#sendKeyEvent(4ced653b20f45578).(e, false);
576 }
577
578 Sessioncxx . . $ Konsole/Session#::~cxx . . $ Konsole/Session#`~Session`(ced63f7c635d850d).Sessioncxx . . $ Konsole/Session#()
579 {
580 delete _emulationcxx . . $ Konsole/Session#_emulation.;
581 delete _shellProcesscxx . . $ Konsole/Session#_shellProcess.;
582 // delete _zmodemProc;
583 }
584
585 void Sessioncxx . . $ Konsole/Session#::setProfileKeycxx . . $ Konsole/Session#setProfileKey(3520e46b33348bf6).(const QStringcxx . . $ QString# & key)
586 {
587 _profileKeycxx . . $ Konsole/Session#_profileKey. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). key;
588 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! profileChangedcxx . . $ Konsole/Session#profileChanged(3520e46b33348bf6).(key);
589 }
590 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::profileKeycxx . . $ Konsole/Session#profileKey(6ef7b6c27b00b43d).() const
591 {
592 return _profileKeycxx . . $ QString#QString(132dd6869045752b).;
593 }
594
595 void Sessioncxx . . $ Konsole/Session#::donecxx . . $ Konsole/Session#done(d4f767463ce0a6b3).(int exitStatus)
596 {
597 if (!_autoClosecxx . . $ Konsole/Session#_autoClose.) {
598 _userTitlecxx . . $ Konsole/Session#_userTitle. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).("This session is done. Finished");
599 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! titleChangedcxx . . $ Konsole/Session#titleChanged(49f6e7a06ebc5aa8).();
600 return;
601 }
602
603 // message is not being used. But in the original kpty.cpp file
604 // (https://cgit.kde.org/kpty.git/) it's part of a notification.
605 // So, we make it translatable, hoping that in the future it will
606 // be used in some kind of notification.
607 QStringcxx . . $ QString# messagecxx . . $ QString#QString(ced63f7c635d850d).;
608 if (!_wantedClosecxx . . $ Konsole/Session#_wantedClose. || exitStatus != 0) {
609
610 if (_shellProcesscxx . . $ Konsole/Session#_shellProcess.->exitStatuscxx . . $ QProcess#exitStatus(15ed2eeed4841e77).() == QProcesscxx . . $ QProcess#::NormalExitcxx . . $ QProcess#NormalExit.) {
611 message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Konsole/Session#tr(75d9f1c324b4579d).("Session '%1' exited with status %2.").argcxx . . $ QString#arg(bc823072288cbbb5).(_nameTitlecxx . . $ Konsole/Session#_nameTitle.).argcxx . . $ QString#arg(64ab2ed17cc11715).(exitStatus);
612 } else {
613 message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Konsole/Session#tr(75d9f1c324b4579d).("Session '%1' crashed.").argcxx . . $ QString#arg(bc823072288cbbb5).(_nameTitlecxx . . $ Konsole/Session#_nameTitle.);
614 }
615 }
616
617 if ( !_wantedClosecxx . . $ Konsole/Session#_wantedClose. && _shellProcesscxx . . $ Konsole/Session#_shellProcess.->exitStatuscxx . . $ QProcess#exitStatus(15ed2eeed4841e77).() != QProcesscxx . . $ QProcess#::NormalExitcxx . . $ QProcess#NormalExit. )
618 message =cxx . . $ QString#`operator=`(4f35bf974e7f8568). trcxx . . $ Konsole/Session#tr(75d9f1c324b4579d).("Session '%1' exited unexpectedly.").argcxx . . $ QString#arg(bc823072288cbbb5).(_nameTitlecxx . . $ Konsole/Session#_nameTitle.);
619 else
620 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! finishedcxx . . $ Konsole/Session#finished(49f6e7a06ebc5aa8).();
621 }
622
623 Emulationcxx . . $ Konsole/Emulation# * Sessioncxx . . $ Konsole/Session#::emulationcxx . . $ Konsole/Session#emulation(6c49a54d02df9d82).() const
624 {
625 return _emulationcxx . . $ Konsole/Session#_emulation.;
626 }
627
628 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::keyBindingscxx . . $ Konsole/Session#keyBindings(6ef7b6c27b00b43d).() const
629 {
630 return _emulationcxx . . $ Konsole/Session#_emulation.->keyBindingscxx . . $ Konsole/Emulation#keyBindings(6ef7b6c27b00b43d).();
631 }
632
633 QStringListcxx . . $ QStringList# Sessioncxx . . $ Konsole/Session#::environmentcxx . . $ Konsole/Session#environment(e1dbd5c4feadc8f5).() const
634 {
635 return _environmentcxx . . $ Konsole/Session#_environment.;
636 }
637
638 void Sessioncxx . . $ Konsole/Session#::setEnvironmentcxx . . $ Konsole/Session#setEnvironment(631c0101495f0328).(const QStringListcxx . . $ QStringList# & environment)
639 {
640 _environmentcxx . . $ Konsole/Session#_environment. =cxx . . $ QStringList#`operator=`(cb3c3d1614140851). environment;
641 }
642
643 int Sessioncxx . . $ Konsole/Session#::sessionIdcxx . . $ Konsole/Session#sessionId(455f465bc33b4cdf).() const
644 {
645 return _sessionIdcxx . . $ Konsole/Session#_sessionId.;
646 }
647
648 void Sessioncxx . . $ Konsole/Session#::setKeyBindingscxx . . $ Konsole/Session#setKeyBindings(3520e46b33348bf6).(const QStringcxx . . $ QString# & id)
649 {
650 _emulationcxx . . $ Konsole/Session#_emulation.->setKeyBindingscxx . . $ Konsole/Emulation#setKeyBindings(3520e46b33348bf6).(id);
651 }
652
653 void Sessioncxx . . $ Konsole/Session#::setTitlecxx . . $ Konsole/Session#setTitle(3c5ac9fc232d1f59).(TitleRolecxx . . $ Konsole/Session#TitleRole# role , const QStringcxx . . $ QString# & newTitle)
654 {
655 if ( titlecxx . . $ Konsole/Session#title(7af3d64a4238326e).(role) !=cxx . . $ `operator!=`(5bc2975d2d751687). newTitle ) {
656 if ( role == NameRolecxx . . $ Konsole/Session#NameRole. ) {
657 _nameTitlecxx . . $ Konsole/Session#_nameTitle. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). newTitle;
658 } else if ( role == DisplayedTitleRolecxx . . $ Konsole/Session#DisplayedTitleRole. ) {
659 _displayTitlecxx . . $ Konsole/Session#_displayTitle. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). newTitle;
660 }
661
662 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! titleChangedcxx . . $ Konsole/Session#titleChanged(49f6e7a06ebc5aa8).();
663 }
664 }
665
666 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::titlecxx . . $ Konsole/Session#title(7af3d64a4238326e).(TitleRolecxx . . $ Konsole/Session#TitleRole# role) const
667 {
668 if ( role == NameRolecxx . . $ Konsole/Session#NameRole. ) {
669 return _nameTitlecxx . . $ QString#QString(132dd6869045752b).;
670 } else if ( role == DisplayedTitleRolecxx . . $ Konsole/Session#DisplayedTitleRole. ) {
671 return _displayTitlecxx . . $ QString#QString(132dd6869045752b).;
672 } else {
673 return QStringcxx . . $ QString#QString(ced63f7c635d850d).();
674 }
675 }
676
677 void Sessioncxx . . $ Konsole/Session#::setIconNamecxx . . $ Konsole/Session#setIconName(3520e46b33348bf6).(const QStringcxx . . $ QString# & iconName)
678 {
679 if ( iconName !=cxx . . $ `operator!=`(5bc2975d2d751687). _iconNamecxx . . $ Konsole/Session#_iconName. ) {
680 _iconNamecxx . . $ Konsole/Session#_iconName. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). iconName;
681 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! titleChangedcxx . . $ Konsole/Session#titleChanged(49f6e7a06ebc5aa8).();
682 }
683 }
684
685 void Sessioncxx . . $ Konsole/Session#::setIconTextcxx . . $ Konsole/Session#setIconText(3520e46b33348bf6).(const QStringcxx . . $ QString# & iconText)
686 {
687 _iconTextcxx . . $ Konsole/Session#_iconText. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). iconText;
688 //kDebug(1211)<<"Session setIconText " << _iconText;
689 }
690
691 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::iconNamecxx . . $ Konsole/Session#iconName(6ef7b6c27b00b43d).() const
692 {
693 return _iconNamecxx . . $ QString#QString(132dd6869045752b).;
694 }
695
696 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::iconTextcxx . . $ Konsole/Session#iconText(6ef7b6c27b00b43d).() const
697 {
698 return _iconTextcxx . . $ QString#QString(132dd6869045752b).;
699 }
700
701 bool Sessioncxx . . $ Konsole/Session#::isTitleChangedcxx . . $ Konsole/Session#isTitleChanged(50ce9a9e25b4a850).() const
702 {
703 return _isTitleChangedcxx . . $ Konsole/Session#_isTitleChanged.;
704 }
705
706 void Sessioncxx . . $ Konsole/Session#::setHistoryTypecxx . . $ Konsole/Session#setHistoryType(8cdb70a5e6e0950).(const HistoryTypecxx . . $ Konsole/HistoryType# & hType)
707 {
708 _emulationcxx . . $ Konsole/Session#_emulation.->setHistorycxx . . $ Konsole/Emulation#setHistory(8cdb70a5e6e0950).(hType);
709 }
710
711 const HistoryTypecxx . . $ Konsole/HistoryType# & Sessioncxx . . $ Konsole/Session#::historyTypecxx . . $ Konsole/Session#historyType(4823a4bab87d8bdc).() const
712 {
713 return _emulationcxx . . $ Konsole/Session#_emulation.->historycxx . . $ Konsole/Emulation#history(4823a4bab87d8bdc).();
714 }
715
716 void Sessioncxx . . $ Konsole/Session#::clearHistorycxx . . $ Konsole/Session#clearHistory(49f6e7a06ebc5aa8).()
717 {
718 _emulationcxx . . $ Konsole/Session#_emulation.->clearHistorycxx . . $ Konsole/Emulation#clearHistory(49f6e7a06ebc5aa8).();
719 }
720
721 QStringListcxx . . $ QStringList# Sessioncxx . . $ Konsole/Session#::argumentscxx . . $ Konsole/Session#arguments(e1dbd5c4feadc8f5).() const
722 {
723 return _argumentscxx . . $ Konsole/Session#_arguments.;
724 }
725
726 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::programcxx . . $ Konsole/Session#program(6ef7b6c27b00b43d).() const
727 {
728 return _programcxx . . $ QString#QString(132dd6869045752b).;
729 }
730
731 // unused currently
732 bool Sessioncxx . . $ Konsole/Session#::isMonitorActivitycxx . . $ Konsole/Session#isMonitorActivity(50ce9a9e25b4a850).() const
733 {
734 return _monitorActivitycxx . . $ Konsole/Session#_monitorActivity.;
735 }
736 // unused currently
737 bool Sessioncxx . . $ Konsole/Session#::isMonitorSilencecxx . . $ Konsole/Session#isMonitorSilence(50ce9a9e25b4a850).() const
738 {
739 return _monitorSilencecxx . . $ Konsole/Session#_monitorSilence.;
740 }
741
742 void Sessioncxx . . $ Konsole/Session#::setMonitorActivitycxx . . $ Konsole/Session#setMonitorActivity(b45ddcbc8423892c).(bool _monitor)
743 {
744 _monitorActivitycxx . . $ Konsole/Session#_monitorActivity.=_monitor;
745 _notifiedActivitycxx . . $ Konsole/Session#_notifiedActivity.=false;
746
747 activityStateSetcxx . . $ Konsole/Session#activityStateSet(d4f767463ce0a6b3).(NOTIFYNORMALcxx . . $ Konsole/NOTIFYNORMAL.);
748 }
749
750 void Sessioncxx . . $ Konsole/Session#::setMonitorSilencecxx . . $ Konsole/Session#setMonitorSilence(b45ddcbc8423892c).(bool _monitor)
751 {
752 if (_monitorSilencecxx . . $ Konsole/Session#_monitorSilence.==_monitor) {
753 return;
754 }
755
756 _monitorSilencecxx . . $ Konsole/Session#_monitorSilence.=_monitor;
757 if (_monitorSilencecxx . . $ Konsole/Session#_monitorSilence.) {
758 _monitorTimercxx . . $ Konsole/Session#_monitorTimer.->startcxx . . $ QTimer#start(d4f767463ce0a6b3).(_silenceSecondscxx . . $ Konsole/Session#_silenceSeconds.*1000);
759 } else {
760 _monitorTimercxx . . $ Konsole/Session#_monitorTimer.->stopcxx . . $ QTimer#stop(49f6e7a06ebc5aa8).();
761 }
762
763 activityStateSetcxx . . $ Konsole/Session#activityStateSet(d4f767463ce0a6b3).(NOTIFYNORMALcxx . . $ Konsole/NOTIFYNORMAL.);
764 }
765
766 void Sessioncxx . . $ Konsole/Session#::setMonitorSilenceSecondscxx . . $ Konsole/Session#setMonitorSilenceSeconds(d4f767463ce0a6b3).(int seconds)
767 {
768 _silenceSecondscxx . . $ Konsole/Session#_silenceSeconds.=seconds;
769 if (_monitorSilencecxx . . $ Konsole/Session#_monitorSilence.) {
770 _monitorTimercxx . . $ Konsole/Session#_monitorTimer.->startcxx . . $ QTimer#start(d4f767463ce0a6b3).(_silenceSecondscxx . . $ Konsole/Session#_silenceSeconds.*1000);
771 }
772 }
773
774 void Sessioncxx . . $ Konsole/Session#::setAddToUtmpcxx . . $ Konsole/Session#setAddToUtmp(b45ddcbc8423892c).(bool set)
775 {
776 _addToUtmpcxx . . $ Konsole/Session#_addToUtmp. = set;
777 }
778
779 void Sessioncxx . . $ Konsole/Session#::setFlowControlEnabledcxx . . $ Konsole/Session#setFlowControlEnabled(b45ddcbc8423892c).(bool enabled)
780 {
781 if (_flowControlcxx . . $ Konsole/Session#_flowControl. == enabled) {
782 return;
783 }
784
785 _flowControlcxx . . $ Konsole/Session#_flowControl. = enabled;
786
787 if (_shellProcesscxx . . $ Konsole/Session#_shellProcess.) {
788 _shellProcesscxx . . $ Konsole/Session#_shellProcess.->setFlowControlEnabledcxx . . $ Konsole/Pty#setFlowControlEnabled(b45ddcbc8423892c).(_flowControlcxx . . $ Konsole/Session#_flowControl.);
789 }
790
791 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! flowControlEnabledChangedcxx . . $ Konsole/Session#flowControlEnabledChanged(b45ddcbc8423892c).(enabled);
792 }
793 bool Sessioncxx . . $ Konsole/Session#::flowControlEnabledcxx . . $ Konsole/Session#flowControlEnabled(50ce9a9e25b4a850).() const
794 {
795 return _flowControlcxx . . $ Konsole/Session#_flowControl.;
796 }
797 //void Session::fireZModemDetected()
798 //{
799 // if (!_zmodemBusy)
800 // {
801 // QTimer::singleShot(10, this, SIGNAL(zmodemDetected()));
802 // _zmodemBusy = true;
803 // }
804 //}
805
806 //void Session::cancelZModem()
807 //{
808 // _shellProcess->sendData("\030\030\030\030", 4); // Abort
809 // _zmodemBusy = false;
810 //}
811
812 //void Session::startZModem(const QString &zmodem, const QString &dir, const QStringList &list)
813 //{
814 // _zmodemBusy = true;
815 // _zmodemProc = new KProcess();
816 // _zmodemProc->setOutputChannelMode( KProcess::SeparateChannels );
817 //
818 // *_zmodemProc << zmodem << "-v" << list;
819 //
820 // if (!dir.isEmpty())
821 // _zmodemProc->setWorkingDirectory(dir);
822 //
823 // _zmodemProc->start();
824 //
825 // connect(_zmodemProc,SIGNAL (readyReadStandardOutput()),
826 // this, SLOT(zmodemReadAndSendBlock()));
827 // connect(_zmodemProc,SIGNAL (readyReadStandardError()),
828 // this, SLOT(zmodemReadStatus()));
829 // connect(_zmodemProc,SIGNAL (finished(int,QProcess::ExitStatus)),
830 // this, SLOT(zmodemFinished()));
831 //
832 // disconnect( _shellProcess,SIGNAL(block_in(const char*,int)), this, SLOT(onReceiveBlock(const char*,int)) );
833 // connect( _shellProcess,SIGNAL(block_in(const char*,int)), this, SLOT(zmodemRcvBlock(const char*,int)) );
834 //
835 // _zmodemProgress = new ZModemDialog(QApplication::activeWindow(), false,
836 // i18n("ZModem Progress"));
837 //
838 // connect(_zmodemProgress, SIGNAL(user1Clicked()),
839 // this, SLOT(zmodemDone()));
840 //
841 // _zmodemProgress->show();
842 //}
843
844 /*void Session::zmodemReadAndSendBlock()
845 {
846 _zmodemProc->setReadChannel( QProcess::StandardOutput );
847 QByteArray data = _zmodemProc->readAll();
848
849 if ( data.count() == 0 )
850 return;
851
852 _shellProcess->sendData(data.constData(),data.count());
853 }
854 */
855 /*
856 void Session::zmodemReadStatus()
857 {
858 _zmodemProc->setReadChannel( QProcess::StandardError );
859 QByteArray msg = _zmodemProc->readAll();
860 while(!msg.isEmpty())
861 {
862 int i = msg.indexOf('\015');
863 int j = msg.indexOf('\012');
864 QByteArray txt;
865 if ((i != -1) && ((j == -1) || (i < j)))
866 {
867 msg = msg.mid(i+1);
868 }
869 else if (j != -1)
870 {
871 txt = msg.left(j);
872 msg = msg.mid(j+1);
873 }
874 else
875 {
876 txt = msg;
877 msg.truncate(0);
878 }
879 if (!txt.isEmpty())
880 _zmodemProgress->addProgressText(QString::fromLocal8Bit(txt));
881 }
882 }
883 */
884 /*
885 void Session::zmodemRcvBlock(const char *data, int len)
886 {
887 QByteArray ba( data, len );
888
889 _zmodemProc->write( ba );
890 }
891 */
892 /*
893 void Session::zmodemFinished()
894 {
895 if (_zmodemProc)
896 {
897 delete _zmodemProc;
898 _zmodemProc = 0;
899 _zmodemBusy = false;
900
901 disconnect( _shellProcess,SIGNAL(block_in(const char*,int)), this ,SLOT(zmodemRcvBlock(const char*,int)) );
902 connect( _shellProcess,SIGNAL(block_in(const char*,int)), this, SLOT(onReceiveBlock(const char*,int)) );
903
904 _shellProcess->sendData("\030\030\030\030", 4); // Abort
905 _shellProcess->sendData("\001\013\n", 3); // Try to get prompt back
906 _zmodemProgress->transferDone();
907 }
908 }
909 */
910 void Sessioncxx . . $ Konsole/Session#::onReceiveBlockcxx . . $ Konsole/Session#onReceiveBlock(34d26762b42c433a).( const char * buf, int len )
911 {
912 _emulationcxx . . $ Konsole/Session#_emulation.->receiveDatacxx . . $ Konsole/Emulation#receiveData(34d26762b42c433a).( buf, len );
913 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! receivedDatacxx . . $ Konsole/Session#receivedData(3520e46b33348bf6).( QStringcxx . . $ QString#::fromLatin1cxx . . $ QString#fromLatin1(5ac70cc0fa2a874e).( buf, len ) );
914 }
915
916 QSizecxx . . $ QSize# Sessioncxx . . $ Konsole/Session#::sizecxx . . $ Konsole/Session#size(dc21773d1a733566).()
917 {
918 return _emulationcxx . . $ Konsole/Session#_emulation.->imageSizecxx . . $ Konsole/Emulation#imageSize(4b3b776e5ee2b367).();
919 }
920
921 void Sessioncxx . . $ Konsole/Session#::setSizecxx . . $ Konsole/Session#setSize(1c5f201b4c2f0aba).(const QSizecxx . . $ QSize# & size)
922 {
923 if ((size.widthcxx . . $ QSize#width(ea6fe5115c70a13f).() <= 1) || (size.heightcxx . . $ QSize#height(ea6fe5115c70a13f).() <= 1)) {
924 return;
925 }
926
927 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! resizeRequestcxx . . $ Konsole/Session#resizeRequest(1c5f201b4c2f0aba).(size);
928 }
929 int Sessioncxx . . $ Konsole/Session#::foregroundProcessIdcxx . . $ Konsole/Session#foregroundProcessId(455f465bc33b4cdf).() const
930 {
931 return _shellProcesscxx . . $ Konsole/Session#_shellProcess.->foregroundProcessGroupcxx . . $ Konsole/Pty#foregroundProcessGroup(455f465bc33b4cdf).();
932 }
933
934 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::foregroundProcessNamecxx . . $ Konsole/Session#foregroundProcessName(4365c3963150523e).()
935 {
936 QStringcxx . . $ QString# namecxx . . $ QString#QString(ced63f7c635d850d).;
937
938 if (updateForegroundProcessInfocxx . . $ Konsole/Session#updateForegroundProcessInfo(c9857a73d68e59ba).()) {
939 bool ok = false;
940 name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). _foregroundProcessInfocxx . . $ Konsole/Session#_foregroundProcessInfo.->namecxx . . $ Konsole/ProcessInfo#name(527c08bc36b7c847).(&ok);
941 if (!ok)
942 name.clearcxx . . $ QString#clear(49f6e7a06ebc5aa8).();
943 }
944
945 return namecxx . . $ QString#QString(28715ad661ad3cec).;
946 }
947
948 QStringcxx . . $ QString# Sessioncxx . . $ Konsole/Session#::currentDircxx . . $ Konsole/Session#currentDir(4365c3963150523e).()
949 {
950 QStringcxx . . $ QString# pathcxx . . $ QString#QString(ced63f7c635d850d).;
951 if (updateForegroundProcessInfocxx . . $ Konsole/Session#updateForegroundProcessInfo(c9857a73d68e59ba).()) {
952 bool ok = false;
953 path=cxx . . $ QString#`operator=`(4f35bf974e7f8568). _foregroundProcessInfocxx . . $ Konsole/Session#_foregroundProcessInfo.->currentDircxx . . $ Konsole/ProcessInfo#currentDir(527c08bc36b7c847).(&ok);
954 if (!ok)
955 path.clearcxx . . $ QString#clear(49f6e7a06ebc5aa8).();
956 }
957 return pathcxx . . $ QString#QString(28715ad661ad3cec).;
958 }
959
960 bool Sessioncxx . . $ Konsole/Session#::updateForegroundProcessInfocxx . . $ Konsole/Session#updateForegroundProcessInfo(c9857a73d68e59ba).()
961 {
962 Q_ASSERTcxx . . $ `<external>/15045578679651060896/qglobal.h:859:13`!(_shellProcess);
963
964 const int foregroundPid = _shellProcesscxx . . $ Konsole/Session#_shellProcess.->foregroundProcessGroupcxx . . $ Konsole/Pty#foregroundProcessGroup(455f465bc33b4cdf).();
965 if (foregroundPid != _foregroundPidcxx . . $ Konsole/Session#_foregroundPid.) {
966 delete _foregroundProcessInfocxx . . $ Konsole/Session#_foregroundProcessInfo.;
967 _foregroundProcessInfocxx . . $ Konsole/Session#_foregroundProcessInfo. = ProcessInfocxx . . $ Konsole/ProcessInfo#::newInstancecxx . . $ Konsole/ProcessInfo#newInstance(76b029d04fe475b6).(foregroundPid);
968 _foregroundPidcxx . . $ Konsole/Session#_foregroundPid. = foregroundPid;
969 }
970
971 if (_foregroundProcessInfocxx . . $ Konsole/Session#_foregroundProcessInfo.) {
972 _foregroundProcessInfocxx . . $ Konsole/Session#_foregroundProcessInfo.->updatecxx . . $ Konsole/ProcessInfo#update(49f6e7a06ebc5aa8).();
973 return _foregroundProcessInfocxx . . $ Konsole/Session#_foregroundProcessInfo.->isValidcxx . . $ Konsole/ProcessInfo#isValid(50ce9a9e25b4a850).();
974 } else {
975 return false;
976 }
977 }
978
979
980 int Sessioncxx . . $ Konsole/Session#::processIdcxx . . $ Konsole/Session#processId(455f465bc33b4cdf).() const
981 {
982 return static_cast<int>(_shellProcesscxx . . $ Konsole/Session#_shellProcess.->processIdcxx . . $ QProcess#processId(98833e9ab7de59a4).());
983 }
984 int Sessioncxx . . $ Konsole/Session#::getPtySlaveFdcxx . . $ Konsole/Session#getPtySlaveFd(455f465bc33b4cdf).() const
985 {
986 return ptySlaveFdcxx . . $ Konsole/Session#ptySlaveFd.;
987 }
988
989 SessionGroupcxx . . $ Konsole/SessionGroup#::SessionGroupcxx . . $ Konsole/SessionGroup#SessionGroup(49f6e7a06ebc5aa8).()
990 : _masterModecxx . . $ Konsole/SessionGroup#_masterMode.(0)
991 {
992 }
993 SessionGroupcxx . . $ Konsole/SessionGroup#::~cxx . . $ Konsole/SessionGroup#`~SessionGroup`(ced63f7c635d850d).SessionGroupcxx . . $ Konsole/SessionGroup#()
994 {
995 // disconnect all
996 connectAllcxx . . $ Konsole/SessionGroup#connectAll(b45ddcbc8423892c).(false);
997 }
998 int SessionGroupcxx . . $ Konsole/SessionGroup#::masterModecxx . . $ Konsole/SessionGroup#masterMode(455f465bc33b4cdf).() const
999 {
1000 return _masterModecxx . . $ Konsole/SessionGroup#_masterMode.;
1001 }
1002 QListcxx . . $ QList#<Sessioncxx . . $ Konsole/Session# *> SessionGroupcxx . . $ Konsole/SessionGroup#::sessionscxx . . $ Konsole/SessionGroup#sessions(5edbdf0cd34338c4).() const
1003 {
1004 return _sessionscxx . . $ Konsole/SessionGroup#_sessions..keyscxx . . $ QHash#keys(bf6c511543d55010).();
1005 }
1006 bool SessionGroupcxx . . $ Konsole/SessionGroup#::masterStatuscxx . . $ Konsole/SessionGroup#masterStatus(3a14d2907dd886d).(Sessioncxx . . $ Konsole/Session# * session) const
1007 {
1008 return _sessionscxx . . $ Konsole/SessionGroup#_sessions.[cxx . . $ QHash#`operator[]`(bfda1f1f965926d4).session];
1009 }
1010
1011 void SessionGroupcxx . . $ Konsole/SessionGroup#::addSessioncxx . . $ Konsole/SessionGroup#addSession(ef738ec9ceac78f7).(Sessioncxx . . $ Konsole/Session# * session)
1012 {
1013 _sessionscxx . . $ Konsole/SessionGroup#_sessions..insertcxx . . $ QHash#insert(d77b19c31d2eb147).(session,false);
1014
1015 QListIteratorcxx . . $ QListIterator#<Sessioncxx . . $ Konsole/Session# *> masterItercxx . . $ QListIterator#QListIterator(742a15f66a895bc5).(masterscxx . . $ Konsole/SessionGroup#masters(5edbdf0cd34338c4).());
1016
1017 while ( masterIter.hasNextcxx . . $ QListIterator#hasNext(50ce9a9e25b4a850).() ) {
1018 connectPaircxx . . $ Konsole/SessionGroup#connectPair(9df48e0e96bba1ce).(masterIter.nextcxx . . $ QListIterator#next(1306adbac230aeaa).(),session);
1019 }
1020 }
1021 void SessionGroupcxx . . $ Konsole/SessionGroup#::removeSessioncxx . . $ Konsole/SessionGroup#removeSession(ef738ec9ceac78f7).(Sessioncxx . . $ Konsole/Session# * session)
1022 {
1023 setMasterStatuscxx . . $ Konsole/SessionGroup#setMasterStatus(805765964c1e0c6f).(session,false);
1024
1025 QListIteratorcxx . . $ QListIterator#<Sessioncxx . . $ Konsole/Session# *> masterItercxx . . $ QListIterator#QListIterator(742a15f66a895bc5).(masterscxx . . $ Konsole/SessionGroup#masters(5edbdf0cd34338c4).());
1026
1027 while ( masterIter.hasNextcxx . . $ QListIterator#hasNext(50ce9a9e25b4a850).() ) {
1028 disconnectPaircxx . . $ Konsole/SessionGroup#disconnectPair(9df48e0e96bba1ce).(masterIter.nextcxx . . $ QListIterator#next(1306adbac230aeaa).(),session);
1029 }
1030
1031 _sessionscxx . . $ Konsole/SessionGroup#_sessions..removecxx . . $ QHash#remove(dd8e59d271e40448).(session);
1032 }
1033 void SessionGroupcxx . . $ Konsole/SessionGroup#::setMasterModecxx . . $ Konsole/SessionGroup#setMasterMode(d4f767463ce0a6b3).(int mode)
1034 {
1035 _masterModecxx . . $ Konsole/SessionGroup#_masterMode. = mode;
1036
1037 connectAllcxx . . $ Konsole/SessionGroup#connectAll(b45ddcbc8423892c).(false);
1038 connectAllcxx . . $ Konsole/SessionGroup#connectAll(b45ddcbc8423892c).(true);
1039 }
1040 QListcxx . . $ QList#<Sessioncxx . . $ Konsole/Session# *> SessionGroupcxx . . $ Konsole/SessionGroup#::masterscxx . . $ Konsole/SessionGroup#masters(5edbdf0cd34338c4).() const
1041 {
1042 return _sessionscxx . . $ Konsole/SessionGroup#_sessions..keyscxx . . $ QHash#keys(51df8dcb2df63ae8).(true);
1043 }
1044 void SessionGroupcxx . . $ Konsole/SessionGroup#::connectAllcxx . . $ Konsole/SessionGroup#connectAll(b45ddcbc8423892c).(bool connect)
1045 {
1046 QListIteratorcxx . . $ QListIterator#<Sessioncxx . . $ Konsole/Session# *> masterItercxx . . $ QListIterator#QListIterator(742a15f66a895bc5).(masterscxx . . $ Konsole/SessionGroup#masters(5edbdf0cd34338c4).());
1047
1048 while ( masterIter.hasNextcxx . . $ QListIterator#hasNext(50ce9a9e25b4a850).() ) {
1049 Sessioncxx . . $ Konsole/Session# * master = masterIter.nextcxx . . $ QListIterator#next(1306adbac230aeaa).();
1050
1051 QListIteratorcxx . . $ QListIterator#<Sessioncxx . . $ Konsole/Session# *> otherItercxx . . $ QListIterator#QListIterator(742a15f66a895bc5).(_sessionscxx . . $ Konsole/SessionGroup#_sessions..keyscxx . . $ QHash#keys(bf6c511543d55010).());
1052 while ( otherIter.hasNextcxx . . $ QListIterator#hasNext(50ce9a9e25b4a850).() ) {
1053 Sessioncxx . . $ Konsole/Session# * other = otherIter.nextcxx . . $ QListIterator#next(1306adbac230aeaa).();
1054
1055 if ( other != master ) {
1056 if ( connect ) {
1057 connectPaircxx . . $ Konsole/SessionGroup#connectPair(9df48e0e96bba1ce).(master,other);
1058 } else {
1059 disconnectPaircxx . . $ Konsole/SessionGroup#disconnectPair(9df48e0e96bba1ce).(master,other);
1060 }
1061 }
1062 }
1063 }
1064 }
1065 void SessionGroupcxx . . $ Konsole/SessionGroup#::setMasterStatuscxx . . $ Konsole/SessionGroup#setMasterStatus(805765964c1e0c6f).(Sessioncxx . . $ Konsole/Session# * session, bool master)
1066 {
1067 bool wasMaster = _sessionscxx . . $ Konsole/SessionGroup#_sessions.[cxx . . $ QHash#`operator[]`(bbd415b616967878).session];
1068 _sessionscxx . . $ Konsole/SessionGroup#_sessions.[cxx . . $ QHash#`operator[]`(bbd415b616967878).session] = master;
1069
1070 if (wasMaster == master) {
1071 return;
1072 }
1073
1074 QListIteratorcxx . . $ QListIterator#<Sessioncxx . . $ Konsole/Session# *> itercxx . . $ QListIterator#QListIterator(742a15f66a895bc5).(_sessionscxx . . $ Konsole/SessionGroup#_sessions..keyscxx . . $ QHash#keys(bf6c511543d55010).());
1075 while (iter.hasNextcxx . . $ QListIterator#hasNext(50ce9a9e25b4a850).()) {
1076 Sessioncxx . . $ Konsole/Session# * other = iter.nextcxx . . $ QListIterator#next(1306adbac230aeaa).();
1077
1078 if (other != session) {
1079 if (master) {
1080 connectPaircxx . . $ Konsole/SessionGroup#connectPair(9df48e0e96bba1ce).(session, other);
1081 } else {
1082 disconnectPaircxx . . $ Konsole/SessionGroup#disconnectPair(9df48e0e96bba1ce).(session, other);
1083 }
1084 }
1085 }
1086 }
1087
1088 void SessionGroupcxx . . $ Konsole/SessionGroup#::connectPaircxx . . $ Konsole/SessionGroup#connectPair(9df48e0e96bba1ce).(Sessioncxx . . $ Konsole/Session# * master , Sessioncxx . . $ Konsole/Session# * other) const
1089 {
1090 // qDebug() << k_funcinfo;
1091
1092 if ( _masterModecxx . . $ Konsole/SessionGroup#_masterMode. & CopyInputToAllcxx . . $ Konsole/SessionGroup#CopyInputToAll. ) {
1093 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Connection session " <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). master->nameTitlecxx . . $ Konsole/Session#nameTitle(6ef7b6c27b00b43d).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "to" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). other->nameTitlecxx . . $ Konsole/Session#nameTitle(6ef7b6c27b00b43d).();
1094
1095 connectcxx . . $ QObject#connect(158df1d9a01a3410).( master->emulationcxx . . $ Konsole/Session#emulation(6c49a54d02df9d82).() , SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(sendData(const char *,int)) , other->emulationcxx . . $ Konsole/Session#emulation(6c49a54d02df9d82).() ,
1096 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(sendString(const char *,int)) );
1097 }
1098 }
1099 void SessionGroupcxx . . $ Konsole/SessionGroup#::disconnectPaircxx . . $ Konsole/SessionGroup#disconnectPair(9df48e0e96bba1ce).(Sessioncxx . . $ Konsole/Session# * master , Sessioncxx . . $ Konsole/Session# * other) const
1100 {
1101 // qDebug() << k_funcinfo;
1102
1103 if ( _masterModecxx . . $ Konsole/SessionGroup#_masterMode. & CopyInputToAllcxx . . $ Konsole/SessionGroup#CopyInputToAll. ) {
1104 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Disconnecting session " <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). master->nameTitlecxx . . $ Konsole/Session#nameTitle(6ef7b6c27b00b43d).() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "from" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). other->nameTitlecxx . . $ Konsole/Session#nameTitle(6ef7b6c27b00b43d).();
1105
1106 disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).( master->emulationcxx . . $ Konsole/Session#emulation(6c49a54d02df9d82).() , SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(sendData(const char *,int)) , other->emulationcxx . . $ Konsole/Session#emulation(6c49a54d02df9d82).() ,
1107 SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(sendString(const char *,int)) );
1108 }
1109 }
1110
1111 //#include "moc_Session.cpp"