If the "Accept-Encoding" is not manually specified, it will be
automatically set to the supported encodings by QT and the reply data
will also be automatically decompressed in this case. Setting
"Accept-Encoding" manually will disable the "autodecompress" feature
before QT 6.3.0. Although QT 6.3.x has different behaviors, let QT
specify the "Accept-Encoding" and we will always obtain the decompressed
data.
The macro "QT_NO_COMPRESS" defined when QT is compiled will disable
the zlib support. We can manually address this exceptions.
Original PR #17438.
In some unknown way, the one line in Objective-C affects Qt's main
loop causing the crash in QApplication::exec() on processing next
event after that call.
Even crash doesn't happen exactly after this call, it will happen
on application exit. Call stack and disassembly are the same in
all cases.
But running that code in another thread solves the issue.
Original PR: #17305.
This is observed by unusual high page faults when the stuttering occurs.
With this workaround, the high page faults still occurs but the GUI remains responsive.
Original PR: #17311.
You can already control the cache size in libtorrent 1.2.x so it doesn't make sense to implement this limit for all use cases. Also there are some downsides to using working set size to limit memory usage such as unresponsive GUI when limit gets hit.
Make notifications clickable on Linux by assigning "default" action.
Don't react to unrelated notifications clicked by keeping track of qBittorrent notifications IDs and filter out unrelated ones.
Make D-Bus Notifications interface proxy class to be maintained manually and fix coding style in it.
Closes#9084.
PR #17282.
This checks that `category_list[categoryHash].torrents` is truthy before dereferencing it. In some cases the API response will have a torrent in a category that doesn't exist resulting in the check to return `undefined` which is not `null`. This broadens the check so that it will create the category even if null.
PR #16432.
It did not work correctly, since it assumed that 'lt::torrent_plugin' is created at an earlier stage and is able to track all changes in the torrent state, but in reality it turned out that it was created after the torrent moved to the `downloading_metadata` state, so we had to additionally handle it in the constructor.
PR #16121.
Suppresses the following warning:
qBittorrent/src/base/bittorrent/categoryoptions.cpp: In static member function ‘static BitTorrent::CategoryOptions BitTorrent::CategoryOptions::fromJSON(const QJsonObject&)’:
qBittorrent/src/base/bittorrent/categoryoptions.cpp:44:59: warning: missing initializer for member ‘BitTorrent::CategoryOptions::DownloadPathOption::path’ [-Wmissing-field-initializers]
44 | options.downloadPath = {downloadPathValue.toBool()};
Change "Incomplete/temp folder" term with "download folder".
Allow to set "download folder" per torrent (in manual mode) and per category (in automatic mode).
For writing, this ensures expire handler won't be executed in a small
time window, that is after `m_socket->write()` and before
`QIODevice::bytesWritten()` signal.
For reading, this let the socket to have the chance to process the
received data instead of dropping it.
PR #15849.
This also suppresses the following clang warning:
warning: definition of implicit copy assignment operator for 'Version<unsigned short, 2>' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
Current item priority is compared against new checkbox state. I believe the intention was to check if the priority changes before performing further actions. This PR fixes the issue - compare priority against new value that is about to be set rather then the checkbox state.
PR #15740.
Some linux distros seem to alter TMPDIR environment variable and
therefore hamper qbt ability to find the lock files. So use config
folder instead of TMPDIR folder to create/locate the lock files.
Note that this change will also make qbt become one instance per-user
instead of one instance per-system.
Closes#15646.
Fix improper sorting of the list of files contained by a torrent.
Always load all torrent content data so that the files list can be sorted properly.
Load torrent content only when needed. Don't load the list of files contained by a torrent if the list widget is not visible.
PR #15604.
This functionality wasn't ever correctly implemented and couldn't be
done without considerable effort, so revert it for now.
This reverts commit 4ac25a50ed.
PR #15542.
Previous default was 500MB and it couldn't fit all compile results in
it, enlarge it to 2GB. Note that 2GB isn't the actual size stored on the
server, it will be compressed again by zstd and will be a lot smaller.
Now it builds boost, libtorrent manually and we have control over its
version.
Enable build matrix for libtorrent versions.
Reorganized the folder/file layout in built artifact.
Minimizing columns no longer truncates text from the left, now elides
text from the right for better readability. Done by setting header's
textElideMode to Qt::TextElideRight.
Fix issue #14419.
PR #15366.
Until libtorrent provided an "old_name" field in `file_renamed_alert` we relied
on a workaround with storing old file names to remove empty leftover folders.
PR #15356.
This will save maintenance work on the vcpkg version.
Also a few other improvements:
* Add quotes to path
* Sort command flags
* Avoid switching shell, always use powershell (the default shell)
It is meaningless to build on multiple linux versions as we only depend
on library versions, not OS versions.
Also remove redundant "shell default" section.
Unfortunately Freenode, after a takeover, decided to purge all their databases, thus
deleting all channel and user registrations, without a warning.
So if we're forced to re-register our stuff why not go where the cool kids are at?
Removed these two lines because they haven't been true in a very long time, and is no longer even possible.
```
You can also meet me (sledgehammer_999) on IRC:
`#qbittorrent on irc.freenode.net`
```
Stale bot will mark stale PR with a tag and close them after a specified
interval of time.
* Draft PRs are not subject to this marking.
* PR with an assignee or milestone is not subject to this marking.
Although the detection is working, the error message in autotools is not
perfect, i.e. it would only mention valid range for libtorrent v1 and it
shouldn't be a problem since v2 support isn't fully ready yet.
We can no longer save valid torrent files in the general case, because
for torrents of version 2, we need a full merkle tree to do it, but if
a torrent is added from magnet link, full merkle tree may not be available
even before the end of downloading all the data. Actually, we don't need
the full torrent file for the purposes of resuming the torrent, so we can
allow libtorrent to produce only a minimal part of the metadata as part
complete resume data, but we still want to store it in a separate file,
so we extract the resulting metadata from the complete resume data before
saving and merge it together before loading.
This allows the system to properly encode the '|', instead of passing
the '|' on in the URL, which is not allowed and breaks proxies such as
Authelia.
Then, for the purpose of generalization, I pushed this pattern through
to all places where we join items with a '|'.
This comes with the caveat that when we have individual components which
contain a '|' or any other character that is not allowed per the
HTTP standard, we still like to encode the individual components,
for example in the case of 3 strings, separated by a '|'.
If we don't do this we run into the risk that upon decoding URI finds
'|' in our original strings, which is something we don't want.
For example:
Sender:
````javascript
const arr = ["foo|1", "bar|2"];
const uri = new URI("test.html").setData(arr.join("|"));
````
Then on the receiving window, when it receives the uri and splits it, it
looks like this:
````javascript
const arr = new URI().getData('hashes').split('|');
// arr is now ["foo", "1", "bar", "2"]
````
This is why when we want to send a literal "|" we need to do
`encodeURIComponent` and `decodeURIComponent` manually on each item,
and THEN we join.
For example:
Sender:
````javascript
const arr = ["foo|1", "bar|2"];
const uri = new URI("test.html").setData(arr.map(encodeURIComponent).join("|"));
````
Receiver:
````javascript
const arr = new URI().getData('hashes').split('|').map(decodeURIComponent);
// arr is now ["foo|1", "bar|2"]
````
We don't need to with hashes as they are HEX, so no risk of any weird
characters in there.
Those strings sometimes are quite long and having a tooltip would
save the action of resizing the column width to see the full message.
The WebUI already has it done for all columns.
This also suppress the compiler warning:
src/base/bittorrent/torrentimpl.cpp:228:36: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const size_t’ {aka ‘const long unsigned int’} [-Wsign-compare]
Both `lt::create_torrent` constructor and `lt::create_torrent::generate()`
can throw an exception so we need to handle it to prevent the app from crashing.
The issue was resolved by using QAction::toggled signal instead of
QAction::triggered. In QT 5.15+ the latter signal causes a QMenu
to close, whereas the former does not. Closes#13492.
- warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
Caused by mismatch between size_type of std and Qt containers. It is safe to cast to int as all of those containers hold low number of objects.
When restoring from tray icon, although the window manager shows qbt
window but qbt itself didn't handle the event correctly, i.e. the
`show()` was missing and thus qbt did nothing and the window is blank.
Note that at this point the `visible` property is `false`.
After invoking `show()` qbt will start showing the contents and also
fire another showEvent where `visible` property is `true` and here is where
qbt should handle preparations for the window.
Fix#9510.
- update vcpkg to latest commit (includes updated libtorrent port)
- drop custom libtorrent port
- restore AppleClang workaround in the workflow file
- include install_manifest.txt in uploaded artifacts
- update actions to latest versions
- fix typos
This is to suppress the following compilation warnings:
base/bittorrent/magneturi.cpp: In constructor ‘BitTorrent::MagnetUri::MagnetUri(const QString&)’:
base/bittorrent/magneturi.cpp:87:60: warning: missing initializer for member ‘BitTorrent::TrackerEntry::message’ [-Wmissing-field-initializers]
87 | m_trackers.append({QString::fromStdString(tracker)});
If torrent failed to write, it stops downloading and goes to
"upload mode" instead of errored state so it just keeps seeding.
Now qBittorrent indicates this state as "errored" and allows
the user to manually bring the torrent out of this state.
Line 32
Changing "zumindest" to "mindestens".
I even would go further to change the line into "[...] Windows 7 oder höher." ("[...] Windows 7 or higher."), as this seems to make more sense and we wouldn't have the hassle of discussing whether "zumindest" or "mindestens" fits better.
If you insist on a comment:
It is quite a cosmetic change, and a personal opinion as well. Imo "mindestens" fits more to the theme of general use - "zumindest" can be used in special places, as it isn't that common in e.g. regular conversations. What comes to my mind is "Best before", which is "Mindestens haltbar bis". It would be unusual to use "Zumindest haltbar bis". 😄
Finally it is up to you what to change.
CC: @schnurlos
Additionally I fixed line 10, where no need of a double-"mit" was.
Plus line 34, as requested!
Now the comparison function/class should be constructed before usage.
This change also make it easier to plug in into various containers which
will require a compare function type (such as std::set).
This reverts commit 435bb34435.
To achieve what the reverted commit wants, the timing
would need to be taken iteratively rather that cumulatively
fixes#14735
Don't clamp elapsed time of SpeedPlotView::Averager on resolution. Since
it may cause minor discrepencies across different Averagers with
different resolution for same speed update.
Regarding this license clarification there are 3 commits of interest
(commits A, B, C). Before commit A the COPYING file contained only the
text of the GPLv2 license, while all source files had a license block
at the top saying that they are under the terms of "GPLv2 or later". With
commit A there was a temporary change to GPLv3. The COPYING file contained
only the text of the GPLv3 license, while all source files had a license
block at the top saying that they are under the terms of "GPLv3 or later".
Then with commit B the COPYING file and the license block of the source
files was reverted to their state before commit A. Afterwards, with
commit C a license summary(or clarification) block was put at the top of
the COPYING file. This block indicated that the license was GPLv2 without
having the "or later" clause and it also included the OpenSSL exception.
However, the license block of each source file continued to contain the
"or later" clause which was not removed. The same license block continues
to exist in all current source files. Thus it is concluded that the ommision
of the "or later" clause with commit C in the COPYING file was accidental.
OR ALTERNATIVELY (OR IN ADDITION)
At the time commit C was made Christophe Dumez was not the sole contributor.
There is no record that the other contributors agreed with the supposed
GPLv2 only change or that there was a Contributor License Agreement,
transfering their rights to him. Thus making his license change decision
invalid/void/illegal.
Commit A: 54f9375b32
Commit B: 8df61db644
Commit C: 9835af4962
Implement ResumeDataStorage class as base for all "resume data" storages.
Implement BencodeResumeDataStorage class and put all existing logic of
"resume data" loading/saving there.
Now it follows closely the definition of wildcard for glob patterns.
The backslash (\) character is not an escape char in this context.
In order to match one of the special characters, place it in square
brackets (for example, [?]).
Define "torrent ID" concept, which is either a SHA1 hash for torrents of version 1,
or a SHA256 hash (truncated to SHA1 hash length) for torrents of version 2.
Add support for native libtorrent2 info hashes.
Pass application directory as PDB search path in SymInitialize.
Otherwise it searches in application working directory so when you
run qBittorrent with working directory other than its installation
one it can't find qbittorent.pdb file and produces broken stacktrace.
Previously SpeedPlotView assumed speed is updated per second but the
default value was 1500ms and that can be further changed by the
user, this caused a lot of duplicate data in the calculation of the
graph points. Now Averager averages based on the target duration, resolution
and also takes into account when actually data has arrived.
Also improved resolution of 6-hour graph, previously it was same as 12-hour graph
These files were created and edited in their entirety in commit 8db4bde15d
As far as I can tell they were almost entirety rewritten from their original state.
The old copyright attribution is restored and the new author is added too.
Originally, it was just a wrapper for libtorrent::torrent_handle class, so it mimicked its name.
It was then transformed into a more complex aggregate, but the name was retained (just by inertia).
Unlike libtorrent::torrent_handle class in whose name "handle" means the pattern used,
it does not matter for qBittorrent classes and just eats up space in the source code.
The basic idea is we create a version header template at
"src/base/version.h.in" and the build systems are expected to replace
strings that are enclosed with @ symbols and generate
"src/base/version.h" for other source files to consume/include.
Previously it only handle the case of failed lookup, now it discard
invalid values when deserializing the database from disk.
Also checks whether the data is convertible to the intended type.
This applies to "About Dialog", "Ban List Options Dialog", "Download From URL Dialog", "IP Subnet
Whitelist Options Dialog", "Search Plugin Select Dialog", "Search Plugin Source Dialog",
"Statistics Dialog", "Speed Limit Dialog" and "Torrent Options Dialog".
Also unifies storing the dialog size under the key "Size".
Fixed a regression where the script tries to access elements that no longer
exist on the page, because they were replaced with others by a previous change.
Fixed a regression where the script tries to access elements that no longer
exist on the page, because they were replaced with others by a previous change.
Move files/folders renaming functions to core classes.
Query file/folder for renaming by its current path.
Add ability to rename content folders from WebAPI/WebUI.
Fortunately, serializing to JSON limits the data types to a very small
subset and thus we are able to implement the comparison without much
hassle.
Fix up cba8d83b21.
Another idea would be manually define a custom comparison function for
QVariant. However, having the function would be excessive due to its
limited usage count, also note that we are already casting
various QVariant to its underlying type in existing code.
The default version is so outdated that it needs to rebuild many
dependencies. Now we bump it to the latest version so that it can use
prebuilt packages.
As referenced in https://github.com/qbittorrent/qBittorrent/pull/13615
and suggested by @glassez
- Use the word qBittorrent when it is mentioned for the first time within a string.
- If the string contains other references to qBittorrent, then use it (rather than repeating qBittorrent).
Line 24 is the updated Dutch translation for the recently updated English source string (may 2020)
In libtorrent 2.0, the `connection_type` was changed to a flag type and
hence it cannot be used in a switch statement directly. Also our use of
`connection_type` is limited so that a single equality comparison
would cover all of our use cases.
Add option for setting lt::settings_pack::hashing_threads
introduced by libtorrent 2.0. It has no effect for earlier
libtorrent versions.
Use 10 async IO threads, as per #11461.
Closes#11461.
This was default before CMake overhaul, and it doesn't
make sense to use static builds with daily developement.
Also static Qt builds are not readily available on Windows.
Don't hardcode lt::settings_pack::no_connect_privileged_ports. We
support the peer alert for it already, so connections blocked by this
setting should be logged.
The selected rows aren't queried until after a user confirms they
would like to ban the selected peers. If a peer disconnects before
the confirmation is pressed, they will not be included in the
selection. This commit makes sure the selected rows are stored before
a selection is made to prevent the loss of any peers.
Closes#13385.
Always store firstLastPiecePriority in resume data.
Don't recalculate firstLastPiecePriority value each time it is accessed.
Always store sequentialDownload in resume data as native libtorrent field.
This is unexpected for users that take single job compilation as the
default (which is always the case since forever). Users can change the
default if they wish to use multicore for compilation.
- Bump minimum required version and
make use of more modern language features
- Rely more on target_...() commands to establish dependency
relationships between targets rather than directory property commands
- Improve libtorrent package discovery
- Enable and handle application features more explicitly
- Improve user-facing output
- Fix various compilation issues on Windows (MSVC and MinGW) and macOS
- Improve handling of translations
- Add explanatory comments where relevant
- Make CMake scripts fully independent of qmake files/details
- Remove old functions/macros
Previously that action is the same as "Open" action which is wrong
behavior, it should be opening the parent folder instead. The wrong
behavior is observed on nautilus 3.36.3 and nemo 4.6.5.
Previously, if double click on the Size number in torrent content tab
the path would be an incorrect value and as such open path functionality
won't work, this commit fixes it.
This PR exposes the LibTorrent Peer Turnover Settings in qBT Advanced Settings in order to allow users to adjust how frequently slow and uninteresting connections are closed to allow potentially better / faster connections to be made.
The default settings are to turnover peers when the number of connections is at least 90% of allowed global or per torrent connections, and to disconnect the least attractive 4% of these connections every 5 minutes.
See https://www.libtorrent.org/reference-Settings.html#peer_turnover
Closes#13029.
Fixes an issue with truncation of a QByteArray at the first '\0' byte
when parsing HTTP request query strings.
Previously, the operands of the ternary expression were of
different types. Most likely this was leading to a conversion
of the result to some kind of '\0'-terminated string type somewhere
along the way, in turn causing its truncation at the first '\0' byte
once converted back to QByteArray.
For some reason this bug was only present on Windows (MSVC).
libtorrent-2.0 introduced a type-safe alternative to void* (lt::client_data_t)
for passing user-data into plugins. qBT doesn't use any user data in its
plugins, but the signatures have changed nevertheless, and qBT need to update to
be compatible with libtorrent-2.0.
torrentcreatorthread.cpp does not need to include libtorrent/storage.hpp, but
just needs libtorrent/file_storage.hpp. The former header is for implementing a
custom storage. Change include to libtorrent/file_storage.hpp
After this change: "http://<server>/icons" will point to "src/icons"
folder and "http://<server>/images" points to the real "images" folder
in the relative path.
Warning from compiler:
speedplotview.cpp:342:63: warning: ‘QPainter::HighQualityAntialiasing’ is deprecated: Use Antialiasing instead [-Wdeprecated-declarations]
The following is the warning from compiler:
rss_item.cpp:70:79: warning: ‘QRegularExpression::OptimizeOnFirstUsageOption’ is deprecated: This option does not have any effect since Qt 5.12 [-Wdeprecated-declarations]
Some actions can be performed despite of other states
(e.g. "Errored" torrent can check its files currently)
so the states that relate to such actions should override
other (so-called "static") states.
"private" subfolders violate the structure of the project,
since the existence of all other subfolders is based on a
different principle.
In addition, there is no clear line between "private" and
"non private".
This commit adds a new libtorrent setting to validate HTTPS tracker
certificates. When enabled, libtorrent will validate the certificate
of HTTPS trackers against the system's certificate store. This option
is only enabled on libtorrent versions >= 1.2.6 and on non-Windows
systems, as OpenSSL does not use the system's certificate store on
Windows.
Added markAsRead API method with optional parameter for specifying single article.
Added the rss_smart_episode_filters and rss_download_repack_proper_episodes keys to preference api.
Added matchingArticles API method for retrieving articles that match specified rule.
Since the class needs to be copy-constructible, there may be many
copies of an instance. So instead of writing to the device on every
destructor call, only flush buffer on the last destructor call.
Previously we need a file buffer that is as large as the file size and
this could be a problem when user has less free memory available or
having very large data. Now with the help of `FileOutputIterator`,
we can have a much smaller, fixed size immediate file buffer and also
the code looks nice with `lt::bencode()`.
This is a new setting added that is pending addition to
libtorrent 1.2.6. This setting is important because some routers do
not support expiration times on port-maps and do not return an error
either, silently failing. The previous default of permanent leases is
retained.
Qt 5.14 introduced new feature related to HighDPI screens support,
this parameter is called "scale factor rounding policy", and it is
intended to improve fractional scale factor support (like 150%).
Qt::PassThrough value guarantee that no any rounding will applied to
scale factor, and will be used as is.
By not emitting the native signal, all other keypresses other than
the copy and select keysequences are ignored. This should reallow
keyboard navigation within LogListWidget objects.
Closes#12172.
Set Qt::AA_EnableHighDpiScaling application attribute when Qt 5.14.x or
newer is used. This fixes a lot of scaling issues on HiDPI displays.
Unfortunately, this flag must be set only before QApllication object
creation, so the only one place where it can be done is main().
* Fix wrong fields for translation comments
* Improve torrent management tooltip to cover both modes
* Add new tooltips for potentially confusing settings
Decent progress towards #6346, closes#9994, closes#11528
BEP-3 says all tracker responses to valid announce requests should be bencoded dictionaries with at least the "peers" and "interval" keys; the "peers" key can be empty.
Also clarify support for BEP-21.
The embedded tracker was returning a non-compliant response.
The peer lists should be packed strings instead of lists.
Also clarify level of compliance with BEP-7.
The `comment` field is used for disambiguation between identical
strings. Our case here should use the `extracomment` field which
meant as comment for translators.
Filter list (left side panel) in WebUI is implemented using <a> tags,
CSS defines default style for all <a> elements, and specific style for
filter list elements. Default style for <a> elements sets color, and
this color also used in list. This is looks not so well. So lets just
inherit text color from parent element, and as so as it is not set, so
default text color will be used.
This makes filter list looks like other UI elemets, making all UI more
consistent (like in desktop app).
1. Use unified function names `initInstance()` and `freeInstance()` and
make them public.
2. Add `freeInstance()` to avoid noise from memory leak detectors.
3. Let `instance()`return a pointer directly to avoid unnecessary
indirections when invoking functions.
This will allow browsers to get high quality icon with required
resolution instead of resizing some small raster image.
Browsers can have even more benefit from it. For example, Firefox uses
high resolution icon to display it in "Top Sites" instead of page
preview.
Nothing changes for browsers which doesn't support SVG favicons, older
PNG icon will be used in such case.
The basic idea is to hash each class member and then mix them with xor
operation.
However the `seed` must be handled with care, it should only be
introduced once when mixing the hashes of each class member, otherwise
under some circumstances the `seed` might xor with itself and thus break
the intended effect.
When the CMake system was last revamped, the configure variable was
changed from WEBUI to DISABLE_WEBUI, but we are still checking
against WEBUI. This behavior was changed in fa770871e9
If we were conditionally enabling _BSD_SOURCE or _SVID_SOURCE, I can
understand trying to play nice with the compiler and only pass as
needed, however this is not the case and glibc <= 2.19 will not care
that we are passing _DEFAULT_SOURCE. This removes an unnecessary
build step and gives us less to maintain from a build system
perspective.
Small cosmetic changes to MacroQbtCompilerSettings are included.
Our previous setup lead to two unintended consequences:
* Debug flags were included in both release and debug builds instead
of just debug builds
* Clang doesn't support -gX (where X is the level of debugging
optimization), but we checked for -Og support instead
This commit avoids both of these scenarios by removing the additional
flags altogether. Partial resolution to #11856.
`/api/v2/torrents/info` can now take the following new values for the`filter` parameter: `stalled`, `stalled_uploading` and `stalled_downloading`.
Requires Web API version bump.
Closes#11787
Model returns string for DisplayRole.
Text alignment is set by Model (using TextAlignmentRole).
Delegate performs custom painting only where necessary
(i.e. for Progress bar).
Don't sync main data if a request to do so is already in progress.
This prevents piling up of requests and bogging down slow/busy machines, since the current implementation of `/api/v2/sync/maindata` is very computationally intensive, especially with lots of torrents.
Everything gets updated on the next scheduled request anyway (via the timeout mechanism).
Closes#11724.
Option is enabled by default for users using qBittorrent's built-in HTTPS capabilities. This flag will never be set if qBittorrent is using plain HTTP.
Users using HTTPS reverse proxies, like "qbt <-> (http) <-> proxy <-> (https) <-> user" should override the flag in the proxy in order to set it, if they wish to do so.
- CheckingMemUsageSize (16 MiB -> 32 MiB): a 16 MiB increase in memory consumption seems worthwhile for a nice performance boost in most cases.
- DiskCacheSize (64 MiB -> Auto): auto yields the best performance without committing to a huge fixed value.
- UseRandomPort (false -> true): The initial port chosen by qBittorrent may clash with something else the user already has that is aways using that port (low probability, but still). Thus, qBittorrent will always fail listening on that port, causing unexpected problems for the user. Users who know they want a fixed port will go to the settings anyway.
Closes#8772.
This will fix issue that "Free space on disk:" label in
Add New Torrent dialog not updated on Category change
when Torrent Management Mode is on Auto mode.
It should remain disabled by default. Anyone that needs to Queue torrents for seeding/downloading should go to settings and change it to their preference.
Enable portable mode if "profile" directory exists in the app dir.
Remove "--portable" command line argument.
Add logging of current profile config directory.
Closes#9445.
Restored torrents already have the correct path saved in their fastresume. Don't override it.
Magnets and new torrents have to be set explicitly to the incomplete folder if it is enabled.
Closes#11552
According to Mozilla docs, registerProtocolHandler() is only
available when using secure contexts (i.e. HTTPS for everything
outside localhost).
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler
The message "Your browser does not support this feature" does not
make this obvious and can lead to confusion if the user is using a
modern browser.
Specifying a height/width value might cut the displayed text or
obstruct centering the text in the button, so let it auto decide
instead.
Closes#11553.
Before this patch, adding the torrent in
https://github.com/qbittorrent/qBittorrent/issues/11511 and the torrrent
state will stay in torrent_status::checking_resume_data forever.
This is not the correct state since the `torrent_status.errc` field is
non-zero and this commit fixes it.
2019-11-26 03:15:48 +08:00
1220 changed files with 384454 additions and 208860 deletions
description:File a bug report to help improve qBittorrent user experience.
body:
- type:markdown
attributes:
value:|
#### ADVISORY
"We do not support any versions older than the current release series"
"We do not support any 3rd party/forked versions e.g. `portableapps`/`Enhanced Edition`etc."
"Please post all details in **English**."
#### Prerequisites before submitting an issue!
- Read the issue reporting section in the **[contributing guidelines](https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md)**, to know how to submit a good bug report with the required information.
- Verify that the issue is not fixed and is reproducible in the **[latest official qBittorrent version](https://www.qbittorrent.org/download.php).**
- (Optional, but recommended) Verify that the issue is not fixed and is reproducible in the latest CI (**[macOS](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_macos.yaml?query=branch%3Amaster+event%3Apush)** / **[Ubuntu](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_ubuntu.yaml?query=branch%3Amaster+event%3Apush)** / **[Windows](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_windows.yaml?query=branch%3Amaster+event%3Apush)**) builds.
- Check the **[frequent/common issues list](https://github.com/qbittorrent/qBittorrent/projects/2)** and perform a **[search of the issue tracker (including closed ones)](https://github.com/qbittorrent/qBittorrent/issues)** to avoid posting a duplicate.
- Make sure this is not a support request or question, both of which are better suited for either the **[discussions section](https://github.com/qbittorrent/qBittorrent/discussions)**, **[forum](https://qbforums.shiki.hu/)**, or **[subreddit](https://www.reddit.com/r/qBittorrent/)**.
- Verify that the **[wiki](https://github.com/qbittorrent/qBittorrent/wiki)** did not contain a suitable solution either.
- If relevant to issue/when asked, the qBittorrent preferences file, qBittorrent.log & watched_folders.json (if using "Watched Folders" feature) must be provided.
See **[Where does qBittorrent save its settings?](https://github.com/qbittorrent/qBittorrent/wiki/Frequently-Asked-Questions#Where_does_qBittorrent_save_its_settings)**
- type:textarea
attributes:
label:qBittorrent & operating system versions
description:|
Qt and libtorrent-rasterbar versions are required when: 1. You are using linux. 2. You are not using an official build downloaded from our website.
Example of preferred formatting:
qBittorrent: 4.3.7 x64
Operating system: Windows 10 Pro 21H1/2009 x64
Qt: 5.15.2
libtorrent-rasterbar: 1.2.14
placeholder:|
qBittorrent:
Operating system:
Qt:
libtorrent-rasterbar:
validations:
required:true
- type:textarea
attributes:
label:What is the problem?
description:Please add the "crash report" (if encountered) or give a clear and concise description of problem.
validations:
required:true
- type:textarea
attributes:
label:Steps to reproduce
description:Please provide reliable steps to reproduce the problem.
placeholder:|
1. First step
2. Second step
3. and so on...
validations:
required:false
- type:textarea
attributes:
label:Additional context
description:Add screenshots etc. (Anything that will provide more context about the problem)
validations:
required:false
- type:textarea
attributes:
label:Log(s) & preferences file(s)
description:|
Add these files: qBittorrent preferences file, qBittorrent.log & watched_folders.json (if using "Watched Folders" feature).
See **[Where does qBittorrent save its settings?](https://github.com/qbittorrent/qBittorrent/wiki/Frequently-Asked-Questions#Where_does_qBittorrent_save_its_settings)**
#### Note: It's the user's responsibility to redact any sensitive information
description:Suggest a new feature or enhancement for qBittorrent.
labels:["Feature request"]
body:
- type:markdown
attributes:
value:|
#### ADVISORY
"Please post all details in **English**."
#### Prerequisites before submitting a feature request!
- Read the feature request section in the **[contributing guidelines](https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md)**, to know how to submit a good feature request with the required information.
- Verify that the feature being requested is not available in the **[latest official qBittorrent version](https://www.qbittorrent.org/download.php).**
- (Optional but recommended) Verify that the feature being requested is not available in the latest CI (**[macOS](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_macos.yaml?query=branch%3Amaster+event%3Apush)** / **[Ubuntu](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_ubuntu.yaml?query=branch%3Amaster+event%3Apush)** / **[Windows](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_windows.yaml?query=branch%3Amaster+event%3Apush)**) builds.
- Search the issue tracker with the **[feature request filter](https://github.com/qbittorrent/qBittorrent/issues?q=is%3Aopen+is%3Aissue+label%3A%22Feature+request%22)** for similar feature requests (including closed ones) to avoid posting a duplicate.
- Make sure this is not a support request or question, both of which are better suited for either the **[discussions section](https://github.com/qbittorrent/qBittorrent/discussions)**, **[forum](https://qbforums.shiki.hu/)**, or **[subreddit](https://www.reddit.com/r/qBittorrent/)**.
- Verify that the **[wiki](https://github.com/qbittorrent/qBittorrent/wiki)** did not contain a suitable solution either.
- type:textarea
attributes:
label:Suggestion
validations:
required:false
- type:textarea
attributes:
label:Use case
validations:
required:false
- type:textarea
attributes:
label:Extra info/examples/attachments
description:Add screenshots etc. (Anything that will give us more context about what is being requested!)
stale-pr-message:"This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity."
close-pr-message:"This PR was closed because it has been stalled for some time with no activity."
days-before-stale:-1# avoid marking issues
days-before-pr-stale:60
days-before-close:-1# avoid closing issues
days-before-pr-close:7
exempt-all-pr-assignees:true# avoid stale for all PR with assignees
exempt-all-pr-milestones:true# avoid stale for all PR with milestones
# only allow specific build for coverity scan, others will stop
- if [ "$TRAVIS_BRANCH" = "$coverity_branch" ] && ! [ "$TRAVIS_OS_NAME" = "linux" -a "$libt_branch" = "RC_1_2" -a "$gui" = "true" -a "$build_system" = "qmake" ]; then exit ; fi
- shopt -s expand_aliases
- alias make="colormake -j2"# Using nprocs/2 sometimes may fail (gcc is killed by system)
feature_option(WEBUI"Enables built-in HTTP server for headless use"ON)
feature_option(VERBOSE_CONFIGURE"Show information about PACKAGES_FOUND and PACKAGES_NOT_FOUND in the configure output (only useful for debugging the CMake build scripts)"OFF)
if(CMAKE_SYSTEM_NAMESTREQUAL"Linux")
feature_option_dependent(DBUS
"Enables support for notifications and power-management features on Linux via D-Bus"
ON"GUI"OFF
)
feature_option_dependent(SYSTEMD
"Install systemd service file to a directory manually overridable with Systemd_SERVICES_INSTALL_DIR"
OFF"NOT GUI"OFF
)
if(STACKTRACE)
check_cxx_source_compiles(
"#include <execinfo.h>
int main(){return 0;}"
QBITTORRENT_HAS_EXECINFO_H
)
if(NOTQBITTORRENT_HAS_EXECINFO_H)
message(FATAL_ERROR"execinfo.h header file not found.\n"
"Please either disable the STACKTRACE feature or use a libc that has this header file, such as glibc (GNU libc)."
)
endif()
endif()
elseif(MSVC)
feature_option(MSVC_RUNTIME_DYNAMIC"Use MSVC dynamic runtime library (-MD) instead of static (-MT)"ON)
All new code **must** follow the following coding guidelines.
# Coding Guidelines
If you make changes in a file that still uses another coding style, make sure that you follow these guidelines for your changes.
All new code **must** follow the following coding guidelines. \
If you make changes in a file that still uses another coding style, make sure that you follow these guidelines for your changes. \
For programming languages other than C++ (e.g. JavaScript) used in this repository and submodules, unless otherwise specified, coding guidelines listed here applies as much as possible.
For programming languages other than C++ (e.g. JavaScript) used in this repository and submodules, unless otherwise specified, coding guidelines listed here applies as much as possible.
**Note 1:** I will not take your head if you forget and use another style. However, most probably the request will be delayed until you fix your coding style.
**Note 1:** I will not take your head if you forget and use another style. However, most probably the request will be delayed until you fix your coding style. \
**Note 2:** You can use the `uncrustify` program/tool to clean up any source file. Use it with the `uncrustify.cfg` configuration file found in the root folder.
**Note 2:** You can use the `uncrustify` program/tool to clean up any source file. Use it with the `uncrustify.cfg` configuration file found in the root folder. \
**Note 3:** There is also a style for QtCreator but it doesn't cover all cases. In QtCreator `Tools->Options...->C++->Code Style->Import...` and choose the `codingStyleQtCreator.xml` file found in the root folder.
**Note 3:** There is also a style for QtCreator but it doesn't cover all cases. In QtCreator `Tools->Options...->C++->Code Style->Import...` and choose the `codingStyleQtCreator.xml` file found in the root folder.
### Table Of Contents
## Table Of Contents
* [1. New lines & curly braces](#1-new-lines--curly-braces)
* [1. New lines & curly braces](#1-new-lines--curly-braces)
* [a. Function blocks, class/struct definitions, namespaces](#a-function-blocks-classstruct-definitions-namespaces)
* [a. Function blocks, class/struct definitions, namespaces](#a-function-blocks-classstruct-definitions-namespaces)
@@ -29,11 +31,13 @@ For programming languages other than C++ (e.g. JavaScript) used in this reposito
### a. Function blocks, class/struct definitions, namespaces
#### a. Function blocks, class/struct definitions, namespaces ####
```c++
```c++
int myFunction(int a)
int myFunction(int a)
{
{
@@ -43,7 +47,7 @@ int myFunction(int a)
void myFunction() {} // empty body
void myFunction() {} // empty body
MyClass::MyClass(int *parent)
MyClass::MyClass(int *parent)
: m_parent(parent)
: m_parent {parent}
{
{
// initialize
// initialize
}
}
@@ -79,17 +83,21 @@ namespace Name
}
}
```
```
#### b. Other code blocks ####
### b. Other code blocks
```c++
```c++
if (condition) {
if (condition)
{
// code
// code
}
}
for (int a = 0; a < b; ++b) {
for (int a = 0; a < b; ++b)
{
// code
// code
}
}
switch (a) {
switch (a)
{
case 1:
case 1:
// blah
// blah
case 2:
case 2:
@@ -97,17 +105,25 @@ case 2:
default:
default:
// blah
// blah
}
}
{
// code
}
```
```
#### c. Blocks in switch's case labels ####
### c. Blocks in switch's case labels
```c++
```c++
switch (var) {
switch (var)
case 1: {
{
case 1:
{
// declare local variables
// declare local variables
// code
// code
}
}
break;
break;
case 2: {
case 2:
{
// declare local variables
// declare local variables
// code
// code
}
}
@@ -117,22 +133,29 @@ default:
}
}
```
```
#### d. If-else statements ####
### d. If-else statements
The `else if`/`else` must be on their own lines:
The `else if`/`else` must be on their own lines:
```c++
```c++
if (condition) {
if (condition)
{
// code
// code
}
}
else if (condition) {
else if (condition)
{
// code
// code
}
}
else {
else
{
// code
// code
}
}
```
```
#### e. Single statement if blocks ####
### e. Single statement if blocks
Most single statement if blocks should look like this:
Most single statement if blocks should look like this:
```c++
```c++
if (condition)
if (condition)
a = a + b;
a = a + b;
@@ -141,19 +164,23 @@ if (condition)
One acceptable exception to this can be `return`, `break` or `continue` statements,
One acceptable exception to this can be `return`, `break` or `continue` statements,
provided that the test condition isn't very long and its body statement occupies only one line.
provided that the test condition isn't very long and its body statement occupies only one line.
However you can still choose to use the first rule.
However you can still choose to use the first rule.
```c++
```c++
if (a > 0) return;
if (a > 0) return;
while (p) {
while (p)
{
// ...
// ...
if (!b) continue;
if (!b) continue;
}
}
```
```
#### f. Acceptable conditions to omit braces ####
### f. Acceptable conditions to omit braces
When the conditional statement in `if`/`else` has only one line and its body occupy only one line,
When the conditional statement in `if`/`else` has only one line and its body occupy only one line,
this also applies to loops statements.
this also applies to loops statements. \
Notice that for a series of `if - else` branches, if one branch needs braces then all branches must add braces.
Notice that for a series of `if - else` branches, if one branch needs braces then all branches must add braces.
```c++
```c++
if (a < b) // conditional statement
if (a < b) // conditional statement
do(a); // body
do(a); // body
@@ -165,21 +192,27 @@ else if (a > b)
else
else
do(c);
do(c);
if (a < b) {
if (a < b)
{
do(a);
do(a);
}
}
else if (a > b) { // curly braces required here, then all branches should also add them
else if (a > b)
{
// curly braces required here, then all branches should also add them
do(b);
do(b);
do(d);
do(d);
}
}
else {
else
{
do(c);
do(c);
}
}
```
```
#### g. Brace enclosed initializers ####
### g. Brace enclosed initializers
Unlike single-line functions, you must not insert spaces between the brackets and concluded expressions.<br/>
Unlike single-line functions, you must not insert spaces between the brackets and concluded expressions. \
But you must insert a space between the variable name and initializer.
But you must insert a space between the variable name and initializer.
```c++
```c++
Class obj {}; // empty
Class obj {}; // empty
Class obj {expr};
Class obj {expr};
@@ -187,28 +220,33 @@ Class obj {expr1, /*...,*/ exprN};
QVariantMap map {{"key1", 5}, {"key2", 10}};
QVariantMap map {{"key1", 5}, {"key2", 10}};
```
```
### 2. Indentation ###
## 2. Indentation
4 spaces.
4 spaces.
### 3. File encoding and line endings ###
## 3. File encoding and line endings
UTF-8 and Unix-like line ending (LF). Unless some platform specific files need other encodings/line endings.
UTF-8 and Unix-like line ending (LF). Unless some platform specific files need other encodings/line endings.
### 4. Initialization lists ###
## 4. Initialization lists
Initialization lists should be vertical. This will allow for more easily readable diffs. The initialization colon should be indented and in its own line along with first argument. The rest of the arguments should be indented too and have the comma prepended.
Initialization lists should be vertical. This will allow for more easily readable diffs. The initialization colon should be indented and in its own line along with first argument. The rest of the arguments should be indented too and have the comma prepended.
```c++
```c++
myClass::myClass(int a, int b, int c, int d)
myClass::myClass(int a, int b, int c, int d)
: m_a(a)
: m_a {a}
, m_b(b)
, m_b {b}
, m_c(c)
, m_c {c}
, m_d(d)
, m_d {d}
{
{
// code
// code
}
}
```
```
### 5. Enums ###
## 5. Enums
Enums should be vertical. This will allow for more easily readable diffs. The members should be indented.
Enums should be vertical. This will allow for more easily readable diffs. The members should be indented.
```c++
```c++
enum Days
enum Days
{
{
@@ -222,11 +260,14 @@ enum Days
};
};
```
```
### 6. Names ###
## 6. Names
All names should be camelCased.
All names should be camelCased.
#### a. Type names and namespaces ####
### a. Type names and namespaces
Type names and namespaces start with Upper case letter (except POD types).
Type names and namespaces start with Upper case letter (except POD types).
```c++
```c++
class ClassName {};
class ClassName {};
@@ -241,14 +282,18 @@ namespace NamespaceName
}
}
```
```
#### b. Variable names ####
### b. Variable names
Variable names start with lower case letter.
Variable names start with lower case letter.
```c++
```c++
int myVar;
int myVar;
```
```
#### c. Private member variable names ####
### c. Private member variable names
Private member variable names start with lower case letter and should have ```m_``` prefix.
Private member variable names start with lower case letter and should have ```m_``` prefix.
```c++
```c++
class MyClass
class MyClass
{
{
@@ -256,23 +301,26 @@ class MyClass
}
}
```
```
### 7. Header inclusion order ###
## 7. Header inclusion order
The headers should be placed in the following group order:
1. Module header (in .cpp)
2. C++ Standard Library headers
3. System headers
4. Boost library headers
5. Libtorrent headers
6. Qt headers
7. qBittorrent's own headers, starting from the *base* headers.
The headers should be ordered alphabetically within each group.
The headers should be placed in the following group order:
If there are conditionals for the same header group, then put them at the bottom of the respective group.
1. Module header (in .cpp)
2. C++ Standard Library headers
3. System headers
4. Boost library headers
5. Libtorrent headers
6. Qt headers
7. qBittorrent's own headers, starting from the *base* headers.
The headers should be ordered alphabetically within each group. \
If there are conditionals for the same header group, then put them at the bottom of the respective group. \
If there are conditionals that contain headers from several different header groups, then put them above the "qBittorrent's own headers" group.
If there are conditionals that contain headers from several different header groups, then put them above the "qBittorrent's own headers" group.
One exception is the header containing the library version (for example, QtGlobal), this particular header isn't constrained by the aforementioned order.
One exception is the header containing the library version (for example, QtGlobal), this particular header isn't constrained by the aforementioned order.
Example:
Example:
```c++
```c++
// file: examplewidget.cpp
// file: examplewidget.cpp
@@ -322,8 +370,10 @@ Example:
#include "ui_examplewidget.h"
#include "ui_examplewidget.h"
```
```
### 8. Include guard ###
## 8. Include guard
`#pragma once` should be used instead of "include guard" in new code:
`#pragma once` must be used instead of a "classic include guard":
```c++
```c++
// examplewidget.h
// examplewidget.h
@@ -338,75 +388,77 @@ class ExampleWidget : public QWidget
```
```
### 9. Misc ###
## 9. Misc
* Line breaks for long lines with operation:
* Line breaks for long lines with operation:
```c++
```c++
a += "b"
a += "b"
+ "c"
+ "c"
+ "d";
+ "d";
```
```
* **auto** keyword
* **auto** keyword
We allow the use of the **auto** keyword only where it is strictly necessary
We allow the use of the **auto** keyword only where it is strictly necessary (for example, to declare a lambda object, etc.), or where it **enhances** the readability of the code. \
(for example, to declare a lambda object, etc.), or where it **enhances** the readability of the code.
Declarations for which one can gather enough information about the object interface (type) from its name or the usage pattern (an iterator or a loop variable are good examples of clear patterns) or the right part of the expression nicely fit here.
Declarations for which one can gather enough information about the object interface (type) from its name
or the usage pattern (an iterator or a loop variable are good examples of clear patterns)
When weighing whetherto use an auto-typed variable please think about potential reviewers of your code, who will read it as a plain diff (on github.com, for instance). \
or the right part of the expression nicely fit here.<br/>
Please make sure that such reviewers can understand the code completely and without excessive effort.
<br/>
When weighing whether to use an auto-typed variable please think about potential reviewers of your code,
Some valid use cases:
who will read it as a plain diff (on github.com, for instance). Please make sure that such reviewers can
understand the code completely and without excessive effort.<br/>
* Container iteration and casts:
<br/>
Some valid use cases:
```c++
```c++
template <typename List>
template <typename List>
void doSomethingWithList(const List &list)
void doSomethingWithList(const List &list)
{
{
foreach (const auto &item, list)
foreach (const auto &item, list) {
{
// we don't know item type here so we use 'auto' keyword
// we don't know item type here so we use 'auto' keyword
// do something with item
// do something with item
}
}
}
}
for (auto it = container.begin(), end = container.end(); it != end; ++it) {
for (auto it = container.begin(), end = container.end(); it != end; ++it)
// we don't need to know the exact iterator type,
{
// because all iterators have the same interface
// we don't need to know the exact iterator type,
}
// because all iterators have the same interface
}
auto spinBox = static_cast<QSpinBox*>(sender());
auto spinBox = static_cast<QSpinBox*>(sender());
// we know the variable type based on the right-hand expression
// we know the variable type based on the right-hand expression
```
```
* Notice the spaces in the following specific situations:
* Notice the spaces in the following specific situations:
```c++
// Before and after the assignment and other binary (and ternary) operators there should be a space
// There should not be a space between increment/decrement and its operand
a += 20;
a = (b <= MAX_B ? b : MAX_B);
++a;
--b;
for (int a = 0; a < b; ++b) {
```c++
}
// Before and after the assignment and other binary (and ternary) operators there should be a space
// There should not be a space between increment/decrement and its operand
// Range-based for loop, spaces before and after the colon
a += 20;
for (auto i : container) {
a = (b <= MAX_B ? b : MAX_B);
}
++a;
--b;
// Derived class, spaces before and after the colon
for (int a = 0; a < b; ++b)
class Derived : public Base
{
{
}
};
// Range-based for loop, spaces before and after the colon
```
for (auto i : container)
{
}
// Derived class, spaces before and after the colon
class Derived : public Base
{
};
```
* Prefer pre-increment, pre-decrement operators
* Prefer pre-increment, pre-decrement operators
```c++
++i, --j; // Yes
```c++
i++, j--; // No
++i, --j; // Yes
```
i++, j--; // No
```
* private/public/protected must not be indented
* private/public/protected must not be indented
@@ -414,7 +466,8 @@ i++, j--; // No
* Method definitions aren't allowed in header files
* Method definitions aren't allowed in header files
### 10. Git commit message ###
## 10. Git commit message
1. Limit the subject line to 50 characters. Subject should contain only the very essence of the changes (you should avoid extra details and internals)
1. Limit the subject line to 50 characters. Subject should contain only the very essence of the changes (you should avoid extra details and internals)
2. Separate subject from body with a blank line
2. Separate subject from body with a blank line
3. Capitalize the subject line
3. Capitalize the subject line
@@ -424,6 +477,7 @@ i++, j--; // No
7. Use the body to explain what and why vs. how
7. Use the body to explain what and why vs. how
8. If commit fixes a reported issue, mention it in the message body (e.g. `Closes #4134.`)
8. If commit fixes a reported issue, mention it in the message body (e.g. `Closes #4134.`)
### 11. Not covered above ###
## 11. Not covered above
If something isn't covered above, just follow the same style the file you are editing has.
If something isn't covered above, just follow the same style the file you are editing has. \
*This guide is not exhaustive and the style for a particular piece of code not specified here will be determined by project members on code review.*
*This guide is not exhaustive and the style for a particular piece of code not specified here will be determined by project members on code review.*
* [Before submitting an enhancement/feature request](#before-submitting-an-enhancementfeature-request)
* [Before submitting an enhancement/feature request](#before-submitting-an-enhancementfeature-request)
* [Steps to ensure a good enhancement/feature suggestion](#steps-to-ensure-a-good-enhancementfeature-suggestion)
* [Steps to ensure a good enhancement/feature suggestion](#steps-to-ensure-a-good-enhancementfeature-suggestion)
***[Opening a pull request](#opening-a-pull-request)**
***[Opening a pull request](#opening-a-pull-request)**
* [Must read](#must-read)
* [Good to know](#good-to-know)
# Bug reporting etiquette
# Bug reporting etiquette
@@ -138,7 +130,7 @@ These are unstable/unsupported platforms, and in all likelihood, whatever the is
***For performance-related issues**, include as much profiling data as you can (resource usage graphs, etc).
***For performance-related issues**, include as much profiling data as you can (resource usage graphs, etc).
* Paste the **qBittorrent log** (or put the contents of the log in a gist and provide a link to the gist). The log can be viewed in the GUI (View -> Log -> tick all boxes). If you can't do that, the file is at:
* Paste the **qBittorrent log** (or put the contents of the log in a gist and provide a link to the gist). The log can be viewed in the GUI (View -> Log -> tick all boxes). If you can't do that, the file is at:
@@ -194,28 +186,26 @@ Following these guidelines helps maintainers and the community understand your s
# Opening a pull request
# Opening a pull request
### Must read
* Consult [coding guidelines][coding-guidelines-url] first. If you are working on translation/i18n, read ["How to translate qBittorrent"][how-to-translate-url].
*Read our [**coding guidelines**][coding-guidelines-url]. There are some scripts to help you: [uncrustify script][uncrustify-script-url], [astyle script][astyle-script-url], [(related thread)][coding-guidelines-thread-url].
*Keep your git commit history clean.
* Keep the title **short** and provide a **clear** description about what your pull request does.
* Refer to the section about ["Git commit messages"][coding-guidelines-git-commit-message-url] in the coding guidelines.
* Provide **screenshots** for UI related changes.
* When merge conflicts arise, do `git rebase <target_branch_name>` and fix the conflicts, don't do `git pull`. Here is a good explanation: [merging-vs-rebasing][merging-vs-rebasing-url].
* Keep your git commit history **clean** and **precise.** Refer to the section about "Git commit messages" in the [**coding guidelines**][coding-guidelines-url].
* Keep pull request title concise and provide motivation and "what it does" in the pull request description area. Make it easy to read and understand.
*If your commit fixes a reported issue (for example #4134), add the following message to the commit `Closes #4134.`. Example [here][commit-message-fix-issue-example-url].
*Provide screenshots for UI related changes.
* If your commit addresses a reported issue (for example issue #8454), append the following text to the commit body `Closes #8454.`. Example [commit][commit-message-fix-issue-example-url].
* Search [pull request list][pull-request-list-url] first. Others might have already implemented your idea (or got rejected already).
### Good to know
***Search** pull request history! Others might have already implemented your idea and it is waiting to be merged (or got rejected already). Save your precious time by doing a search first.
* When resolving merge conflicts, do `git rebase <target_branch_name>`, don't do `git pull`. Then you can start fixing the conflicts. Here is a good explanation: [link][merging-vs-rebasing-url].
* Be careful: another library (the one used by rTorrent) uses a similar name
* Be careful: another library (the one used by rTorrent) uses a similar name
- OpenSSL >= 1.0
- OpenSSL >= 1.1.1
- Qt >= 5.9.0
- Qt 5.15.2 - 5.x || 6.2.0 - 6.x
- zlib >= 1.2.5.2
- zlib >= 1.2.11
- pkg-config (compile-time only)
- pkg-config *
* Compile-time only on *nix systems
- Python >= 3.3.0 (optional, runtime only)
- Python >= 3.5.0
* Required by the internal search engine
* Optional, run-time only
* Used by the bundled search engine
Dependency version numbers are bumped every once in a while to keep the range of properly tested configurations manageable, even if not strictly required to build.
You may be able to build with older versions of (some of) the dependencies other than the minimum versions specified in the build scripts, but support for such builds is not provided - you are on your own.
Please ensure you are building with an officially supported configuration when reporting bugs.
2a) Compile and install qBittorrent with Qt graphical interface
2a) Compile and install qBittorrent with Qt graphical interface
[](https://github.com/qbittorrent/qBittorrent/actions)
# Check if already in >= C++14 mode because of the flags returned by one of the above packages
# Check if already in >= C++17 mode because of the flags returned by one of the above packages
TMP_CXXFLAGS="$CXXFLAGS"
TMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=""
CXXFLAGS=""
AC_MSG_CHECKING([if compiler defaults to C++14 or later mode])
AC_MSG_CHECKING([if compiler defaults to C++17 or later mode])
AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()],
AC_COMPILE_IFELSE([DETECT_CPP17_PROGRAM()],
[AC_MSG_RESULT([yes])
[AC_MSG_RESULT([yes])
QBT_CXX14_FOUND="yes"],
QBT_CXX17_FOUND="yes"],
[AC_MSG_RESULT([no])
[AC_MSG_RESULT([no])
QBT_CXX14_FOUND="no"])
QBT_CXX17_FOUND="no"])
# In case of no, check if the compiler can support at least C++14
# In case of no, check if the compiler can support at least C++17
# and if yes, enable it leaving a warning to the user
# and if yes, enable it leaving a warning to the user
AS_IF([test "x$QBT_CXX14_FOUND" = "xno"],
AS_IF([test "x$QBT_CXX17_FOUND" = "xno"],
[AC_MSG_CHECKING([if compiler supports C++14])
[AC_MSG_CHECKING([if compiler supports C++17])
CXXFLAGS="-std=c++14"
CXXFLAGS="-std=c++17"
AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()],
AC_COMPILE_IFELSE([DETECT_CPP17_PROGRAM()],
[AC_MSG_RESULT([yes])
[AC_MSG_RESULT([yes])
AC_MSG_CHECKING([if C++14 is disabled by the set compiler flags])
AC_MSG_CHECKING([if C++17 is disabled by the set compiler flags])
# prepend the flag so it won't override conflicting user defined flags
# prepend the flag so it won't override conflicting user defined flags
CXXFLAGS="-std=c++14 $TMP_CXXFLAGS"
CXXFLAGS="-std=c++17 $TMP_CXXFLAGS"
AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()],
AC_COMPILE_IFELSE([DETECT_CPP17_PROGRAM()],
[AC_MSG_RESULT([no])
[AC_MSG_RESULT([no])
QBT_ADD_CONFIG="$QBT_ADD_CONFIG c++14"
QBT_ADD_CONFIG="$QBT_ADD_CONFIG c++17"
AC_MSG_WARN([C++14 mode is now force enabled. The C++ mode should match the mode that other libraries were built with, otherwise you'll likely get linking errors.])],
AC_MSG_WARN([C++17 mode is now force enabled. The C++ mode should match the mode that other libraries were built with, otherwise you'll likely get linking errors.])],
[AC_MSG_RESULT([yes])
[AC_MSG_RESULT([yes])
AC_MSG_ERROR([The compiler supports C++14 but the user or a dependency has explicitly enabled a lower mode.])])],
AC_MSG_ERROR([The compiler supports C++17 but the user or a dependency has explicitly enabled a lower mode.])])],
[AC_MSG_RESULT([no])
[AC_MSG_RESULT([no])
AC_MSG_ERROR([A compiler supporting C++14 is required.])])
AC_MSG_ERROR([A compiler supporting C++17 is required.])])
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.