summaryrefslogtreecommitdiff
path: root/src/libs/utils/filesystemwatcher.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-05-111-13/+46
|\ | | | | | | Change-Id: I98e5e1ad43103984b490c65cdeed84b7414303b3
| * Utils: Avoid watching directories of watched filesDavid Schulz2023-05-081-13/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not watch directories unconditionally, but only if they contain removed files to check whether those files are readded. This should reduce the number of needlesly watched directories to a minimum and fix performance regressions introduced by 61598eca15e14af64c20d314db382973dfccb2d2. Fixes: QTCREATORBUG-28957 Change-Id: I8fe387e7de32b0fb585074330c7f6ca7eae44730 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/10.0' into qds/devTim Jenßen2023-03-261-6/+63
|\ \ | |/ | | | | | | | | | | | | bigger conflicts resolved at: src/plugins/qmldesigner/CMakeLists.txt src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
| * Move some FileSystemWatcher usages to FilePathhjk2023-01-271-9/+4
| | | | | | | | | | | | Change-Id: I72d24ae3f819e429009b0d7e42b21957f07cb00a Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * Utils: Start migration of FileSystemWatcher to FilePathhjk2023-01-231-1/+63
| | | | | | | | | | | | | | | | This duplication of the interface is a first step, the QString based part will be gone in the end. Change-Id: I5e6378a92f96324188b917599b50def536f57bbe Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
| * Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
| * Utils: Fix clazy "Mixing iterators with const_iterators" warningsJarek Kobus2022-11-301-7/+6
| | | | | | | | | | | | | | Change-Id: Iab29d57459713e107d7e74908df347955b9f50a0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | utils: reduce default logging level of filesystemwatcherTim Jenssen2023-01-191-1/+1
| | | | | | | | | | Change-Id: I10d55e3f07eb461351b8c13cac01a9b0d5bd8b84 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | Utils: improve filewatcherTim Jenssen2023-01-191-3/+4
| | | | | | | | | | | | | | | | | | | | | | Avoid internal calls of QFileSystemEngine::fillMetaData which are expensive and especially on Windows trow GetFileAttributesEx can hang for seconds. (network drive or one drive which locks files) Task-number: QDS-8820 Change-Id: I3269ade03d1c1ed65417eebf956080414c5d087b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Utils: add Q_LOGGING_CATEGORY(fileSystemWatcher)Tim Jenssen2023-01-191-27/+27
| | | | | | | | | | Change-Id: I554c50a47197a6a9a84427b62a528d87b9db5f19 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | Utils: Fix clazy "Mixing iterators with const_iterators" warningsJarek Kobus2023-01-191-7/+6
|/ | | | | | | Cherry-picked from 7bc86a8b8d1be656d674dea7e2d1cf502c92163e Change-Id: I719272e0c094df424c08524e8e32a567d557bb3d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-3/+3
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Add FileSystemWatcher::clear()Eike Ziller2021-09-151-4/+9
| | | | | | | Change-Id: I9f28e763c943a6d8c5cf3082755e64d7e4df7155 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Libs: Use qAsConst with non-const Qt containers in range-loopsAlessandro Portale2021-02-171-1/+1
| | | | | Change-Id: I00d9f7c1634bbb62191470d58158e1fd150533c0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Utils: Replace foreach with range-based forOrgad Shaneh2020-06-161-4/+4
| | | | | Change-Id: I9aeea9c029ffc56cbadc04edd20e9b35b154f986 Reviewed-by: hjk <hjk@qt.io>
* FileSystemWatcher: Prevent slot execution on deleted objectChristian Kandeler2019-01-101-0/+1
| | | | | | | Amends 1f974bdbbf. Change-Id: I0cdb7a096f8af62c066b6c251ac7755a4cb359a1 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Utils: Postpone FileSystemWatcher signals when application is inactiveOrgad Shaneh2019-01-081-7/+54
| | | | | | Change-Id: I57db03952be4f3d9fc609c7bc0e12846f2ac30bb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* FileSystemWatcher: Prevent double-delete of static dataChristian Kandeler2018-12-141-1/+1
| | | | | | | | | | | If any static data directly or indirectly holds a FileSystemWatcher, destruction of that data competes with the destruction of FileSystemWatcher's static data. Prevent this by guarding the access to said static data in FileSystemWatcher's destructor. Change-Id: I4def4cab36583249b0c512387e57400f532b6709 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: ModernizeAlessandro Portale2018-07-201-11/+11
| | | | | | | | | | | | 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>
* Utils: Watch file replacements with FileSystemWatcherUlf Hermann2018-03-201-0/+31
| | | | | | | | | | | | | | | | | | | | It's quite common for other programs to remove and re-add a file in order to change it. QFileSystemWatcher does not track this, but silently drops the file to be watched. Add a directory watcher for each directory with files to be watched and if that triggers, examine if one of the files we are watching in that directory has been re-added. If so, generate a fileChanged() signal. This still doesn't track replacements of directories. If we want to track those, we could apply the same technique to directory watchers, but we'd have to recursively watch directories down to the file system root. Change-Id: I8a70b76bb34502dcfac390ba90e715918d7a5b4a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Brook Cronin <brook.cronin@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update remaining files in src Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Utils: Modernize connectionsOrgad Shaneh2015-03-061-4/+4
| | | | | Change-Id: I4650abc84e7c82a4054197319f6c849af9e5b8ce Reviewed-by: hjk <hjk@theqtcompany.com>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* License updateEike Ziller2014-10-091-7/+8
| | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Incremented year in copyright infoRobert Loehning2014-01-081-1/+1
| | | | | | Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Doc: edit utils docsLeena Miettinen2013-09-091-2/+2
| | | | | | | | | | | | | | | | 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>
* Doc: use standard wording in \brief commandsLeena Miettinen2013-06-201-1/+2
| | | | | | | | | 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>
* Clean headers in Utils.Friedemann Kleint2013-03-191-1/+0
| | | | | | | | | | Forward-declare QGraphicsOpacityEffect in DetailsButton, QProcessEnvironment in Environment, QFileInfo in fileutils, QUrl in IWelcomePage, FancyLineEdit in PathChooser and remove unneeded headers. Change-Id: I7d5f273530dd2059bbdaf0899f0a3bc7e49e8482 Reviewed-by: hjk <hjk121@nokiamail.com>
* Merge remote-tracking branch 'origin/2.6'Oswald Buddenhagen2013-01-311-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/debugger/qtmessageloghandler.cpp src/plugins/debugger/qtmessagelogwindow.cpp src/plugins/madde/maemodeployconfigurationwidget.cpp src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp src/plugins/qmldesigner/designercore/include/widgetqueryview.h src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp src/plugins/qnx/bardescriptormagicmatcher.h src/plugins/qt4projectmanager/profilekeywords.cpp src/plugins/remotelinux/deployablefilesperprofile.cpp src/plugins/remotelinux/deployablefilesperprofile.h src/plugins/remotelinux/deploymentinfo.cpp src/plugins/remotelinux/deploymentsettingsassistant.cpp src/plugins/remotelinux/profilesupdatedialog.cpp tests/auto/icheckbuild/ichecklib.cpp tests/auto/icheckbuild/parsemanager.cpp tests/auto/icheckbuild/parsemanager.h Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
| * Incremented year in copyright infov2.6.2Robert Loehning2013-01-291-1/+1
| | | | | | | | | | Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | Remove braces for single lines of conditionsOrgad Shaneh2013-01-081-4/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | #!/usr/bin/env ruby Dir.glob('**/*.cpp') { |file| # skip ast (excluding paste, astpath, and canv'ast'imer) next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i s = File.read(file) next if s.include?('qlalr') orig = s.dup s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m| res = $& if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces res else res.gsub!('} else', 'else') res.gsub!(/\n +} *\n/m, "\n") res.gsub(/ *{$/, '') end } s.gsub!(/ *$/, '') File.open(file, 'wb').write(s) if s != orig } Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc Reviewed-by: hjk <qthjk@ovi.com>
* Adjust license headershjk2012-10-051-21/+20
| | | | | Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Contact -> qt-project.orgEike Ziller2012-07-191-3/+1
| | | | | Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Removed module names from #include directives.Erik Verbruggen2012-02-151-5/+5
| | | | | | | | Getting the #include directives ready for Qt5. This includes the new-project wizards. Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* Long live the king!hjk2012-01-261-1/+1
| | | | | Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
* all: s/info@qt.nokia.com/qt-info@nokia.com/hjk2011-11-031-2/+2
| | | | | Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* all: less QScopedPointerhjk2011-09-191-0/+1
| | | | | | Change-Id: I536bdb4d4f0c10fa858560f3c160fc0fff8da9b2 Reviewed-on: http://codereview.qt-project.org/5116 Reviewed-by: hjk <qthjk@ovi.com>
* Fix/add copyright headersTobias Hunger2011-05-061-1/+1
| | | | Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
* Utils: Introduce FileSystemWatcher.Friedemann Kleint2011-04-151-0/+404
Remove duplicated classes ProjectExplorer::FileWatcher and QmlProjectManager::FileSystemWatcher, create Utils::FileSystemWatcher from them, merging the functionality. Also use in HelpManager/Maemo, reducing the number of QFileSystemWatcher instances (and thus, shutdown time).