Commit Graph

62 Commits

Author SHA1 Message Date
Andre Hartmann
2bb24633ac FileInProjectFinder: Fix findFile() for nonexisting files
The comment above this function says:

 If all fails, it returns the original path
 from the file URL.

That broke with 7b0b4c92cd, which caused the auto
tests in QtSupportPlugin::testQtOutputFormatter
to fail.

Fixes: QTCREATORBUG-21792
Change-Id: I9ed66c86e7a165fe198ee3fcf1bf8b72d850a2d5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-01-04 11:30:30 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
Ulf Hermann
c0378ee7e8 FileInProjectFinder: Report length of matched postfix
We want to know how exact the match is, so that we can reject results
that don't fit our needs. We cannot pass an extra fuzzy/exact parameter
to findFileOrDirectory, because we cache the results, and we need to be
able to reuse results obtained from different searches.

Task-number: QTCREATORBUG-21107
Change-Id: I870100f4c0acd0e9b007f076543340b34a25a447
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-09-24 13:23:42 +00:00
Robert Loehning
747d1ef9f1 Remove unused variables
Change-Id: I8b49a2eea7509abb685d751a0f038dc3b4f555ca
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-07 14:02:23 +00:00
Ulf Hermann
f13a7fc988 FileInProjectFinder: Add dtor
Some compilers need to know that the destructor is not inline here. It
cannot be inline because PathMappingNode's dtor is not exported.

Change-Id: I37cbf31cf83a8aa571a0a6708e3ad520b035bc53
Reviewed-by: Alexander Shevchenko <sav_ix@ukr.net>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-03 12:27:24 +00:00
Ulf Hermann
4ecc46626b FileInProjectFinder/Debugger: Use Utils::FileName for sysroot
Change-Id: Id937f927ba6137fd04f742f31d1b260afbe42db4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-28 07:27:30 +00:00
Ulf Hermann
33a0ab8943 FileInProjectFinder/Debugger: Use FileNameList for search directories
Change-Id: I8f9fa4631fda26e10e6b21abfcba9e5f74d635c2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-27 08:59:11 +00:00
Ulf Hermann
e9de99f84b FileInProjectFinder: Use FileName for local part of direct mappings
Change-Id: I1855e9af95874967a0d3fc9d7a410cac12355ad2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-27 08:59:05 +00:00
Ulf Hermann
9bbef89cdc FileInProjectFinder/Debugger: Use Utils::FileName for project directory
Change-Id: I5a3f376bea4ee06c6856e614f6f71974c2f5ca87
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-27 08:58:14 +00:00
Ulf Hermann
c56ddc7966 FileInProjectFinder: Use categorized logging
Change-Id: I1fed1821ec0c7a184f093900d0da15be677c8fed
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-27 08:58:08 +00:00
Ulf Hermann
7b0b4c92cd FileInProjectFinder: Search DeploymentData for paths
The deployment data is the most reliable information we can get
regarding where a file from the host ended up on the target. Therefore
it is searched first. Since the "directories" found this way may not
actually exist on the host, we return the list of entries rather than
the actual path for those. Files from different host directories can be
deployed to the same target directory, after all. Using the list of
entries, a client can reconstruct children of the directory by appending
an entry to the base path and searching again.

Change-Id: Ia0f72872a4ff6313f1ae8b0f441b67f55be5a456
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-08-27 08:58:01 +00:00
Ulf Hermann
c98a390733 FileInProjectFinder: Use the cache also without project directory
As we add things to the cache, also without a project directory, there
is no reason why we wouldn't use the cache when looking them up.

Change-Id: I9f90cf7b88410513d2ebd0524e7d369fcb4db704
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-08-21 08:57:09 +00:00
Alessandro Portale
e38410b76c Utils: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: I8d44d9405011a1878353baf9325f7af90b89db02
Reviewed-by: hjk <hjk@qt.io>
2018-07-20 13:36:22 +00:00
Orgad Shaneh
7cee991c70 Utils: Remove superfluous qualifications
Change-Id: I36e17dac0cff87f82f0ddaf97bc613389110f218
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-19 08:21:29 +00:00
Tim Jenssen
1412dde3a5 FileInProjectFinder: performance improvement
cdUp does check for an existing file which is slow
especially at Windows.
Benchmarking this with a project with around 100
files improved time usage inside that method from
6 seconds to 300 ms.
There is still room for improvement because of parentDir
calls cleanPath which is also not that fast.

Change-Id: I57adae1f1f0a82ac702b461758e9d1b89760087b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-24 10:10:24 +00:00
Tim Jenssen
b5a4e88485 FileInProjectFinder: Use FileNameList for file names
This simplifies code and reduces the number of conversions between
QString and Utils::FileName.

Change-Id: I47bd86b9ae09b1da37b4e5e604761367ac1ab26b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-24 10:09:26 +00:00
Ulf Hermann
e984e5eacb FileInProjectFinder: Fix caching and project dir search
- Check the cache first, also for absolute paths in the project
  directory. Those paths are not guaranteed to exist and we may have
  found the file somewhere else before.
- Cache everything we find and remove entries from the cache if they
  have become invalid.
- When finding files in the project directory by absolute path, check if
  they exist before indicating success.
- Unify the checking and success handling.
- Pass QString by reference where applicable.
- Avoid double lookups in the cache.

Change-Id: I28e5a2979e0c78e84f42115a64acbd4eb06ffb0c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-02-01 09:02:07 +00:00
Ulf Hermann
85b8ae4b8c Utils: Extend FileInProjectFinder to also find directories
Change-Id: I7b9f0252e25b2cde9cdadb0a939e2a367c4b47be
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-01-08 10:20:55 +00:00
Eike Ziller
e26ac60f17 FileInProjectFinder: Avoid multiple construction of QFileInfo
Change-Id: Ic2db308ed6938d0ad67c84152eed209ac0e76bd9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-10-19 15:58:10 +00:00
Orgad Shaneh
ed68bda40d Utils: Replace macro usages with HostOsInfo
Change-Id: Iddec811b4b57a2a898ebdf319a3e2ec875febd6c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-21 11:35:14 +00:00
Tobias Hunger
f72370f20a Update License according to agreement with Free Qt Foundation
* Update remaining files in src

Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:59:41 +00:00
Joerg Bornemann
2ae8ae5d87 Utils: add additional search paths to FileInProjectFinder
This can be used e.g. by profilers that need to match some
on-device path to a local path.

Change-Id: I38e572bfbd7848cfb2e8ba9e275b99bb09692fea
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-03-19 11:34:13 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Joerg Bornemann
4e09ec98c7 Utils: make FileInProjectFinder work with same file names
Consider having files with the same name in different subdirectories of
your project. The FileInProjectFinder will now choose the best matching
file path, which is the one that has the longest right-aligned common
substring with the path to find.

For the candidates
    ["/home/jim/MyProject/Resources/qml/1/foo.qml",
     "/home/jim/MyProject/Resources/qml/2/foo.qml"]
and the file path to find being "/SomeWhere/Else/qml/2/foo.qml" the
ranks are 8 and 10. Therefore, the second path is chosen.

Task-number: QTCREATORBUG-12908
Change-Id: I6225fd1dce8cc79a90d02ae0a54cdf80f75f45af
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-02-05 16:29:08 +00:00
Orgad Shaneh
8b5dcc13c5 Replace QFileInfo::fileName() with FileName::fileName()
Change-Id: I4852ff215abf25649fc5eac1e922ae901839ca3d
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-29 11:15:43 +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
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +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
Nikolai Kosjar
b8dbac0b9c Rename "[Mm]ethod(s)" to "[Ff]unction(s)"
Only methods as programming functions are affected. Besides renaming
some actions like "Switch Between Function Declaration/Definition" this
mostly touches (api) code comments.

This is a follow-up patch to commit 872bfb7.

Change-Id: Icb65e8d73b59a022f8885b14df497169543a3b92
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-10-10 15:56:12 +02:00
Leena Miettinen
efbecf21db Doc: edit utils docs
Use \a for all attributes in function descriptions
to avoid QDoc errors. Do not use \param, because
it is not a valid QDoc command.

Do not use \returns as it does not exist.

Do not use \brief for functions. It is not obligatory, so
rather than add them for all functions, let's consistenly leave them out.

Fix typos, grammar and style issues, and punctuation.

Change-Id: Ib8f296f93976265bb93dbeab40c5b47156518122
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-09 12:55:00 +02:00
Leena Miettinen
41411165ba Doc: use standard wording in \brief commands
QDoc does some magic with the \class and \namespaces
and \brief commands, so the following wording must be used:
"The xxx class yyy ..."

Change-Id: Id231f30e8464898b776888d5423523de404aae34
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-06-20 11:22:47 +02:00
Leena Miettinen
419c6de735 Doc: replace deprecated QDoc commands
The \i and \o commands were replaced with \li and
\bold was replaced with \b in QDoc for Qt 5.

The \input command was replaced with \include in the docs.

Change-Id: I257d1bebb8ebc739ca20e0d29fcf0406ecb14534
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-06 09:44:18 +01:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Alessandro Portale
ae23d50576 Removal of Symbian support
Qt Creator's support for Symbian was at its peak in version
2.4.x. Nobody really verified it in Qt Creator 2.5 or 2.6.
It is most likely rotten. Let's remove it!

Also, the Symbian support code was spread throughout the whole
Qt Creator code base. The plugin interfaces evolved in the
meantime and target platforms like Android or QNX have 99% of
their code in separate plugins.

In case anyone wants to revive Symbian support in Qt Creator,
please create a plugin for it.

Change-Id: I56a758a3e2fd5b8c64d9aeb8f63d8e916c4883be
Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
2012-08-22 13:42:42 +02:00
Eike Ziller
e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
hjk
5b0bf61640 qtcassert: move actual printing to separate function and enforce style
This also allows simple setting of breakpoints on failed asserts.

Change-Id: I6dd84cbfaf659d57e39f3447386cebc0221b2b84
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-04-17 09:53:44 +02:00
Kai Koehne
b9661b0321 FileInProjectFinder: Add (optional) debugging output
Change-Id: Icfb36086543bd9e66778a4569bd4838bb4b31a5e
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-04-16 11:33:55 +02:00
Erik Verbruggen
3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
Eike Ziller
85cf2b661e Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/libs/qmljs/qmljsinterpreter.cpp
	src/libs/qmljs/qmljsinterpreter.h
	src/plugins/debugger/qml/scriptconsole.cpp
	src/plugins/git/gitplugin.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas_p.h

Change-Id: Iad59c8d87c72a21c79c047e374c0ab689998af39
2011-11-11 09:46:25 +01:00
hjk
31600758de all: s/info@qt.nokia.com/qt-info@nokia.com/
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-11-03 10:33:19 +01:00
Kai Koehne
accf6d0e8b Debugger: Prefer files in current project over files in sysroot
Only use file in sysroot as ultimate fallback.

Change-Id: I3dd3b87228c87387f994792f74634add03845ad7
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2011-10-28 17:02:46 +02:00
Kai Koehne
47bda54f07 FileInProjectFinder: Avoid double slash in sysroot'ed path
The file path from the device is already absolute, no need to add
another slash.

Change-Id: I591eb5ffee38bcea28564dcdc20541ee40f306a8
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
2011-10-17 15:05:29 +02:00
Eike Ziller
8eb8368139 Merge remote-tracking branch 'origin/2.4'
Conflicts:
	qtcreator.pri
	src/libs/qmljs/qmljstypedescriptionreader.cpp
	tests/auto/qml/qmleditor/qmlcodeformatter/tst_qmlcodeformatter.cpp

Change-Id: Id032187023bb42f259a87545ceeb3c965dd01a32
2011-10-17 14:22:32 +02:00
Kai Koehne
55ebeddb1c FileInProjectFinder: Fix gcc warning
Change-Id: If58d9e84b34fbc2cbe755fb0d1492e305d4eadd1
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
2011-10-12 14:59:20 +02:00
Kai Koehne
a5211130f3 FileInProjectFinder: Normalize project directory before checking for changes
Change-Id: Ia6ee0b0f8110add4a54bd470831d457dbb17c9c9
Reviewed-on: http://codereview.qt-project.org/6439
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2011-10-12 11:12:22 +02:00
Kai Koehne
7dc88639dc QmlProfiler: Allow user to specify a sysroot for "Attach to Port"
Change-Id: I943255e5a501610195e3758f9fbb42d127f15524
Reviewed-on: http://codereview.qt-project.org/6451
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2011-10-12 11:12:15 +02:00
Tobias Hunger
aa3114750f Fix *bool assignment
Change-Id: I1497515ea3a7fc4d25aaf80fe1a95f5889f740eb
Reviewed-on: http://codereview.qt.nokia.com/2345
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2011-07-28 15:52:11 +02:00
Kai Koehne
372b10db87 FileInProjectFinder: Fix compilation with 4.7.4
Don't depend on QUrl::isLocalFile, which only exists in 4.8.

Change-Id: I67a8e35c8754396424c5578216bc6deb02ae0d50
Reviewed-on: http://codereview.qt.nokia.com/1959
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
2011-07-21 15:52:44 +02:00