aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/archive.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Remove Utils::optionalEike Ziller2022-09-011-5/+5
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@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>
* Utils: Drop unused headers [A-H]Jarek Kobus2022-05-251-1/+1
| | | | | | | | | Round 2 - focus on sources. For classes with initial in range [A-H]. Try to keep the same separators between different kind of headers. Change-Id: I838a8324ddd5b4d8d5a51b8f30605f783c663813 Reviewed-by: hjk <hjk@qt.io>
* Archive: Connect to QtcProcess::done() signalJarek Kobus2022-04-061-6/+5
| | | | | | | Instead of connecting to errorOccurred() and finished() signals. Change-Id: I2bc4b8359652549949c486ad6bce002a5db30688 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Archive: Avoid calling blocking stopProcessJarek Kobus2022-03-251-88/+32
| | | | | | | | | | | | | | | | | | | | Make Archive constructor public. Make the caller responsible for deleting the Archive object. Don't automatially run the unarchive process when constructing Archive object. Provide a start() method, to be called after the caller has connected to Archive signals. Add Archive::isValid() method. Remove Archive::unarchive() gui overload, as it's unused. Make sure we don't leak the Archive object in AndroidSdkDownloader. Change-Id: Idf67262554cdfef50aef4a2234b6a5089110f9a2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QtcProcess: Limit the inclusion of qtcprocess.hJarek Kobus2022-03-021-1/+1
| | | | | | | | | | Move the rest of QtcProcess enums to processenums.h. Move ExitCodeInterpreter into processenums.h. Remove superfluous Utils:: prefix. Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Mimetypes: Make implementation switchable between new and oldEike Ziller2022-02-251-1/+1
| | | | | | | | | | | | | | | | | | - configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in utils/mimetypes2/ - added utils/mimeutils.h header for the Qt Creator specific static wrappers, that also includes the "public" headers for MimeType et al from the new or old implementation, depending on configuration - change all utils/mimetypes/ includes to utils/mimeutils.h - move the implementation for the wrappers to utils/mimetypes(2)/mimeutils.cpp - also move the MimeDatabase declaration in the "old" implementation back to utils/mimetypes/mimedatabase.h Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Add missing "emit"sAlessandro Portale2021-11-111-5/+6
| | | | | Change-Id: I88a7397c7689b1e72cdd0e52077f8097443963c0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix unzip tool not being resolvedVikas Pachdha2021-11-091-0/+1
| | | | | Change-Id: Idf77ef0e1c0b18c6dccbcf7b5666203dcfda65ab Reviewed-by: hjk <hjk@qt.io>
* Utils: Introduce a FilePath::searchInPath() convenience functionhjk2021-08-231-2/+2
| | | | | | | Diverts to searchInDirectory(). Use it in some places. Change-Id: I9e5642f0ae0ed4dd9fb9f34bcaa11a25bd26c690 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: FilePathify Archive::unarchive furtherhjk2021-08-191-3/+3
| | | | | Change-Id: I22ddc35e5d94cd000f6a3ed09325223c49417335 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: FilePathify Archivehjk2021-08-171-57/+43
| | | | | Change-Id: Ia6b972b50f8b1cc7c5829ac863a5881849ea7678 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Introduce a FilePath constructor from char arrayshjk2021-08-171-2/+2
| | | | | | | | | | | | Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for decorations in user code. At the same time, drop some convenience constructors and functions in CommandLine and Icon essentially serving the same purpose. Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Use refactored ProcessModeJarek Kobus2021-08-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch needs to be applied together with the parent change. There are 3 basic cases: 1. The user doesn't write anything to the write channel: You don't need to call closeWriteChannel manually anymore. By default the QtcProcess you create is in ProcessMode::Reader mode. Internally it opens the process in ReadOnly mode and closes the write channel just after starting. 2. The user writes some initial data (after being started) and then closes the write channel: All what is needed now it to set the write data (QtcProcess::setWriteData) before calling start. You also use the default ProcessMode::Reader mode. Internally it opens the process in ReadWrite mode and writes the writeData asynchonously when the process already started. After writing the data it closes the write channel automatically. 3. The user writes the data also after calling start. All you need now is to create a process with ProcessMode::Writer mode. In this mode the write channel is not closed. Internally it opens the process in ReadWrite mode as some writers also read the data from the process. All the code base is adapted here to the above rules. Change-Id: Id103019d1d71a3012fd1eade226fe96b9aaa48c2 Reviewed-by: hjk <hjk@qt.io>
* MimeDatabase: add FilePath convenience functionDavid Schulz2021-06-231-1/+1
| | | | | Change-Id: I59c825490b3b5c49f3c177584ea4cc885c4f920b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Drop QProcess specific parameters from QtcProcess::finished()hjk2021-06-141-1/+1
| | | | | | | | | | | Mid-term plan is to concentrate on use of QtcProcess::result() instead which is a bit more system-agnostic. There's quite a bit of potential for downstream cleanup by re-using QtcProcess::exitMessage() now. Change-Id: I3806b3f5933d96e64b7cfb18cc6c52823fddcbcd Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Remove some redundant uses of QtcProcess::exitCodehjk2021-06-031-2/+1
| | | | | Change-Id: I0dd60ec9c8774fe2ec667695ee57644d2d6cf1d6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Move QProcess base to QtcProcessPrivatehjk2021-06-021-12/+8
| | | | | Change-Id: I4c6811d42e051fadfcf32edb664ff3bc09e692e6 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Copy some SynchronousProcess function to QtcProcesshjk2021-04-301-6/+6
| | | | | | | | | | Start using it in Utils::Archive. The idea is to merge SynchronousProcess into QtcProcess (or avoid its use) to have fewer classes to make "remote-aware". Change-Id: Ieb08f6f66eab63fd058b75e3bafa79bfbf140387 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Add support for powershell Expand-Archive for archivesThomas Hartmann2021-02-231-0/+16
| | | | | | | This will work with any Windows 10 installation. Change-Id: Ia7ca25a5ba4e199ccfc37138e228c4d56f0f8a6a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Plugin install: Make 7z verboseEike Ziller2020-06-251-1/+1
| | | | | Change-Id: I1f2dbb607f8c38018f6ee8631539caef1213ee8f Reviewed-by: David Schulz <david.schulz@qt.io>
* Plugin install: Fix crash on cancelEike Ziller2020-06-231-0/+6
| | | | | | | | | | When the process is aborted, both errorOccurred and then finished is sent. Because of the combination of deleteLater and QueuedConnection this leads to m_process being already nullptr when finished is sent, so add some guards. Change-Id: I446114176f8fa5934b411b39d77c97d6267303fa Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Fix compile on unixDavid Schulz2020-06-161-19/+16
| | | | | | | | amends 72b35aa12b36c99fecaef2a5e0027cf899661a07 Change-Id: I934ef8420b998db367f004d2f58782abdc843af9 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: check windows registry for archive toolsDavid Schulz2020-06-161-21/+61
| | | | | Change-Id: I2acff0347a0bd04a808b5f4a0049263168e11f51 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Fix build: Utils/archive.cpp needs to include QTimerTobias Hunger2020-06-151-0/+1
| | | | | | Change-Id: I99f15e6bf2f0879b7cd0f6d859174c95299e4f93 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils/Archive: Add simple async APIEike Ziller2020-06-151-24/+76
| | | | | | | So we can integrate it deeper into the plugin wizard. Change-Id: I7f7a9eb8e07d3eeab6a4ecf92161f7d04f5fa5c2 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Fix compile with gcc 5.3Christian Stenger2020-06-021-10/+10
| | | | | | | Amends 26c26c0dada6b057. Change-Id: I019759179626df45a31492846e05b1dca55f4fea Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Support more file formats for unarchiving pluginsEike Ziller2020-05-291-20/+63
| | | | | | | | | Use tar, or cmake -E tar, for .tar, .tar.gz, tar.xz, tar.bz2. Use 7zip for 7zip. Zip is supported by unzip, 7zip, tar, and cmake. Change-Id: I799c3211325398add150644b57c32b7ad5bb8903 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Move unarchiving code out of the plugin dialog codeEike Ziller2020-05-291-0/+124
Change-Id: I2b6510ae527d57a06692336cfd7b0434cdcbda51 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>