Commit Graph

37 Commits

Author SHA1 Message Date
hjk
c36b1e40b0 Ssh: Use Utils::CommandLine in SshRemoteProcess
Change-Id: I074ca3e1e8ec8ce990d6b314a4a87de2f656566c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 16:03:18 +00:00
hjk
fa81f76237 Utils: Move meta char policy handling from FilePath to ConsoleProcess
Currently the only place that's using it and the scope is much smaller.

Change-Id: I1a43d14f0e2c69a16f76e6f83b82436bbeeac1c9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 16:03:02 +00:00
hjk
2b26eca80f SshDevice: Use qint64 for processId
De-facto standard and reduces numbers of warnings.

Change-Id: Ic7758ee30091aaa47650a9697145a302480b31de
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 11:52:56 +00:00
hjk
1396c6e8e9 ProjectExplorer: Use Utils::FileName for Runnable::executable
Change-Id: I584bc18aa19a4c9886af7b13e95052dfd4350b34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-21 10:32:31 +00:00
Eike Ziller
917636b88b Merge remote-tracking branch 'origin/4.10'
Conflicts:
        src/libs/utils/consoleprocess.h
        src/libs/utils/consoleprocess_unix.cpp
        src/libs/utils/consoleprocess_win.cpp
        src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp
        src/tools/clangrefactoringbackend/source/symbolscollector.cpp
        tests/unit/mockup/projectexplorer/project.h

Change-Id: I8d10f26b9bcb54829ba31cdc2272885691df1e16
2019-06-18 12:30:55 +02:00
Christian Kandeler
acfe45c434 SSH: Fix running remote process in terminal
ConsoleProcess stumbles over the special characters in the remote
command and as a result silently runs the command locally instead.
Prevent that. We can (and should) simply leave these characters alone,
as they have no special meaning on the local machine.

Change-Id: I31b3afe1cf170e51d431372b15f4df3656006959
Reviewed-by: hjk <hjk@qt.io>
2019-06-14 12:18:48 +00:00
hjk
465d4cc845 Utils: Use CommandLine in ConsoleProcess
Change-Id: I380b91513fa342819cba898196c91443622d0ae2
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-06-13 07:28:45 +00:00
Christian Kandeler
0a555018d1 SSH: Pass remote command as QString
The old implementation sent the command over the wire as-is, so we
declared it as a QByteArray and let the caller choose the encoding. This
doesn't make sense anymore, as the command is now passed to an external
process as a QString anyway.

Change-Id: Ib84bc0f871db2b45b93f71d924c4177cc28d3bb0
Reviewed-by: hjk <hjk@qt.io>
2019-05-24 09:08:49 +00:00
hjk
164ae1428e ProjectExplorer: Move RunControl related classes to separate file pair
Change-Id: I5da56f80336673d595907abcc797f628be680cd5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-13 14:44:46 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
Christian Kandeler
b89865b967 RemoteLinux: Offer to open a remote shell
... in the settings dialog.
This allows users to poke around in the device they'be just configured,
e.g. for doing quick custom checks.

[ChangeLog] A remote shell can now be started for Linux devices.

Change-Id: I4570ca89d64606029759767a9f771168d7273510
Reviewed-by: hjk <hjk@qt.io>
2019-01-11 12:45:28 +00:00
Christian Kandeler
8a2327068e RemoteLinux: Support terminal aspect
This is possible now that the remote process is started via a local
tool.

[ChangeLog] Remote Linux applications can be run in a terminal now.

Change-Id: I9f7df87563a18880d85c6d16ad18fb10a4d9f0e0
Reviewed-by: hjk <hjk@qt.io>
2019-01-11 10:13:52 +00:00
Christian Kandeler
a5cf6f194d SSH: Fix exit status/exit code interpretation
A "regular" exit of the ssh binary with exit code 255 means that the
remote process has crashed.

Change-Id: I82e6e44079041459e78e4f8f7e7b6e5cbcaa6c44
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-12-14 11:26:30 +00:00
Christian Kandeler
d7178b88c4 SSH: Use OpenSSH tools
... instead of our own SSH library.

Advantages:
    - Full compatibility with OpenSSH behavior guaranteed.
    - Minimal maintenance effort.
    - Less code to build.
    - Big chunk of 3rd party sources can be removed from our repository.

One the downside, Windows users now need to install OpenSSH for
RemoteLinux support. Hoewever, people doing embedded development
probably have it installed anyway.

[ChangeLog] Switched SSH backend to OpenSSH

Fixes: QTCREATORBUG-15744
Fixes: QTCREATORBUG-15807
Fixes: QTCREATORBUG-19306
Fixes: QTCREATORBUG-20210
Change-Id: Ifcfefdd39401e45ba1f4aca35d2c5bf7046c7aab
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-12-13 15:10:11 +00:00
Christian Kandeler
d775c26bcd RemoteLinux: Offer X11 forwarding in run configurations
Change-Id: I736d76e072a97fa148286c30c4ca36bf4c1253e2
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 09:13:00 +00:00
Eike Ziller
e28eb85e8a Merge remote-tracking branch 'origin/4.7' into 4.8
Change-Id: Iaae859601ae4f529c1fa7ada3a5c569820abb0d6
2018-09-26 09:38:33 +02:00
Jonathan Liu
813c16854d SshDeviceProcess: Don't emit readyRead signals if no data available
Task-number: QTCREATORBUG-19367
Change-Id: I477800b2e2060748c2b5f9fde3acc91d9f5ae176
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-21 13:12:10 +00:00
Tobias Hunger
80c2ce118d ProjectExplorer: Modernize even more
Use unique_ptr for all *Private classes, except for those
in singletons.

Change-Id: Ib56c31ddedc6e9cf321f15de1f1e697a27ad4089
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-24 09:04:54 +00:00
Alessandro Portale
8d19333075 ProjectExplorer: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: Iebed22caa2e733d292f334e956e3d16b844e14e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-16 10:01:53 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
hjk
68867a8a62 ProjectExplorer: Start merging Runnable and StandardRunnable
With AndroidRunnable gone, there is only one incarnation of
a Runnable left - the StandardRunnable.

It is not expected to ever need a different runnable again,
as platform differences are now handled in the platform specific
RunConfigurations and RunWorkers created there locally, and
global information is typically communicated via
RunConfigurationAspects, so there is no point in keeping the
Runnable::{Concept,Model} machinery.

This patch here essentially makes StandardRunnable a type alias
for Runnable, to allow downstream changing all

  if (r.is<StandardRunnable>()) { ... r.as<StandardRunnable>(); }

one by one.

When all downstream is adjusted, the alias can go completely.

Change-Id: I86aa92c7fae8d54ca603484b7e1746c126b0bddb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-22 08:24:46 +00:00
Nikita Baryshnikov
d6d761d848 SshDeviceProcessPrivate: direct init fields
Change-Id: I2755ce51874ceceb3d9a3475ae1971366080f00d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-25 15:21:59 +00:00
Ulf Hermann
0bef62481b RemoteLinux: Allow killing processes by ID
Killing every process on the system that happens to have the same name
as the one we've started is error prone and dangerous. We might kill
processes we haven't started and other processes might rename
themselves at runtime so that we don't find them anymore.

The process ID is obtained by outputting it as very first thing on
stdout and then starting the process with "exec", so that it isn't
forked.

Change-Id: Icc51bd1968afc47f4dc42f9e90e5dcbd0b1e40a7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-04-22 08:50:39 +00:00
hjk
24660c23e3 RemoteLinux: Fix fetching of remote environment
A QLatin1String isn't a StandardRunnable.
This fixes a regression introduced in 58be2708a.

Change-Id: I6b3bb337227631011a6bc26c938945bb0e912e62
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-04-06 13:58:08 +00:00
Orgad Shaneh
15f8bb07ed ProjectExplorer: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I619db09a79760186b72e7662490ed1205155c1a7
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-01 15:51:34 +00:00
hjk
58be2708a3 ProjectExplorer: Use Runnable in DeviceProcess::start
Change-Id: I8ce5b536745db11980f43449a055b7ebf9da83d2
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-01-28 13:27:30 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
ea27143239 Merge remote-tracking branch 'origin/3.2'
Conflicts:
	src/libs/utils/ipaddresslineedit.cpp
	src/libs/utils/logging.h
	src/plugins/analyzerbase/AnalyzerBase.pluginspec.in
	src/plugins/android/Android.pluginspec.in
	src/plugins/android/androiddeploystep.cpp
	src/plugins/android/androiddeploystep.h
	src/plugins/android/androiddeploystepfactory.cpp
	src/plugins/android/androiddeploystepwidget.cpp
	src/plugins/android/androidpackagecreationfactory.cpp
	src/plugins/android/androidpackagecreationstep.cpp
	src/plugins/android/androidpackagecreationstep.h
	src/plugins/android/androidpackagecreationwidget.cpp
	src/plugins/android/androidpackagecreationwidget.h
	src/plugins/android/javafilewizard.cpp
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/baremetal/BareMetal.pluginspec.in
	src/plugins/bazaar/Bazaar.pluginspec.in
	src/plugins/beautifier/Beautifier.pluginspec.in
	src/plugins/bineditor/BinEditor.pluginspec.in
	src/plugins/bookmarks/Bookmarks.pluginspec.in
	src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in
	src/plugins/clangcodemodel/clanghighlightingsupport.cpp
	src/plugins/clangcodemodel/clangsymbolsearcher.cpp
	src/plugins/classview/ClassView.pluginspec.in
	src/plugins/clearcase/ClearCase.pluginspec.in
	src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in
	src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp
	src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
	src/plugins/coreplugin/Core.pluginspec.in
	src/plugins/cpaster/CodePaster.pluginspec.in
	src/plugins/cppeditor/CppEditor.pluginspec.in
	src/plugins/cppeditor/cppfilewizard.cpp
	src/plugins/cpptools/CppTools.pluginspec.in
	src/plugins/cpptools/cpphighlightingsupportinternal.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.h
	src/plugins/cvs/CVS.pluginspec.in
	src/plugins/debugger/Debugger.pluginspec.in
	src/plugins/designer/Designer.pluginspec.in
	src/plugins/diffeditor/DiffEditor.pluginspec.in
	src/plugins/emacskeys/EmacsKeys.pluginspec.in
	src/plugins/fakevim/FakeVim.pluginspec.in
	src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in
	src/plugins/git/Git.pluginspec.in
	src/plugins/git/gitorious/gitorious.cpp
	src/plugins/git/gitorious/gitorious.h
	src/plugins/git/gitorious/gitoriousclonewizard.cpp
	src/plugins/git/gitorious/gitorioushostwidget.cpp
	src/plugins/git/gitorious/gitorioushostwidget.h
	src/plugins/git/gitorious/gitorioushostwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.h
	src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwizardpage.h
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.h
	src/plugins/glsleditor/GLSLEditor.pluginspec.in
	src/plugins/glsleditor/glsleditorfactory.cpp
	src/plugins/glsleditor/glslfilewizard.cpp
	src/plugins/helloworld/HelloWorld.pluginspec.in
	src/plugins/help/Help.pluginspec.in
	src/plugins/imageviewer/ImageViewer.pluginspec.in
	src/plugins/ios/Ios.pluginspec.in
	src/plugins/macros/Macros.pluginspec.in
	src/plugins/mercurial/Mercurial.pluginspec.in
	src/plugins/perforce/Perforce.pluginspec.in
	src/plugins/projectexplorer/ProjectExplorer.pluginspec.in
	src/plugins/pythoneditor/PythonEditor.pluginspec.in
	src/plugins/pythoneditor/pythoneditorwidget.cpp
	src/plugins/pythoneditor/wizard/pythonfilewizard.cpp
	src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in
	src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
	src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in
	src/plugins/qmakeprojectmanager/profileeditorfactory.cpp
	src/plugins/qmldesigner/QmlDesigner.pluginspec.in
	src/plugins/qmljseditor/QmlJSEditor.pluginspec.in
	src/plugins/qmljseditor/qmljseditorfactory.cpp
	src/plugins/qmljstools/QmlJSTools.pluginspec.in
	src/plugins/qmlprofiler/QmlProfiler.pluginspec.in
	src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in
	src/plugins/qnx/Qnx.pluginspec.in
	src/plugins/qtsupport/QtSupport.pluginspec.in
	src/plugins/remotelinux/RemoteLinux.pluginspec.in
	src/plugins/resourceeditor/ResourceEditor.pluginspec.in
	src/plugins/resourceeditor/resourcewizard.h
	src/plugins/subversion/Subversion.pluginspec.in
	src/plugins/tasklist/TaskList.pluginspec.in
	src/plugins/texteditor/TextEditor.pluginspec.in
	src/plugins/texteditor/basetexteditor_p.h
	src/plugins/texteditor/basetextmark.cpp
	src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h
	src/plugins/texteditor/codeassist/defaultassistinterface.h
	src/plugins/texteditor/codeassist/iassistproposalitem.cpp
	src/plugins/texteditor/itexteditor.cpp
	src/plugins/texteditor/itexteditor.h
	src/plugins/texteditor/itextmark.cpp
	src/plugins/texteditor/plaintexteditor.cpp
	src/plugins/texteditor/plaintexteditor.h
	src/plugins/texteditor/texteditoractionhandler.cpp
	src/plugins/todo/Todo.pluginspec.in
	src/plugins/updateinfo/UpdateInfo.pluginspec.in
	src/plugins/valgrind/Valgrind.pluginspec.in
	src/plugins/vcsbase/VcsBase.pluginspec.in
	src/plugins/welcome/Welcome.pluginspec.in
	src/plugins/winrt/WinRt.pluginspec.in
	tests/auto/debugger/temporarydir.h

Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
2014-10-14 15:36:16 +02:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
hjk
6431ab2c79 Use Qt 5's QStringList::join(QChar)
Less typing and less cycles than join(QString) where appropriate

Change-Id: I6ebc0e17e4d7fd9845864dd95b7de4ba4dad6906
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-08-25 08:21:14 +02:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Christian Kandeler
066f7b7594 Device support: Make sure a DeviceProcess always "finishes".
We cannot technically enforce a remote process to actually terminate,
but we don't want the associated DeviceProcess to "hang" forever.
Therefore, we now
    a) check whether the kill operation reports an error and
    b) start a timer after starting the kill operation.
If the kill operation either "officially" fails or does not have the
desired effect of actually terminating the process within a given time
frame, we set the DeviceProcess to "finished" manually. This is the same
thing that already happens when the connection gets lost, where we also
report the DeviceProcess as finished, even though the remote process
might still be running.

Change-Id: I5620f90453463c64d3a84abd30f1ec7eec9d492d
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-10-17 10:14:11 +02:00
David Schulz
a06af35631 ProjectExplorer: Introduce DeviceProcessSignalOperation.
Every device can now return a DeviceProcessSignalOperation,
which allows to kill or interrupt processes running on the
device.

Change-Id: Idaa04ebc767e09ca167fa033ed93860b9b81479e
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-20 10:48:47 +02:00
hjk
122b7344d9 Clean up SshConnectionManager interface
Change-Id: Id1541f83f431171dbdd94d5dd48f93e1c2cdf6fb
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2013-09-11 15:08:27 +02:00
hjk
d46cecebdc DeviceProcess: Add write(const QByteArray &) function
Change-Id: Ia8e00c354056b96b966e7cdb86e51f838e70e738
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2013-09-10 16:36:49 +02:00
Christian Kandeler
22599094b0 Introduce the concept of a "device process".
Provide a QProcess-like abstraction that can be used
to implement processes running locally or on a remote
device. Objects of a concrete class implementing the functionality
are created by IDevice objects.
Current implementations are:
     - Local execution (QProcess-based), provided via the DesktopDevice.
     - Remote execution via SSH.
     - A specialized case of the former for remote Linux systems (provided by
       LinuxDevice).
The latter is already being used in a number of places. As a result, lots of
code dealing with details such as setting the remote environment could be
moved to a central location. These things are no longer the concern of whoever
is wishing to run a remote process.

Change-Id: I919260ee6e77a020ca47226a4a534e7b8398106f
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-08-19 16:13:21 +02:00