Commit Graph

44349 Commits

Author SHA1 Message Date
Ivan Donchevskii
29b7914429 Utils: workaround for saving file opened by another application
...fixes file saving on Windows in specific circumstances.

File deletion on Windows is quite tricky. If you simply
remove the file opened by another app that shares it for
deletion the file might become semi-removed. It looks
like it still exists but it is in fact inaccessible for
any operations until the other app frees the handle.

To solve that case there is a ReplaceFile API call
which carefully deals with that case.

[Backstory] Oswald Buddenhagen insists that this fix is
rather a workaround and we should solve file access
problem in llvm.
For that purpose we have QTCREATORBUG-19404 and upstream
https://bugs.llvm.org/show_bug.cgi?id=35558

Task-number: QTCREATORBUG-15449
Change-Id: If37d484231b79d8e33822c795232dc31243c88c0
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 13:55:41 +00:00
Ivan Donchevskii
010fb41700 Utils: take control over QTemporaryFile file lock
When we derive from QTemporaryFile we can't unlock file
to be used by outer functions.
With this change lock is managed by m_tempFile variable and
can be released by reseting m_tempFile.

Change-Id: I41339410471c69d1e73df49f04bc2d5c2036a064
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 13:55:30 +00:00
Ivan Donchevskii
0dafe5cb8c Utils: improve savefile error messages
Change-Id: I505c33e1e56a67a3682de2e2cbfe2ab967d04242
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 13:55:23 +00:00
Christian Stenger
8187c6a146 Squish: Assign custom name to distinguish main tabbar from others
If the settings dialog contains more than one visible tabbar when
trying to access its tabs Squish fails to distinguish them.
Assign a unique name for the main tabbar of a category inside
the settings dialog.

Change-Id: I349b480871306784b5adc9858984933dc26d7958
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-12-15 13:53:45 +00:00
hjk
6c537b35d5 TextEditor: Dissolve QuickFixAssistProcessor
... into QuickFixAssistProcessor and QmlJSQuickFixAssistProcessor,
by essentially duplicating the class, but moving the actual work to
a new a GenericProposal::createProposal(...QuickFixOperations...)

Less indirection, and less code in total.

Change-Id: I2f8cba970bf587c9cbf04321269a60ed51bfae2a
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 11:59:33 +00:00
hjk
d47fdb934d Debugger: Change semantics of DebuggerEngine::masterEngine()
Make it return 'this' if 'this' is the master engine itself.
Adapt users.

Also do not let the QmlEngine try to beginConnection() when
the combined engine was isDying() already.

Change-Id: I308deae14a3c4966be381f321c0d9dfaf82c40d6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-12-15 11:50:01 +00:00
hjk
ff04632b92 TextEditor: Remove QuickFixAssistProvider
It did not contain any functionality beyond the base IAssistProvider
anymore.

Change-Id: I0198b3d629f81be8c994ffed3904b5f12ee7f9b9
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 11:42:40 +00:00
hjk
4f3ac0382a TextEditor: Use more direct access to quick fix factories
Change-Id: I65fc5c0ca6c7806e09b4bd626fd1679686df7d7f
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-15 11:33:23 +00:00
hjk
e5009787a3 Core: Remove OutputPaneManager::m_panes
It's a copy of the locally direct accessible g_outputPanes.

Change-Id: I22d34946d777ef63b1888382c2d2bd49a0da8f8c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-15 11:07:56 +00:00
hjk
cc88302309 De-emphasize PluginManager::getObjects<Type>()
... by additionally keeping local (currently non-owning) pools per
"interesting" type.

Current situation:
  - The global object pool does not scale well for looking up
    objects, as iteration plus qobject_cast typically iterates
    over all pooled objects.
  - User code that can use typed results from the object
    pool need to have access to the full type definition anyway,
    i.e.  depend on the plugin of the target class anyway.

The patch here solves the scaling problem is to have local
type-specific pools to which objects register in their
constructors and deregister in their destructors.

This patch here does *not* change the ownership model of the
pooled objects, however, it opens the possibility to change
the ownership model per type (e.g. by not putting things into
the global pool at all anymore and make the local pool 'owning')
and the intent is to handle that in later patchs.

Even without the follow-up patches this here is a performance
improvement for the cases that access the local pools instead
the global one, i.e. "practically all".

Change-Id: Ib11a42df2c4ecf5e1155534730083a520dd1995b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-15 07:08:05 +00:00
Nikolai Kosjar
32762e27e2 Clang: Use more distinct ipc logging prefix
The previous "<<<" and ">>>" are visually hard to catch in the output.

Change-Id: I7313645454d92ca3534b19070173129676d49e18
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-12-14 16:17:50 +00:00
Nikolai Kosjar
593d395593 Clang: Remove duplicated logging category
Q_LOGGING_CATEGORY(log, "qtc.clangcodemodel.ipc") is already in
clangbackendlogging.cpp.

Change-Id: If1afa6f266505e696ea00c6ca6bdf0751640784d
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-12-14 16:17:43 +00:00
Nikolai Kosjar
d89bd9ff5c Clang: Add file name to qtc.clangbackend.jobs output
This helps to overview debug output in case several files are involved.

Change-Id: I12ee23bd7cec4cd344746ef1323afb3f0ab54d4b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-12-14 16:17:37 +00:00
Nikolai Kosjar
e0bbb0a0bb Clang: Ensure to cancel every expired or not added job
Previosly the JobQueue cancelled job requests for some reasons, but not
for others. Conceptually, JobQueue should not make any difference
between those.

Introduce equal treatment and always cancel if a job request could not
be added or is expired as this avoids leaving the Qt Creator side
waiting for a response.

Change-Id: I26b392b7f80b89ba2ae9a46a8d1b51403ec6eb4a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-12-14 16:17:30 +00:00
Alessandro Portale
f8d15c3940 QmlProjectManager: Re-use folder "qml" icon overly from ProjectExplorer
The one in ProjectExplorer does the same except that it also has a @2x
variant, thus looks less ugly on HighDPI.

Change-Id: Ic6faa8fd48b73cfe0b94eba776433fa12b8e0b09
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-12-14 14:44:17 +00:00
Ivan Donchevskii
7a7123b1bc Clang: add globalFollowSymbol to RefactoringEngine
Allows to follow outside of current TU.

Change-Id: Ieea2fd72bfdf6d60a988b40efcf2f41c5a71d045
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-12-14 14:25:14 +00:00
Ivan Donchevskii
c760804102 Clang: always use -isystem for compiler options builder
We always provide the full includes list ourselves so
it will not change the includes order.

Change-Id: I84ee2ca7f05bfb71ae400f0e9e0b8f52810252b3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-12-14 14:24:35 +00:00
Alessandro Portale
67c3b232f8 ProjectExplorer: No native dir separators in detectCppBuildTools2015
Having native dir separators in the autodetected C++ build tools 2015
caused Qt Creator to add all msvc compilers a second time as manual
MSVC versions. Reason was one different dir separator during string
comparison in AbstractMsvcToolChain::operator ==

detectCppBuildTools2017 did the conversion right

Change-Id: Iff04428bcc47636b161b944c94cadf12b0c549da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 14:11:19 +00:00
hjk
c21657184b Debugger: Move master engine checks around
From several places in DebuggerEngine::* to one place in
DebuggerEnginePrivate.

Change-Id: Ic87110a11087e338cc9a6b66ea30ea2259861d9e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-14 13:38:16 +00:00
hjk
b6697e7932 Debugger: Remove an unused function declaration
Change-Id: Ic936953eeeeeab82a73c11fbe80361326acff055
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-14 13:38:00 +00:00
Christian Stenger
c98131d8e7 AutoTest: Fix setting test executable for output reader
The test executable of the process must be set before creating
an instance of the output reader as the process' command file
path is only read on construction.
This lead to wrong ordering inside the result model at least for
the first test case.

Change-Id: I4140ee02c8e2ea4105d276017a460676514abc91
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 12:26:58 +00:00
hjk
83c13ff191 Debugger: Combine the InferiorShutdown{Ok,Failed} states
... into a InferiorShutdownFinished.

Change-Id: Icb5394f38f52f7cf300dc83f4eb8f2f0777bbcba
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 11:26:52 +00:00
Ulf Hermann
ee9ecf8661 ScxmlEditor: Avoid soft asserts when changing nullptr tags
At least TagCurrentChanged can be triggered with a nullptr tag. That
means the current tag is reset to "none". We should thus handle nullptr
in all receivers of beginTagChange and endTagChange.

Change-Id: Ife558beca9fb1ed5ab246b76bbaab19c1c227e8a
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
2017-12-14 10:52:30 +00:00
hjk
585b2c62d5 Debugger: Combine the EngineShutdown{Ok,Failed} states
... into a EngineShutdownFinished. They were never handled differently,
and the only option is to proceed to DebuggerFinished anyway. So
simplify the state machine a bit.

Change-Id: Ied3be86fff6750abca578dc6788e4be1d895692b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 09:42:44 +00:00
Hannes Domani
01fb309c34 Debugger: Fix address of access violation
Change-Id: Iaaa0897d63ddf234eef629187ec3cd16ea9f1aaf
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-12-14 09:41:56 +00:00
Hannes Domani
306d3f2ac7 Valgrind: Fix crash when missing stacks
Change-Id: I69896f0d0c428f158bdb071b08a1c4b9f031183f
Reviewed-by: hjk <hjk@qt.io>
2017-12-14 07:24:42 +00:00
Marco Bubke
bb62fd3e56 Clang: Move printing functions in clang support to unit tests
The printing functions are only used by the unit tests and they use an
external API. So we can easily move them to the printing functions in
the unit test project. We have to move the TokenInfo print functions too
because the depend on other print functions. The rest of the print
functions will be moved in other patches.

Change-Id: I87c452f8ca40687ec47de675ba6bee13efa5655b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-12-13 17:24:59 +00:00
Christian Kandeler
3ef82e8fe2 Android: Fix qbs build
Change-Id: Iff9147e69a3c9d025496c2e2ad7837dae32e02d9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-12-13 17:23:08 +00:00
Christian Kandeler
881ad3401c RemoteLinux: Kill remote app before deployment
It's unlikely you want to have two instances running at the same time,
and SFTP does not let you overwrite a running executable anyway.

Task-number: QTCREATORBUG-19326
Change-Id: Iac48d28f538307fc1764f973ce0c9959ef89af03
Reviewed-by: hjk <hjk@qt.io>
2017-12-13 15:02:27 +00:00
David Schulz
800aa7466f Debugger: improve symbol lookup times for cdb
Task-number: QTCREATORBUG-18613
Change-Id: If8dac096fa4d0d8afc6fb8f7bbffd090a5dc6e19
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-13 13:59:01 +00:00
Robert Loehning
300041cc6e ios: Initialize members
Change-Id: I01cbbbfa9e8906768cc71d1c5b0d366d99924c7f
Reviewed-by: hjk <hjk@qt.io>
2017-12-13 13:35:24 +00:00
Nikita Baryshnikov
e393422618 Qml&Js: better formatting of enums inspection
Change-Id: I3d3948fcebb6b902a18fcf492122229c69c5ac3e
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-12-13 12:09:06 +00:00
Thomas Hartmann
a60b3fdd87 QmlDesigner: Do not slide frames
The compression in the rewriter currently cannot handle slides
in transactions.

Change-Id: I2daa77d35b2de5676149d55c2c5efdf55528d868
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-12-13 07:50:11 +00:00
Thomas Hartmann
c9d2453a4d QmlDesigner: Increase the bounding rectangle
Since we clip against the bounding rectangle we increase
the size a bit. This ensures we do not get painting artefacts if
something is 1 or 2 pixels off.

Change-Id: I4d9c40dd25aaa4469b568df914a1290f21790271
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-12-13 07:39:30 +00:00
Christian Stenger
f8e764e007 ProjectExplorer: Fix warning
‘ProjectExplorer::IRunConfigurationFactory’ is already a friend of
‘ProjectExplorer::RunConfiguration’

Change-Id: Ia0c9830b20406f3f94393e1525040dbabb9ba19e
Reviewed-by: hjk <hjk@qt.io>
2017-12-13 07:23:28 +00:00
Oliver Wolff
224576506d Fix compile
Change-Id: I65a387f9d3358ef450c02b7bf90ae498039ce542
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-13 06:47:32 +00:00
hjk
1f3ba4ce15 QmakeAndroidSupport: Move AndroidPackageInstallationStep to Android plugin
There's nothing Qmake related in there (anymore?).

Change-Id: I8842d4824065cf3cba61d50b6f333ec3b52e3851
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-12-12 16:05:20 +00:00
Eike Ziller
6b48beeeb0 Support specifying complete result type in Utils::transform
Can come in handy when the function or member does not directly return
the right value type for the result list, but is implicitly convertable
to it. For example from pointer to class to pointer to superclass, or
from int to double.

const auto result
    = Utils::transform<QVector<double>>(v, &ValueType::intMember)

Change-Id: I0e1914d70bb2580b91098dd37e85a31ca14b0ae6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-12-12 14:44:15 +00:00
Robert Loehning
b054e1b1f5 BuildConfiguration: Check return value of fromMap
Change-Id: I18edefc20ff962720f36192121e3f6e341b1bcbc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-12 14:30:00 +00:00
Tobias Hunger
7c35a38100 Session: Move all functionality related to Nodes into ProjectTree
Do no longer expose Nodes from the SessionManager's API. These are now
exclusively handled by the ProjectTree.

Change-Id: I585c2ac919462073870363436e767640775d9045
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-12 13:44:09 +00:00
Robert Loehning
34b8ed1484 RemoteLinux: Initialize members
Change-Id: I0c5cd52747373be0d50ac818dbbeaf39c34fd5fd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-12 13:35:03 +00:00
Eike Ziller
7b6943e578 Add "Remove File" to file system view
Task-number: QTCREATORBUG-19208
Change-Id: Iacf1e1468018fa8dd3426bc1325f36bb39a4b4e2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-12 10:50:29 +00:00
Eike Ziller
7cba5fc482 Move RemoveFileDialog to Utils
Change-Id: I88892fc8d43ca3f59598b5b44e0daac0bfb439b5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-12 10:50:21 +00:00
Eike Ziller
b2a6899e56 ProjectExplorer: Use local convenience function
Change-Id: Ia13dcbc596c7cb5816891ed85e42ac49651fdfb6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-12 10:49:55 +00:00
Tobias Hunger
115615fc7c Qmake: Do not crash when accessing PriFiles from project tree
The project tree is static nowadays, and the QmakePriFileNodes hold
pointers to their corresponding PriFiles. This is fast, but not
entirely safe: The PriFiles are constantly updating as the project
is parsed.

So make sure not to rely on the stored pointer while the project
is parsing and go through Project::rootProFile() in that case.

Once the parsing is done, the project tree has been updated with
new data, that reflects the current QmakePriFile tree.

Task-number: QTCREATORBUG-19428
Change-Id: Ifaa3432cad7774142d562648d93104629736d478
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-12 10:32:35 +00:00
David Schulz
2d3829ffcc BookMarks: restructure bookmark map
compare file names case insensitive on windows

Task-number: QTCREATORBUG-19418
Change-Id: I4925a7b33f35ce18e906990ffc104b22ea6d73dc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-12 10:08:04 +00:00
Eike Ziller
469edcdde3 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: Ic1ab71d0d40fa6c90e337c8ee9d9558e8f103eaa
2017-12-12 10:53:51 +01:00
Eike Ziller
09ff10871d Make sdktool default data path overridable at build time
By setting a relative path in SDKTOOL_DATA_PATH

Change-Id: Ib61921f396f4eaf72fa240c3edb3795fda800609
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-12 09:30:04 +00:00
Eike Ziller
5e4b6d54b2 sdktool: Use shell_quote for data path define
Change-Id: Idc0e2945133123941afa0ab92e5ff57dedf8f4ba
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-12 09:29:55 +00:00
David Schulz
1772808592 Debugger: use inferior device when run tool device is null
Task-number: QTCREATORBUG-19442
Change-Id: I6c2419b30bf86af79bb2436dc6dc8196f6c65f06
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-12-12 09:23:06 +00:00