Commit graph

201 commits

Author SHA1 Message Date
Chocobo1
e90a2c00a5
Replace QList by QVector 2019-08-05 20:56:15 +08:00
Chocobo1
7ab3479a34
Replace static_cast by qOverload 2019-07-26 22:32:18 +08:00
Prince Gupta
8267a4fef9 Incorporate GuiIconProvider inside UIThemeManager 2019-07-16 09:31:33 +05:30
Chocobo1
032883e278
Move LineEdit files out of subfolder 2019-07-13 19:46:53 +08:00
Chocobo1
cc663746eb
Forward declare some classes 2019-07-13 19:38:37 +08:00
Chocobo1
599bfc0735
Use Qt object ownership to handle QShortcut deletions 2019-07-13 13:24:27 +08:00
Chocobo1
da2bfd2457
Replace QList by QVector 2019-06-26 20:30:07 +08:00
Chocobo1
5b9b5ce577
Remove buttons from search widget
These buttons are replaced by right-click menu actions.
2019-06-26 20:30:07 +08:00
Chocobo1
4f5302adf8
Add more copy field actions to search widget
Closes #10250.
2019-06-26 20:30:07 +08:00
Chocobo1
26ff9150a2
Rename label in search widget 2019-06-26 10:52:13 +08:00
Chocobo1
32a861fd1b
Add right click menu to SearchJobWidget 2019-06-25 16:12:51 +08:00
Chocobo1
412e326cf2
Avoid allocating a new menu/action manually 2019-06-24 11:02:35 +08:00
Chocobo1
88c3ffbef8
Avoid creating unnecessary event loops
This is part 2.
2019-06-20 11:42:54 +08:00
Mike Tzou
cfd02a4355
Merge pull request #10786 from Chocobo1/dialog
Avoid creating unnecessary event loops
2019-06-19 11:02:09 +08:00
Vladimir Golovnev (Glassez)
8e65317d61
Rename "fromNativePath" to "toUniformPath"
Unlike "toNativePath" which name clearly reflects the function result
"fromNativePath" has no such clear meaning.
Since this function converts path into uniform format "toUniformPath"
is better name.
2019-06-17 15:55:49 +03:00
Chocobo1
3748b995ff
Avoid creating unnecessary event loops
The `exec()` method will create another event loop and transfer
control over there which might introduce unexpected bugs.
2019-06-17 20:44:57 +08:00
Mike Tzou
370544764e
Merge pull request #10750 from Chocobo1/modal
Fix unable to control add torrent dialogs when opened simultaneously
2019-06-06 23:16:35 +08:00
Chocobo1
014273d7ec
Drop support for "BC Link" format
Fixup 19d6de795c.
2019-06-05 00:42:46 +08:00
thalieht
9995967fbf Remove some unused #include 2019-06-04 17:48:55 +03:00
thalieht
4370a7eb12 Forward declare in a few places 2019-06-04 17:48:55 +03:00
thalieht
3731a3ea65 Make num enter key work the same as return in searchjobwidget 2019-03-22 20:01:48 +02:00
Vladimir Golovnev
928ce940c9
Merge pull request #10346 from glassez/download-manager
Improve "Download manager"
2019-03-10 09:13:07 +03:00
Vladimir Golovnev (Glassez)
746916a963
Use DownloadHandler behind the scenes 2019-03-08 13:00:37 +03:00
Mike Tzou
ccd8f3e0f1
Merge pull request #10340 from Chocobo1/move
Move helper functions to Utils::Gui namespace
2019-03-07 15:11:58 +08:00
paolo-sz
1ea7907e09 Add default tooltip "Searching..." on tab creation. 2019-03-05 20:36:49 +01:00
paolo-sz
22835c0350 Avoid crashes on torrent search
qbittorrent closes itself without any error message when a search tab
should be notified of a status change: fixed bad pointer variable catch
in lambda code.
2019-03-05 20:36:49 +01:00
Vladimir Golovnev (Glassez)
6cb15706f5
Reduce number of DownloadManager signals 2019-03-05 11:28:29 +03:00
Chocobo1
adbd34c795
Move helper functions to Utils::Gui namespace 2019-03-05 14:55:22 +08:00
Chocobo1
3dd969df64
Replace deprecated QSignalMapper class 2019-02-28 12:03:08 +08:00
thalieht
89dce36e98 Use uniform initialization on some default arguments 2019-02-25 17:05:15 +02:00
thalieht
70f1537d9f Add const to almost all remaining vars and arguments that qualify 2019-02-25 17:05:15 +02:00
thalieht
8c944bd4e1 Avoid repeating the return type 2019-02-16 18:54:18 +02:00
thalieht
d8cbc9266a Use 'auto' to avoid duplicating the type name 2019-02-16 18:54:17 +02:00
thalieht
445adb0ab4 Convert pass-by-value arguments to const refs where applicable 2019-02-12 02:45:55 +02:00
thalieht
ca3ce87e06 Add const to many vars and arguments
Also remove const in declarations' arguments that are passed by value
2019-02-11 20:19:41 +02:00
Chocobo1
2b903fc3d1
Move Utils::Misc::isUrl() function
All usage of this function gets to call Net::DownloadManager eventually.
2018-12-31 20:00:15 +08:00
Mike Tzou
0ab5b8fcba
Merge pull request #9824 from thalieht/style
Convert all foreach() to range-based for()
2018-12-06 16:19:17 +08:00
Chocobo1
0ad831e48a
Fix strings not translated
Closes #9934.
2018-12-01 20:32:34 +08:00
thalieht
1f36b8b89f Combine qAsConst() with copyAsConst() to asConst() 2018-11-28 23:41:23 +02:00
thalieht
6b1d26d555 Convert all foreach() to range-based for() 2018-11-28 23:40:12 +02:00
thalieht
d668a4fe6d Fix coding style for various things 2018-11-28 23:37:35 +02:00
thalieht
59fcfdc13b Allow resizing search filter in search job
Allow qBt to resize the search filter in search job because it causes
qBt's width to exceed the screen's width for laptop users.
2018-11-13 11:20:29 +02:00
Vladimir Golovnev
dea6b3d7e0
Merge pull request #9562 from dzmat/round_speed_labels
Improve scaling of speed graphs
2018-11-01 09:46:26 +03:00
Vladimir Golovnev
7e36cc746f
Merge pull request #8584 from Piccirello/new-search-api-2
WebUI search API. Closes #2495
2018-10-24 13:13:16 +03:00
dzmat
fabd7e34f5 Improve scaling of speed graphs
Make Y axis scale to fix on predetermined nice looking positions
2018-10-21 16:45:32 +07:00
Thomas Piccirello
0b6ae68801 Add WebUI search API controller
Closes #2495.
2018-09-30 20:07:27 -04:00
Vladimir Golovnev
5e35335ad4
Merge pull request #9254 from thalieht/searchStuff
Add a shortcut to download selected torrents from search job
2018-09-10 07:19:02 +03:00
thalieht
94613c2fa2 Fix some warnings 2018-09-07 19:40:08 +03:00
thalieht
ce3e68670d Refactor in searchjob to always color visited entries
Now it colors multiple entries, when visited at once, via the hotkey or
the Download button.
2018-08-31 15:57:07 +03:00
thalieht
4dcb0b922e Add regex option in the search filter's context menu
In the search job widget.
2018-08-14 13:38:34 +03:00
sledgehammer999
6c9a4df515
Merge pull request #8538 from thalieht/searchFilter
Add a name filter for search results
2018-08-12 16:44:53 +03:00
thalieht
c55daeec38 Set "enter" as shortcut to download the selected torrents in search job 2018-07-29 21:42:21 +03:00
thalieht
ae03ecea21 Add hotkey for toggling focus between the search LineEdits 2018-07-14 09:26:24 +03:00
thalieht
df9aa6dc36 Add a name filter for search results
Closes #8226
2018-07-14 09:26:24 +03:00
Thomas Piccirello
b2ffd6e03b Instantiate SearchPluginManager with other application components 2018-07-11 20:11:33 -04:00
sledgehammer999
de8050701d
Revert email address changes in copyright notices 2018-07-10 00:37:44 +03:00
thalieht
456270bbb1 Delete several unused #include 2018-07-03 08:38:32 +03:00
thalieht
eb508d67ef Fix coding style 2018-07-03 08:38:32 +03:00
thalieht
6d4434ad66 Convert the names used in ui and c++ files from snake_case to camelCase 2018-07-03 08:38:32 +03:00
Vladimir Golovnev
b0afa33e22
Merge pull request #9125 from glassez/downloader
Implement "Sequential downloading" feature. Closes #6835
2018-07-02 15:24:58 +03:00
Vladimir Golovnev (Glassez)
112a9bcfa2
Use new DownloadManager interface 2018-06-29 15:48:17 +03:00
Chocobo1
3e6c8a05dd
Reduce queries to python version
Instead of doing at least 2 queries for python infos, now requires only
1 query (in ideal condition), and the result is cached.
2018-06-24 19:41:44 +08:00
Chocobo1
51e82762c5
Move related functions to Utils::Python 2018-06-24 06:21:15 +08:00
thalieht
d34ddb2e3c Change file names and classes names to match them 2018-06-15 20:12:59 +03:00
Mike Tzou
da87c2d9ae
Merge pull request #9060 from Chocobo1/preinc
Replace post-increment with pre-increment
2018-06-09 12:40:30 +08:00
Chocobo1
5ddbf9bba9
Replace post-increment with pre-increment
And post-decrement with pre-decrement.
2018-06-08 08:44:06 +08:00
Eugene Shalygin
04aea413ba
Merge pull request #9055 from zeule/cmake
Update CMake build scripts
2018-06-07 21:31:09 +02:00
Eugene Shalygin
fa770871e9 Refactor CMake build scripts
1. Use FeatureSummary module to show configuration results.

2. Invert option()/find_package() relationship: instead of
calling find_package(... REQUIRED) when option is set, rely on optional
find package call and PackageName_FOUND variable.

3. Refactor handling options that result in simple preprocessor defines
(actually copy the snippet from libtorrent) so that everything is done
in a single function call.

4. Populate target properties in order to get rid of
include_directories() calls.
2018-06-05 11:39:11 +02:00
Vladimir Golovnev
e61c882fee
Merge pull request #9015 from thalieht/style
Fix coding style
2018-06-03 14:48:04 +03:00
thalieht
356d6a6589 Fix coding style 2018-05-31 19:45:09 +03:00
Chocobo1
09f759355f
Replace QRegExp with QRegularExpression
Revise `static` keyword usage, static is added to frequently used
instances.
2018-05-31 22:56:49 +08:00
Chocobo1
c22e6b4502
Cleanup header include order
Add missing header.
Cleanup license.
2018-05-31 22:56:25 +08:00
thalieht
6b4455e13d Use qt5 connect() syntax 2018-05-09 16:08:22 +03:00
thalieht
3e4099fe5b Replace the zeroing of pointers with nullptr 2018-04-15 13:06:31 +03:00
Chocobo1
37ea01bd44
Use lightweight printf instead of iostream
Using iostream usually adds a lot of other operators (<<, endl), whereas
*printf takes only 1 function call.

Also use qUtf8Printable whenever possible.
2018-03-31 03:21:53 +08:00
Vladimir Golovnev
a5294e1e08
Merge pull request #8558 from luis-pereira/containter-anti-pattern
Don't create temporary containers just to iterate over them
2018-03-19 13:06:01 +03:00
Luís Pereira
ac42ccb5e4
Don't create temporary containers just to iterate over them
Stops temporary containers being created needlessly due to API misuse.
For example, it’s common for developers to assume QHash::values() and
QHash::keys() are free and abuse them, failing to realize their
implementation internally actually iterates the whole container, allocates
memory, and fills a new QList.

Added a removeIf generic algorithm, similar to std ones. We can't use std
algorithms with Qt dictionaries because Qt iterators have different
behavior from the std ones.

Found using clazy.
2018-03-18 16:22:12 +03:00
Chocobo1
423511765a
Fix typo 2018-03-14 23:37:08 +08:00
Thomas Piccirello
7278625f53 Calculate supported categories based on selected plugin 2018-03-12 01:33:45 -04:00
Chocobo1
0457fd260e
Avoid temporary QString allocations
This fixes clazy warning: Use multi-arg instead [-Wclazy-qstring-arg]
2018-03-07 20:06:00 +08:00
Vladimir Golovnev (Glassez)
279bce2014
Make SearchManager singleton 2018-02-23 20:26:32 +03:00
Vladimir Golovnev (Glassez)
f3d370870d
Improve Search handling
Legacy SearchEngine class really has three roles:
  1. Manage search plugins,
  2. Handle the search job, and
  3. Handle the download of the torrent file using the search plugin.
Now it is splitted into 3 classes: SearchManager, SearchHandler and
SearchDownloadHandler.
Search GUI is also improved.
2018-02-23 20:15:25 +03:00
Tom Piccirello
e6a1b72354 Only add search separators as needed 2018-01-16 00:22:51 -05:00
Chocobo1
fb698896c9
Fix translation context.
Partially addresses #8220.

Also sort include headers
2018-01-07 23:01:22 +08:00
Chocobo1
c2c0dd2717
Fix column size too narrow on resize
Instead of giving a value, just resize to the content size
2017-12-24 21:54:56 +08:00
Chocobo1
27cf98a962
Resize dialog size on high DPI monitors 2017-12-24 21:54:56 +08:00
sledgehammer999
99abc21dab
Simplify sorting code. 2017-12-21 15:26:38 +02:00
Chocobo1
86c5a8df75
Partial revert eac8838dc2. Fixes #7952.
mapFromSource() didn't work as expected, when used in lessThan(), it sometimes
returns an invalid QModelIndex.
A crash is observed when filtering source model via filterAcceptsRow() in #7952,
the crash is due to endless recursive of filterAcceptsRow() & lessThan() calling
each other and mapFromSource() is the culprit of it.
2017-12-04 17:40:44 +08:00
Mike Tzou
eac8838dc2
[GUI] Implement stable sort (#7703)
* NaturalCompare now returns compare result instead of "less than" result
* Change to stable sort in GUI components
* Add Utils::String::naturalLessThan() helper function
* Use Qt::CaseSensitivity type
2017-11-30 17:10:30 +08:00
Nick Korotysh
4c8dd0ca9d allow search plugins sorting. closes #7526 2017-10-03 16:57:09 +03:00
sledgehammer999
8d913d77dd Merge pull request #7266 from Chocobo1/coverity
Fix issues found by coverity scan
2017-08-13 20:10:04 +03:00
Vladimir Golovnev (qlassez)
cff6a64e9f
Use qUtf8Printable() for logging strings
qDebug(), qInfo(), qWarning(), qCritical(), qFatal() expect %s arguments
to be UTF-8 encoded, while qPrintable() converts to local 8-bit encoding.
Therefore qUtf8Printable() should be used for logging strings instead of
qPrintable().
2017-08-13 16:14:57 +03:00
Chocobo1
91b2b14ba5
Initialize variables
Remove unused variable
2017-08-13 15:28:36 +08:00
Chocobo1
24a69a9fe7 Fix crash when exiting qbt with search plugin dialog open
Avoid emitting signal in destructor
2017-07-20 13:26:36 +08:00
vit9696
d25467d3e6 Various macOS UI improvements 2017-07-15 20:49:40 +03:00
Eugene Shalygin
a22d2f0139 Implement enum support in CachedSettingValue
Enums are stored as strings, that improves configuration file
readability and maintainability. String values are obtained via
QMetaEnum, and since with Qt 5.5 QMetaEnum::fromType() includes a
static_assert, this has to be a safe method.
2017-07-05 12:41:58 +02:00
Eugene Shalygin
62be2d7400 cmake: fix build 2017-07-03 10:36:42 +02:00
sledgehammer999
a77e1c9f36
Use qt5 connect style for searchengine, pluginselectdlg and searchwidget. 2017-06-22 18:54:30 +03:00
sledgehammer999
dee0b63cc5
Aggregate installed/updated plugin names and use a single messagebox to inform the user. 2017-06-22 18:54:29 +03:00
sledgehammer999
c2a2d306da
Use alternative method for plugin favicon validity. Drop unnecessary code. 2017-06-22 18:54:28 +03:00