Commit Graph

168 Commits

Author SHA1 Message Date
Kurt Hindenburg
edcb028d29 const & foreach loop 2016-09-04 17:27:12 -04:00
Martin T. H. Sandsmark
e7770aba9f Avoid polling processes if they report what we need with OCS7
This is apparently what the OCS7 stuff is supposed to solve, so let's
use it if we can.

REVIEW: 128784
BUG: 325442
2016-08-28 17:04:18 +02:00
Martin T. H. Sandsmark
392ee33cf8 Don't re-read process information that should be static
This changes the process info code to only update the information that
can change about a process when updating information about a process.

CCBUG: 325442
REVIEW: 128777
2016-08-27 22:41:18 +02:00
Martin T. H. Sandsmark
e07a62ede3 Remove unused environment reading code
REVIEW: 128674
CCBUG: 325442
2016-08-27 13:26:06 +02:00
Kurt Hindenburg
a805f856ff For remote ssh processes, add %U which gets replaced by user@ if present
Add a new string replacement %U for remote tabs, which evaluates
to _user@ if user is non-empty, and the empty string otherwise.

Patch by Tobias Berner tcberner gmail com

Part of REVIEW 127525
2016-07-09 18:45:39 -04:00
Kurt Hindenburg
d424d1457d Try to catch ssh command arguments for tab titles
When using 'ssh server command args', try to gather the command args
for use in the tab titles. This doesn't work 100% and suggest using
quotes around the ssh command.

Patch by Tobias Berner tcberner gmail com

Part of REVIEW 127525
2016-07-09 18:30:53 -04:00
Kurt Hindenburg
2c93676978 Fix FreeBSD readArguments and implement its readEnvironment
* FreeBSD's readArguments() implementation was broken:
    It read the wrong sysctl.
    Also the string processing did not work as expected.
* FreeBSD's readEnvironment() was not implemented.
    This provides an implementation using libprocstat's
     procstat_getenvv

Tested on my system w/ FreeBSD 11.0-CURRENT

Patch by Tobias Berner tcberner gmail com

Part of REVIEW 127525
2016-07-09 13:58:43 -04:00
Kurt Hindenburg
272c8f7fd8 Q_OS_MAC -> Q_OS_OSX
Q_OS_MAC includes OSX and iOS

Patch from rjvbertin gmail com
2016-07-07 15:53:57 -04:00
Kurt Hindenburg
527d2606be Port KDE_struct_stat to QT_STATBUF; KDE::stat to QT_STAT
Re-commit this patch from Feb 2015; I was told it caused Konsole to not
build on Mac OSX.  However, it builds now fine on my system.

For Q_OS_MAC only
2016-07-07 15:25:59 -04:00
Kurt Hindenburg
0edded4975 Only readUserName if tab title format has %u
readUserName() reads /etc/passwd every few seconds.  Change it to only
do this if we need to replace %u with the user name in the tab title.

A temporary helper as this doesn't really fix the underlining issue.
ProcessInfo really needs re-worked.

CCBUG: 325442
2016-05-30 19:58:03 -04:00
Kurt Hindenburg
bdee35bf38 Use QStringLiteral and QLatin1String 2015-10-15 16:25:32 -04:00
Kurt Hindenburg
0fdc52b222 Use QFlags:: for Field enum 2015-10-10 20:23:09 -04:00
Kurt Hindenburg
f5bb2f1c5d For MacOSX, get it so that it builds
Remove kde_file and comment out parts that used it.  Konsole currently
builds on OSX but dies upon startup

kdelibs4support/src/kdecore/kcmdlineargs.cpp +1492
2015-09-13 17:26:30 -07:00
Kurt Hindenburg
15a903a6d1 Revert "Port KDE_struct_stat to QT_STATBUF; KDE::stat to QT_STAT"
This was only for the MAC and I've been told it doesn't compile.
I will research later.

This reverts commit 142727dd67.
2015-02-10 13:16:10 -10:00
Kurt Hindenburg
142727dd67 Port KDE_struct_stat to QT_STATBUF; KDE::stat to QT_STAT
For Q_OS_MAC only
2015-02-08 09:52:29 -10:00
Kurt Hindenburg
be2b2b4b2e call readLine() without arg to be set maxlen=0 as default
Qt dev overloads readline()

call to member function 'readLine' is ambiguous

Thanks to Takahiro Hashimoto for report and fix

BUG: 343851
2015-02-07 09:37:56 -10:00
Montel Laurent
5d4cda3e2f kdelibs4support-- 2014-10-18 13:03:41 +02:00
Montel Laurent
0acf9a7712 Remove kdelibs4support 2014-10-17 13:40:30 +02:00
Montel Laurent
8182ac8edc Port to QDebug 2014-10-17 09:09:20 +02:00
Kurt Hindenburg
b9b17cae4d Clarify QFile:: error enums 2014-04-15 10:33:06 -04:00
Kurt Hindenburg
99059278ca Clarify enums for ProcessInfo - possible match w/ QFile's enums 2014-04-15 10:09:19 -04:00
Patrick Spendrin
b79701cefd do not build UnixProcessInfo on Windows 2013-11-26 21:00:10 +01:00
Kurt Hindenburg
08fb406533 Use cmake to check if we're on DragonFly BSD instead of __DragonFly__
builds on dragonfly 3.4-RELEASE DragonFly
2013-09-13 23:45:34 -04:00
Kurt Hindenburg
93186a2d53 On MacOSX setPid - strange I never notice this was missing before 2013-09-07 13:08:52 -04:00
Pino Toscano
f72af085ae ProcessInfo: isolate all the platform-specific *ProcessInfo implementations
compile all the platform-specific *ProcessInfo implementations only
in the OS they belong to, basically extending this conditional
compilation also to the Linux and Solaris implementations.

This allows to use proper OS-specific API/etc in each, removing quirks
(like the one for the Solaris psinfo struct) to emulate such APIs on
other OSes.
2013-08-01 16:53:06 +02:00
Kurt Hindenburg
86880dff46 Fix a minor krazy issue about dup #include 2013-07-12 10:27:02 -04:00
Kurt Hindenburg
f051b6cd20 minor style fixes
GIT_SILENT
2013-04-27 09:25:04 -04:00
Kurt Hindenburg
160ac87b59 Remove unnecessary Q_OS_MAC checks and includes
This compiles under 10.8.x - I don't have a 10.7 system to check
2013-04-13 15:39:42 -04:00
Kurt Hindenburg
2c686b7afe Minor warning fixes when running under FreeBSD 2013-02-23 10:00:25 -05:00
Kurt Hindenburg
983efbc5a8 Add braces around if/else for readability 2012-12-19 23:41:09 -05:00
Jekyll Wu
1a26982427 "#ifdef(XYZ)" -> "#if defined(XYZ)"
Use one form consistently in all code
2012-11-20 11:42:12 +08:00
Jekyll Wu
e245ac718c Revert "Refacotr and move the logic of parsing ssh command into a separate function"
This reverts commit 5a5fd23696.

This comes as one part of reverting all the work related with the
refactoring of the ssh command parser. That big refactoring commit
5a5fd236 causes some hard to debug crashes/problems. For the long term
benefit, reverting now and early is a good choice. I will try to redo the
refactoring in a better way for KDE SC 4.11, but for the upcoming 4.10
stability more important.
2012-11-12 00:09:41 +08:00
Jekyll Wu
62b08e79a7 Revert "Fix comment typo"
This reverts commit 726c52c4cf.

This comes as one part of reverting all the work related with the
refactoring of the ssh command parser. That big refactoring commit
5a5fd236 causes some hard to debug crashes/problems. For the long term
benefit, reverting now and early is a good choice. I will try to redo the
refactoring in a better way for KDE SC 4.11, but for the upcoming 4.10
stability more important.
2012-11-12 00:09:26 +08:00
Jekyll Wu
16f198f974 Revert "Remove one not-really-needed member variable"
This reverts commit c0079755eb.

This comes as one part of reverting all the work related with the
refactoring of the ssh command parser. That big refactoring commit
5a5fd236 causes some hard to debug crashes/problems. For the long term
benefit, reverting now and early is a good choice. I will try to redo the
refactoring in a better way for KDE SC 4.11, but for the upcoming 4.10
stability more important.
2012-11-12 00:09:12 +08:00
Jekyll Wu
dd03ff80d6 Revert "For SSH processes, return if no arguments are found."
This reverts commit 5e010083e9.

This comes as one part of reverting all the work related with the
refactoring of the ssh command parser. That big refactoring commit
5a5fd236 causes some hard to debug crashes/problems. For the long term
benefit, reverting now and early is a good choice. I will try to redo the
refactoring in a better way for KDE SC 4.11, but for the upcoming 4.10
stability more important.
2012-11-12 00:06:23 +08:00
Kurt Hindenburg
5e010083e9 For SSH processes, return if no arguments are found.
Without this, I'm getting crashes on my Mac box.
2012-11-10 16:11:18 -05:00
Jekyll Wu
c0079755eb Remove one not-really-needed member variable 2012-11-04 12:57:27 +08:00
Jekyll Wu
726c52c4cf Fix comment typo
SVN_SILENT
2012-11-04 12:53:44 +08:00
Jekyll Wu
5a5fd23696 Refacotr and move the logic of parsing ssh command into a separate function
That make the code easier to read and test, and also comes as a preparation for
writing parser for other remote connection commands, like mosh, dropbear, etc.
2012-11-04 12:17:30 +08:00
Jekyll Wu
659d2c60ae Add the support of gathering process information on OpenBSD
Thanks to Vadim Zhukov for providing the patch

FEATURE: 305362
REVIEW: 106129

FIXED-IN: 4.10.0
2012-10-18 04:17:32 +08:00
Kurt Hindenburg
569ffb37e4 remove kWarning 2012-06-18 09:16:18 -04:00
Kurt Hindenburg
1ce424142f Use readlink instead of QFileInfo to prevent non-responsive issues.
The current code using QFileInfo on the /proc/%pid/cwd and for some
situations, this may cause issues as QFileInfo hangs if unable to read that
file.  The new code uses readlink which appears to work w/o issue.

The Solaris  code needs fixed as well.

CCBUG: 251351
2012-06-18 08:56:11 -04:00
Jekyll Wu
a3b73317fd Small krazy fix for including header 2012-06-14 16:20:47 +08:00
Kurt Hindenburg
bee9aa8f78 minor style fixes - remove empty lines start/end code blocks 2012-05-13 10:08:05 -04:00
Jekyll Wu
fd11d1cccf Add missing ssh commandline options
The new options are take from the manual of openssh-6.0
2012-05-06 04:43:42 +08:00
Jekyll Wu
59c635f552 Add formatter %h which expands to local hostname in local session
Note: this %h is different from the %h which expands to remote hostname
in remote session.

REVIEW: 104490
2012-04-09 22:50:23 +08:00
Kurt Hindenburg
5b083640ce whitespace and style fixes
Use 'git diff -w --ignore-all-space' to see non-whitespace changes
2012-04-05 11:08:53 -04:00
Kurt Hindenburg
f28b60ba09 Fix crash for 'ssh -t localhost bash -l'
This needs to be handled better but for now stop crashing.

BUG: 297156
2012-03-30 21:21:56 -04:00
Kurt Hindenburg
519e2614d6 Style fixes - remove spaces before ; and add spaces in for loops 2012-03-18 15:11:06 -04:00
Jekyll Wu
25b8b5353c Trivial style change: remove extra blank lines 2012-03-17 19:53:21 +08:00