Commit graph

490 commits

Author SHA1 Message Date
Chocobo1
7276a79cef
Call Windows API directly
We already bumped the OS requirement to Windows 7 and those functions
can be called directly without the need to load them first.
2019-09-29 09:52:13 +08:00
Chocobo1
17e4902519
Don't define variable when not building GUI 2019-09-05 20:40:47 +08:00
Chocobo1
0d5b0b9542
Replace deprecated macro
Q_OS_MAC is deprecated and the replacement is Q_OS_MACOS.
2019-09-05 20:16:18 +08:00
Chocobo1
7e0daf1663
Setup pixmap cache in a proper place
There is no need to reset the cache limit to previous value as
QPixmapCache is an application wide cache.
Also raise the cache size to 64MB.
2019-08-30 14:51:27 +08:00
Chocobo1
47b9d8dbc6
Clean up Application class constructor 2019-08-30 14:51:07 +08:00
Chocobo1
e3483c62ca
Remove explicit conversion to QVariant 2019-08-18 20:00:43 +08:00
Vladimir Golovnev (Glassez)
6bfa4370b7
CMake: Fix Windows build 2019-08-06 21:50:39 +03:00
Chocobo1
25c56d3b66
Make use of Utils::Misc::loadWinAPI 2019-07-31 02:10:22 +08:00
Chocobo1
5c015d573b
Forward declare types as much as possible 2019-07-31 02:10:22 +08:00
Mike Tzou
4f06c091c9
Merge pull request #10949 from Chocobo1/inject
Prevent command injection via "Run external program" function
2019-07-21 12:05:02 +08:00
Chocobo1
a610c8567e
Prevent command injection via "Run external program" function
Closes #10925.
2019-07-20 17:42:09 +08:00
Chocobo1
4a90716843
Add override keyword to functions 2019-07-19 11:58:56 +08:00
Chocobo1
07263d2d70
Move implementation to its own file 2019-07-18 00:30:44 +08:00
Prince Gupta
8267a4fef9 Incorporate GuiIconProvider inside UIThemeManager 2019-07-16 09:31:33 +05:30
Chocobo1
7b568b07e6
Clean up CMakeLists.txt 2019-07-13 19:55:13 +08:00
Prince Gupta
a24925c858 Allow styling with QSS stylesheets 2019-07-09 19:56:55 +05:30
Mike Tzou
4b25f87859
Merge pull request #10874 from Chocobo1/qt
Replace obsoleted Qt functions
2019-07-02 10:57:06 +08:00
Chocobo1
4eff268095
Replace obsoleted QFontMetrics::width()
Qt 5.13 marked QFontMetrics::width() obsolete.
2019-07-01 14:48:53 +08:00
Vladimir Golovnev (Glassez)
c7f3693ad1
Implement "Application instances manager" 2019-06-30 20:02:46 +03:00
Chocobo1
46ee193cd8
Restrict QLocalServer access
The default is world access which means even even unprivileged local
accounts can connect to it too.
2019-06-28 09:40:21 +08:00
Chocobo1
6119cb370f
Drop suspiciously large data
This is to avoid exhausting system memory.
2019-06-27 20:29:02 +08:00
Chocobo1
d0bfe9a661
Adjust open file descriptor limit on startup
This raises qbt's open file descriptor limit to the available maximum
(within user privileges) and thus users don't need to adjust it
manually anymore.
2019-06-26 14:08:43 +08:00
silverqx
4f4f435e76
Add zlib version to GUI & stackdump 2019-06-12 08:02:24 +02:00
Chocobo1
6738cdd715
Constify exception references 2019-05-19 12:06:18 +08:00
sledgehammer999
f403fdb2e8
Remove wrong ifdef 2019-03-17 14:15:50 +02:00
Chocobo1
b7d739ab3f
Fix build error
Apparently the function is not available on Windows platforms.
2019-03-15 14:29:54 +08:00
Chocobo1
874bc84efc
Remove excessive usage of pointer 2019-03-15 14:29:06 +08:00
Chocobo1
a3019f56b0
Clean up code 2019-03-15 14:29:06 +08:00
Vladimir Golovnev
36f6e9b288
Merge pull request #9702 from knackebrot/master
Fix building qbittorrent-nox on Windows
2019-03-13 18:35:44 +03:00
sledgehammer999
c2d1af9853
Merge pull request #10338 from sledgehammer999/raise_qt5_ver
Raise minimum Qt version to 5.9.0
2019-03-08 00:42:26 +02:00
knackebrot
c7b451b18f Allow headless builds on Windows
Daemonizing is disabled because no direct equivalent exists in win32.
2019-03-07 13:59:10 +01: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
Chocobo1
adbd34c795
Move helper functions to Utils::Gui namespace 2019-03-05 14:55:22 +08:00
sledgehammer999
5c63ad3b95
Raise minimum Qt version to 5.9.0 2019-03-04 16:48:49 +02:00
Mike Tzou
4ce3cda676
Merge pull request #10319 from eszlari/patch-1
Linux/Wayland: make window title bar icon work
2019-03-03 12:40:59 +08:00
Mike Tzou
0f1fc7be9d
Merge pull request #10302 from Chocobo1/uptr
Replace QScopedPointer with std::unqiue_ptr
2019-03-02 12:26:14 +08:00
Peter Eszlari
9f250713d2 Linux/Wayland: make window title bar icon work 2019-02-28 22:41:08 +01:00
Mike Tzou
46bc1d12b9
Merge pull request #10314 from thalieht/const2
More const
2019-02-28 11:33:35 +08:00
thalieht
89dce36e98 Use uniform initialization on some default arguments 2019-02-25 17:05:15 +02:00
Chocobo1
e5dca50025
Convert to use private pointer for ui object 2019-02-25 01:22:40 +08:00
Chocobo1
5e3fddf456
Replace QScopedPointer with std::unqiue_ptr
These 2 types are very similar and we should prefer the one from C++
standard library, this reduces the number of types in our code base.

Also see:
https://stackoverflow.com/questions/40346393/should-i-use-qscopedpointer-or-stdunique-ptr#comment67966940_40346991
2019-02-18 16:06:40 +08:00
thalieht
9959a901fe Replace deprecated header 'signal.h' with 'csignal' 2019-02-16 18:54:17 +02:00
thalieht
d8cbc9266a Use 'auto' to avoid duplicating the type name 2019-02-16 18:54:17 +02:00
thalieht
8a3f942385 Don't use 'else' after return/break 2019-02-13 18:23:25 +02:00
Mike Tzou
78ab0e4ba9
Merge pull request #10220 from thalieht/const
Add const to many vars and arguments
2019-02-13 12:11:00 +08: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
52de31ac79
Add migration code for WebUI https related change 2019-01-29 12:52:42 +08:00
Chocobo1
48d358872f
Cleanup header inclusion 2019-01-28 14:34:13 +08:00
Chocobo1
04227f5a41
Add QBT_APP_64BIT define
Now we use QT_POINTER_SIZE to detect CPU bitness, it has the advantage of applicable to all CPU
architectures not limiting to x86 arch.
2019-01-19 10:14:10 +08:00
Chocobo1
6d7e5f82ae
Include the correct header
And remove the unused ones
2019-01-19 10:06:33 +08:00
Chocobo1
cf4db1b418
Remove useless exception handling 2019-01-19 10:06:31 +08:00
sledgehammer999
6b2a382ab8
Merge pull request #10066 from sledgehammer999/drop_migration_code
Drop upgrade code
2019-01-02 21:42:31 +02:00
sledgehammer999
d322e10a83
Merge pull request #10027 from glassez/compile-ts
Compile translations at build time
2018-12-31 11:31:45 +02:00
sledgehammer999
1fff760722
Drop upgrade code 2018-12-31 00:41:17 +02:00
Chocobo1
2a84345835
Mark constructors as explicit 2018-12-26 12:04:40 +08:00
Vladimir Golovnev (Glassez)
7b3eed323b
QMake: Compile translations at build time 2018-12-22 16:02:17 +03:00
Vladimir Golovnev
fc08091765
Merge pull request #9940 from glassez/error-msg
Show error message when Session failed to start
2018-12-09 11:16:17 +03:00
Chocobo1
f13bcbd772
Add OpenSSL version to GUI & stackdump 2018-12-08 12:46:50 +08:00
Mike Tzou
6bb4eb825b
Merge pull request #9942 from Chocobo1/pbkdf2
Do password hashing properly
2018-12-06 16:22:22 +08:00
Vladimir Golovnev (Glassez)
89deccd9b5
Show error message when Session failed to start 2018-12-05 19:57:44 +03:00
Chocobo1
593052dd93
Revise startup message in nox version
Only print the WebUI username when password is still the default.
2018-12-05 13:28:43 +08:00
Chocobo1
05d6a29416
Apply PBKDF2 when storing passwords 2018-12-05 13:28:42 +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
Thomas Piccirello
4885fe6b4c Only instantiate SearchPluginManager as needed 2018-11-21 16:59:38 -05: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
Eugene Shalygin
e590fff2fe cmake: restore out-of-source build
Qt translations have to be compiled in a shared library or executable,
and since we use static libraries for the components, webui translation
files have to be compiled into the main executable.
2018-10-14 11:06:20 +02:00
Chocobo1
79dae55a61
Fix GUI scaling issue on Linux
It seems `QT_AUTO_SCREEN_SCALE_FACTOR` doesn't work as expected.
Closes #6935.
2018-09-05 12:17:30 +08:00
Chocobo1
0217d5b4c0
Replace single-character string with character literal
Also remove unnecessary dynamic allocation.
2018-07-21 23:26:15 +08: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
Mike Tzou
40f4223d02
Merge pull request #9083 from Chocobo1/qrc
Move files to where it belongs
2018-06-18 00:51:19 +08:00
thalieht
d34ddb2e3c Change file names and classes names to match them 2018-06-15 20:12:59 +03:00
thalieht
4022799881 Fix coding style 2018-06-12 07:17:05 +03:00
Chocobo1
5b7c089dd2
Move qm_gen.pri 2018-06-11 21:02:45 +08:00
Chocobo1
26a4703398
Move .qrc files into its own directory 2018-06-11 20:01:33 +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
Chocobo1
4751b79f42
Initialize variables properly
The warnings are emitted when compiling on msys2, mingw

The warning was:
gui/torrentcontentmodel.cpp:135:33: warning: missing initializer for
member '_SHFILEINFOW::iIcon' [-Wmissing-field-initializers]

..\..\qBittorrent\src\app\stacktrace_win.h:141:30: warning: missing
initializer for member '_IMAGEHLP_LINE64::Key'
[-Wmissing-field-initializers]
2018-05-25 21:22:31 +08:00
Mike Tzou
84df2794dc
Merge pull request #8944 from Chocobo1/literal
Make use of QStringLiteral
2018-05-23 13:23:41 +08:00
Mike Tzou
07c15127ba
Merge pull request #8915 from Chocobo1/runext4
Improve "Run External Program" behavior
2018-05-19 14:58:45 +08:00
Chocobo1
ceaf755ac6
Make use of QStringLiteral
Only changed instances that are initialized at program start.
2018-05-18 02:14:49 +08:00
sledgehammer999
e3ce9b2645
Merge pull request #8903 from sledgehammer999/fix_upgrade_artifacts
Delete non-commited fastresume files
2018-05-13 17:24:47 +03:00
sledgehammer999
35eee0b590
Don't migrate torrents that have newer fastresumes 2018-05-13 15:50:10 +03:00
sledgehammer999
7626ebe7a6
Delete non-commited fastresume files
Old v3.3.x format had a number at the end indicating the queue position.
The naming scheme was '<infohash>.fastresume.<queueposition>'.
However, QSaveFile, which uses QTemporaryFile internally, might leave
non-commited files behind eg after a crash. These files have the
naming scheme '<infohash>.fastresume.XXXXXX' where each X is a random
character. We try to detect the latter and remove it without "migrating"
the fastresume to the new saving system.
2018-05-13 15:50:10 +03:00
sledgehammer999
bde736c18a
Merge pull request #8900 from sledgehammer999/fix_delete_logs
Fix deletion of old logs
2018-05-13 15:00:39 +03:00
sledgehammer999
7484889836
Fix deletion of old logs 2018-05-13 12:11:19 +03:00
Chocobo1
263524e856
Improve "Run External Program" behavior
This follows utorrent behavior: they don't append backslash character at
the end of path variables.
Closes #8836.
2018-05-13 15:21:27 +08:00
thalieht
4cfa163bbd Use qt5 syntax for a few remaining SLOT() 2018-05-11 08:19:41 +03:00
thalieht
6b4455e13d Use qt5 connect() syntax 2018-05-09 16:08:22 +03:00
Nick Korotysh
0b8c620fd3
Add missing "override" 2018-05-08 08:33:07 +03:00
Nick Korotysh
7712d0ada0
Allow to disable Stacktrace support
Enable backtrace stuff only if GNU C library used, because current
backtrace implementation based  on  <execinfo.h> , which is not a
part of standard C library, it is a GNU extension.

This will be usefull when building  with  custom POSIX-compilant C
library (like musl) and no <execinfo.h> available.

Note: configure script will detect presence of  <execinfo.h>  and
enable/disable feature depending on it.

Feature is enabled by default.
2018-04-10 20:51:11 +03:00
Chocobo1
b0e3d77975
Add helper for loading Windows system functions 2018-04-09 21:18:04 +08:00
Mike Tzou
e4fc8e4156
Merge pull request #8669 from Chocobo1/runext
Split args manually in runExternalProgram()
2018-04-03 22:19:29 +08:00
Chocobo1
c07cd440cd
Split args manually in runExternalProgram()
Need to split arguments manually because QProcess::startDetached(QString)
will strip off empty parameters.
E.g. `python.exe "1" "" "3"` will become `python.exe "1" "3"`.
Closes #8454.
2018-04-01 18:42:42 +08: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
Mike Tzou
68ca95faf0
Merge pull request #8603 from Chocobo1/typo
Fix typo
2018-03-17 00:49:41 +08:00
Chocobo1
423511765a
Fix typo 2018-03-14 23:37:08 +08:00
Chocobo1
88881de8c6
Add Tags parameter to "Run External Program"
Closes #8586.
Also sort headers.
2018-03-14 10:12:32 +08: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
Chocobo1
c60b7b213e
Add missing 'override' specifier
This fixes clang warning:
'notify' overrides a member function but is not marked 'override'
[-Winconsistent-missing-override]
2018-03-07 20:05:52 +08:00
Vladimir Golovnev
7cb6100c9c
Merge pull request #8471 from luis-pereira/use-qstring-ref
Don't create temporary substrings
2018-02-28 10:44:59 +03:00
Andrei Stepanov
817aadd52d
Fix typo in filelogger.cpp message 2018-02-27 02:00:43 +04:00
Luís Pereira
0e421ae415 Don't create temporary substrings
Avoid temporary string allocations. They are only used to convert to
something else.
QString::xxxRef() returns a QStringRef. QStringRef avoids the memory
allocation and reference counting overhead of a standard QString by simply
referencing a part of the original string.
2018-02-26 11:39:36 +00:00
Luís Pereira
2114817890 Use qEnvironmentVariableIsEmpty
Instead of qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR").isEmpty().
It's faster (don't allocate memory) and don't throw exceptions.
2018-02-19 21:35:23 +00:00
sledgehammer999
e487b31877
Merge pull request #8319 from sledgehammer999/saner_log_settings
Set default file log size to 65 KiB and delete backup logs older than…
2018-01-27 15:26:03 +02:00
sledgehammer999
024df8c53f
Set default file log size to 65 KiB and delete backup logs older than 1 month. 2018-01-27 01:17:50 +02:00
Luís Pereira
5154d431f6 Don't set application name twice
It's an artifact introduced by commit b3c73b7868.
2018-01-25 16:30:11 +00:00
Mike Tzou
11f26bfefd
Merge pull request #7878 from Chocobo1/runExt
Revert "Run external program" function
2017-12-28 21:26:53 +08:00
Chocobo1
22b0ebb5a8
Disable the "?" help button in all dialogs on Windows. Closes #7365. 2017-12-08 12:51:06 +08:00
Chocobo1
76c95d8c6c Revert "Run external program" function
This revert df95efe33e partially
2017-11-25 15:48:29 +08:00
Heiko Becker
af898e9117
Fix build with --disable-webui
"app/application.cpp:108:7: error: class 'Application' does not have
any field named 'm_webui'"
2017-11-23 01:52:38 +02:00
sledgehammer999
81f5fdda15
Correctly check if torrent passed during application start already exists. 2017-11-22 00:42:26 +02:00
Chocobo1
27090f0cfb
Remove superfluous QString::fromUtf8() 2017-11-21 22:48:00 +08:00
sledgehammer999
22add258ae
Merge pull request #7753 from luigino/master
qtsingleapplication should always be built statically to avoid depend…
2017-11-20 22:31:46 +02:00
luigino
32a686a037 qtsingleapplication should always be built statically to avoid dependency problems 2017-11-20 17:23:22 +01:00
sledgehammer999
236abcf3f1
Fix crash on opening torrent/magnet (uninitialized pointer). Closes #7739 #7723. 2017-11-20 17:46:31 +02:00
sledgehammer999
af5a02d971
Merge pull request #7673 from sledgehammer999/webui_clean_exit
WebUI: Correctly exit depending if mainloop is running.
2017-11-19 19:12:30 +02:00
Vladimir Golovnev (Glassez)
71bb6538db
Fix WebUI error handling 2017-11-19 19:10:04 +02:00
Mike Tzou
04cec39277
Merge pull request #7667 from Chocobo1/stackdump
Include & print caught signal in stackdump
2017-11-04 11:10:49 +08:00
Chocobo1
21bc08d643
Include/print caught signal in stackdump 2017-11-03 14:13:17 +08:00
Chocobo1
fc0628d35b
Allow SMTP sender to be set. Closes #7575. 2017-10-26 17:57:32 +08:00
sledgehammer999
50471ec8c8
String fixes and optimizations mentioned by translators on Transifex. 2017-10-24 03:32:56 +03:00
thalieht
0717f0d60c Save ratio limits as int instead of string 2017-10-08 10:22:40 +03:00
Chocobo1
e3da17caa8
Update qtsingleapplication
To upstream version a8dda66d7738cde9042b87db27993f710ae3eeeb
2017-09-23 00:27:00 +08: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
sledgehammer999
08aa827366
Fix some more strings. 2017-08-06 01:47:05 +03:00
Allan Nordhøy
af9c0cca23 display, URLs, esc ' 2017-07-28 02:42:35 +02:00
vit9696
d25467d3e6 Various macOS UI improvements 2017-07-15 20:49:40 +03:00
Eugene Shalygin
c614c66535 Install required plugins into bundle
Install platform and svg plugins into bundle. Update dependencies in
Travis.
2017-07-14 17:42:02 +02:00
Eugene Shalygin
72cb868224 cmake: disable warnings for bundled QtSingleApplication 2017-06-01 10:14:09 +02:00
Eugene Shalygin
74cecb1b6c Replace C-style casts with C++ ones 2017-05-29 17:25:42 +02:00
Chocobo1
712e6a0e5c Refactor out helper function Utils::String::unquote
Remove redundant include
2017-05-25 18:44:35 +08:00
Eugene Shalygin
a18b3bea03 cmake: include searchengine resources 2017-05-16 18:06:56 +02:00
Chocobo1
42c17ea5ce Fix argument name differ in definition & declaration 2017-05-09 14:12:36 +08:00
Eugene Shalygin
5b59b18606 Fix crash when entering daemon mode. Closes #6759.
We stored reference to parameters object in main(), but that object gets
deleted when we reset Application object upon entering daemon mode.
Change reference to copy to fix that.
2017-05-08 18:01:38 +02:00
sledgehammer999
d61fc7e820 Merge pull request #3858 from Chocobo1/screen_center
Fix dialogs didn't position on the correct screen
2017-05-07 22:17:55 +03:00
sledgehammer999
9f98f9f7ac
Rename cmd options source files. 2017-05-07 16:20:18 +03:00
sledgehammer999
1a099fa742
Don't enforce an explicit value for TriState cmd options.
Most code from Brian Kendall <guygizmo@gmail.com> (@briankendall)
2017-05-07 14:47:37 +03:00
Eugene Shalygin
6540dfa528 Fix release CMake build
write() is declared with __attribute__ ((__warn_unused_result__)) and as
such we shall check its return value. Took opportunity and adjusted
error reporting a bit: if writing to stderr fails, try to write to
stdout.
2017-05-03 02:52:10 +02:00
Chocobo1
6f6fe626a1 Fix shutdownconfirm position 2017-05-01 15:32:08 +08:00
Chocobo1
de54fa2c30 Fix addnewtorrentdialog position
Fix messageBox position
2017-05-01 14:48:10 +08:00
sledgehammer999
4ea9a2f07e Merge pull request #5532 from briankendall/torrent_command_line_arguments
Command line arguments for specifying options when adding torrents
2017-04-30 22:25:21 +03:00
Brian Kendall
eba41978b0 Added command line arguments for specifying options when adding torrents
Arguments include adding torrents as paused/started, skiping hash check, setting category, downloading in sequential order, downloading first and last pieces first, and skipping the 'add new torrent' dialog. Added TriStateBoolOption class for specifying options that don't have a default value when unused (e.g. add-paused). Also improved command line usage text to include more information, have better organization, and not exceed 80 columns in width. Also also added firstLastPiecePriority field to BitTorrent::AddTorrentData, and modified TorrentHandle so that if first/last piece priority should be on, it will be toggled on after the torrent's metadata has loaded.
2017-04-30 14:22:30 -04:00
Chocobo1
6bcb07649e Setup DPI at startup 2017-05-01 02:21:44 +08:00
Chocobo1
893ce32f1d Remove curly braces 2017-05-01 00:45:27 +08:00
Chocobo1
a1cad86bbf Remove workaround
Upstream confirmed bug fixed in Qt 5.2
2017-05-01 00:45:09 +08:00
Chocobo1
b3c73b7868 Refactor 2017-05-01 00:37:47 +08:00
Eugene Shalygin
71cf25ae99 Replace variable length array with std::vector in print_stacktrace()
The function does memory allocation from heap anyway, so should not be
a problem to use STL container.
2017-04-27 14:32:02 +02:00
sledgehammer999
74fb070e78 Merge pull request #6693 from glassez/drop-qt4
Drop rest of qt4 support code
2017-04-26 15:12:55 +03:00
Vladimir Golovnev (Glassez)
335443e6a0 Drop QThread::msleep wrapper 2017-04-26 10:44:47 +03:00
sledgehammer999
f53dab8ad4
Output log messages for ip filter parsing errors. 2017-04-25 04:43:29 +03:00
Vladimir Golovnev (Glassez)
989a70fe60 Redesign RSS subsystem 2017-04-23 09:03:46 +03:00
Eugene Shalygin
f99ba03177 cmake: fix typo in the manifest file name 2017-04-19 17:06:44 +02:00
Eugene Shalygin
21a72c651f Start up torrents after UI was created. Fixes #6454.
Commit dd0537d changed torrents startup code adding alerts processing
into it. Therefore alerts were processed before UI code subscribed to
signals and therefore part of alerts was not reflected in the UI.

Thus here we do not start torrents in Session constructor, but do that
from Application::exec() after UI was constructed and is ready to process
signals.
2017-04-14 00:58:43 +02:00
Eugene Shalygin
a8d95dd8bd Save relative paths in fastresume files
Conditionally change absolute paths to relative in the fastresume data files.
The condition is specified by user via a command line parameter and
paths are relative to the profile dir.

On Windows the convertion to relative path is performed if the path and
the profile are on the same drive only.
2017-04-12 00:51:37 +02:00
Eugene Shalygin
0710a59bf5 Refactor parameters parsing
Introduce classes that encapsulate parameter names and parsing schemes
from command line and from environment variables.
2017-04-12 00:50:33 +02:00
Eugene Shalygin
0bf7fa15c1 Replace wrappers in base/utils/fs.h with Profile::SpecialFolders::location() 2017-04-12 00:50:33 +02:00
Eugene Shalygin
44b6cb28f6 Add environment variables usage description to the help text 2017-04-12 00:50:33 +02:00
Eugene Shalygin
d5414631c3 Initialise QBtCommandLineParameters members from environment
This allows to pass options via environment variables. The variable name
is constructed from parameter name by transforming the name to upper
case and prefixing "QBT_".
2017-04-12 00:50:33 +02:00
Eugene Shalygin
0f746ffd5a Add support for different configurations. Partially closes #465
It may be useful to have different configurations either for portable
versions or for debugging purposes. To implement this we add two
options, avaliable via command line switches
1. An option to change configuration name ("--configuration"). The name
supplied via this option is appended to
QCoreApplication::applicationName() to form "qBittorrent_<conf_name>"
name for the configuration files.
2. An option to provide a path do directory where all the settings are
stored (kind of profile directory). There is a shortcut "--portable"
which means "use directory 'profile' near the executable location".

In order to implement that we have to perform initialisation of the
profile directories before the SettingStorage and Preferences singletones
are initialised. Thus, options parsing shall be performed without defaults
read from preferences.
2017-04-12 00:50:28 +02:00
Eugene Shalygin
b2ff058bc0 cmake: fix OSX bundle creation 2017-03-20 19:47:21 +01:00
Eugene Shalygin
5c0bf86405 cmake: remove qt4 leftover 2017-03-20 19:07:52 +01:00
sledgehammer999
bc910798da
Indicate bitness in stackstrace and about dialog. Closes #6172. 2017-03-08 01:01:17 +02:00
sledgehammer999
147f4d76e2 Merge pull request #6445 from Chocobo1/fix
Follow http user-agent format
2017-03-07 23:38:14 +02:00
sledgehammer999
7a6da3d3ce
Merge pull request #6479 from Chocobo1/qt4
Remove remainings of Qt4
2017-03-07 23:28:56 +02:00
sledgehammer999
b69b6d1f55
Revert "Set default locale". Closes #6436 and #6459.
This reverts commit 75ef6356d3.
2017-03-07 15:35:42 +02:00
Chocobo1
ffdcfe9686 Replace Utils::String::toStdString() by QString::toStdString() 2017-03-06 23:58:38 +08:00
Chocobo1
cb1646be32 Prepend QBT_ for preprocessor variables 2017-03-06 13:41:58 +08:00
Eugene Shalygin
e64bb1de8c Drop Qt 4 support 2017-03-05 22:24:59 +01:00
Chocobo1
7da29f7654 Embed manifest when compiling with MSVC
Update manifest
2017-03-04 13:09:32 +08:00
Chocobo1
511796f74e Replace rand() by a true uniform distribution generator 2017-02-16 12:21:26 +08:00
Tim Delaney
cecff159a0 Move old RSS items to separate config file. Closes #6167.
--HG--
branch : magao-dev
2016-11-06 12:00:09 +11:00
sledgehammer999
1376d8fa7b Merge pull request #6084 from Chocobo1/set_locale
Set default locale
2017-01-20 20:14:20 +02:00
sledgehammer999
f1942bc0e0 Merge pull request #6104 from okeatime/mac_nox
Build qbittorrent-nox for macOS
2017-01-19 15:49:47 +02:00
Chocobo1
75ef6356d3 Set default locale 2017-01-19 13:33:34 +08:00
Chocobo1
e37a696e7d Refactor
Move default value to preference class
Rename variable
Reorder headers
Remove extra parentheses
2017-01-19 13:33:34 +08:00
sledgehammer999
ba03fb30f3 Merge pull request #5987 from Chocobo1/temp_dir
Put temp files in .qBittorrent directory
2017-01-19 01:33:57 +02:00
Oke Atime
5f767b96f6 Build qbittorrent-nox for macOS 2016-12-22 23:23:21 +09:00
Eugene Shalygin
05dbea390b Print warning to the user if stacktrace contains no function names
Count matched function names, and if there are no, point out to the user
that the stacktrace is useless. If not all stactrace elements contain
function names, suggest user that installing debug packages may improve
the stacktrace usefulness.
2016-12-17 17:46:05 +01:00
Eugene Shalygin
514de7edc4 Follow project coding style. Issue #2192. 2016-12-17 17:29:43 +01:00
sledgehammer999
b2827702e5 Correctly migrate settings/rss/usage stats in macOS. Closes #6041. 2016-12-14 17:51:49 +02:00
sledgehammer999
d88ec48468 Polish previous commit. 2016-12-11 23:24:55 +02:00
sledgehammer999
5a006d5980 Merge pull request #5810 from ghost/macOSpref
Change QSettings to IniFormat on macOS. Closes #5770 #5808
2016-12-11 23:23:22 +02:00
Chocobo1
cffa729ac5 Put temp files in .qBittorrent directory. Closes #4462. 2016-12-01 01:39:27 +08:00
Yez Ezey
55916df97d Set /usr/local/bin before default PATH on macOS. closes #5639 #5571
Since Apple made difficult for users to set PATH and /usr/bin/python
is almost unusable, I simply add /usr/local/bin before default PATH
to pick up Homebrew Python.
2016-11-07 13:29:55 +09:00
sledgehammer999
146d4e049a Some more compiler warnings fixed. 2016-11-02 17:49:50 +02:00
sledgehammer999
124eddc68c Merge pull request #5342 from glassez/session
Optimize BitTorrent::Session settings applying
2016-11-01 03:02:29 +02:00
Yez Ezey
26052802ca Change QSettings to IniFormat on macOS. Closes #5770 #5808
On macOS 10.12 Sierra, Apple changed the behaviour of CFPreferencesSetValue()
truncating data after a null character. https://bugreports.qt.io/browse/QTBUG-56344
Due to this, we have to move from native plist to IniFormat.
2016-10-08 14:05:30 +09:00
Chocobo1
f448587271 Add function windowsSystemPath() 2016-07-23 13:39:13 +08:00
Chocobo1
1e1471c7c6 Workaround space issues in file path
References:
https://github.com/qbittorrent/qBittorrent/issues/5439#issuecomment-228616817
https://github.com/qbittorrent/qBittorrent/issues/5439#issuecomment-232214712
2016-07-16 11:27:51 +08:00
Chocobo1
3846a5b875 Invoke system's cmd.exe directly. 2016-07-16 11:19:33 +08:00
Chocobo1
705d7730dc Fix upper-bound limit of command line for "Run External Program" in Windows. Closes #5399. 2016-07-16 10:25:22 +08:00
Vladimir Golovnev (Glassez)
b5fe749f0b Use new libtorrent-1.1 settings API 2016-06-20 08:30:02 +03:00
Vladimir Golovnev (Glassez)
b2cb473b63 Don't use Preferences in BitTorrent::Session 2016-06-20 08:30:02 +03:00
Chocobo1
df95efe33e Improve usability of "Run External Program"
Users can write (platform dependent) shell scripts now.
2016-06-07 00:39:27 +08:00
Chocobo1
def27bce4d Add log messages 2016-06-04 11:28:44 +08:00
sledgehammer999
8e64ffba01 Merge pull request #4937 from Chocobo1/option_crash
Fix crash when qbt exits with options dialog opened
2016-05-30 19:36:16 -05:00
sledgehammer999
fed2609cb2 Merge pull request #4888 from SeigneurSerpent/source_line
Stack trace for windows now contains source filenames and line numbers
2016-05-23 16:49:17 -05:00
SeigneurSerpent
7398e7f0ad Improve stack trace for windows by including source filenames and line numbers 2016-05-23 22:37:24 +03:00
sledgehammer999
ef6e848756 Display notifications when a torrent is added. Closes #334 and #915. 2016-04-25 20:07:26 +03:00
Chocobo1
34db2f5dd9 Fix qBittorrent doesn't exit immediately when "all donwloads are done -> exit" option enabled.
This fix is provided by glassez.
2016-04-18 00:46:47 +08:00
Chocobo1
fbc002f212 Enable access to shutdown functions when configured with --disable-gui option 2016-04-18 00:45:37 +08:00
Chocobo1
a1e0fa5509 Fix Coverity Scan 143909.
Also, the setting "Confirmation on auto-exit when downloads finish" wasn't working before.
2016-04-18 00:35:08 +08:00
sledgehammer999
2d0b9e6538 Merge pull request #5111 from Chocobo1/refactor_shutdowndlg
Cleanup shutdowndlg
2016-04-17 11:23:07 -05:00
Chocobo1
e2a090f03f Use QAtomicInt to guarantee cleanup() is only executed once 2016-04-17 18:48:22 +08:00
Eugene Shalygin
7c0b5818b1 cmake: add imported target for QtSingleApplication
This simplifies cmake code a bit: we remove if's and just generate
different target (imported or alias) with the same name and use it
unconditionally.
2016-04-17 01:07:15 +02:00
Eugene Shalygin
f050f15a0c cmake: fix Qt resources linkage. Closes #5080
Qt resource is innitialized by a static object constructor (see
https://wiki.qt.io/QtResources). When we put resources into a static
library, the linker removes that static objects and thus the resources
themselves. To correct that we append resources to the main executable
sources list. This is done via custom function qbt_target_sources which
knows where to read the executable' name.
2016-04-17 01:06:24 +02:00
Chocobo1
f12e21560a Rename files:
confirmshutdowndlg.ui => shutdownconfirmdlg.ui
shutdownconfirm.cpp => shutdownconfirmdlg.cpp
2016-04-14 14:50:59 +08:00
Chocobo1
6a11056b60 Rename enum
Change identifier from ShutdownAction to ShutdownDialogAction
Change enum value from None to Exit
2016-04-14 14:50:59 +08:00
Eugene Shalygin
1d6a1db491 cmake: make it compile on OS X 2016-03-28 19:59:11 +02:00
Eugene Shalygin
1e9bbce249 cmake: fix compilation 2016-03-28 19:44:59 +02:00
sledgehammer999
c2b6e1ce1a Fix periodic latency spikes on Windows with WiFi connections. Closes #4209. 2016-03-27 22:53:40 +03:00
sledgehammer999
18ee87f586 Fix previous commit. 2016-03-27 22:26:00 +03:00
sledgehammer999
2b8327c807 Merge pull request #4218 from d3faultdotxbe/master
Add 'never show again' checkbox/pref to auto-exit confirm dialog
2016-03-27 14:24:50 -05:00
sledgehammer999
d721939d5f Use SettingsStorage instead. 2016-03-26 01:50:13 +02:00
sledgehammer999
1058572c8a Implement file logger. 2016-03-26 01:39:13 +02:00
sledgehammer999
15ec515872 Merge pull request #4877 from evsh/cmake
add basic cmake support
2016-03-04 17:30:08 -06:00
sledgehammer999
56605cd0c3 Merge pull request #4865 from Chocobo1/os_name
Shorten crash report on windows
2016-03-04 17:27:48 -06:00
Vladimir Golovnev (Glassez)
dd34663224 Implement Advanced Saving Management subsystem
Closes #4696
2016-03-04 19:59:53 +03:00
Vladimir Golovnev (Glassez)
d05d5a85a5 Move Preferences backend code into SettingsStorage class
Closes #4764
2016-03-04 08:39:00 +03:00
Eugene Shalygin
64daecb266 add basic cmake support 2016-02-29 12:53:43 +01:00
Chocobo1
d0e31adaf7 Create helper function to get libtorrent version 2016-02-28 17:47:43 +08:00
Chocobo1
12627bbc10 Create helper function to get boost version 2016-02-28 17:47:42 +08:00
Chocobo1
498f5e3877 Create helper function to get OS name 2016-02-28 13:23:06 +08:00
Chocobo1
7b2fab411c Comment out "List of linked Modules" section in windows crash report.
It is bloating the crash report with unhelpful messages.
2016-02-27 05:42:48 +08:00
sledgehammer999
cd85d00b3b Merge pull request #4251 from Chocobo1/200_scaling
Fix incorrectly displayed UI elements on Windows
2016-02-16 15:12:54 -06:00
Chocobo1
aa246f0ca8 Let OS handle DPI scaling for now. Should let Qt do the work when it's more mature.
Opt-in to the high DPI pixmap support
Closes #2963.
2016-02-16 11:39:25 +08:00
Chocobo1
e35a7ef9d3 Move statusbar styelsheet to where it belongs 2016-02-16 11:39:23 +08:00
sledgehammer999
f37aed868e Merge pull request #4744 from Chocobo1/splash_scrn
Fix potential race condition in showSplashScreen()
2016-02-09 09:50:22 -06:00
sledgehammer999
958b70e4ac Merge pull request #4403 from glassez/fastresume
Improve .fastresume saving and torrents starting up. Closes #4315.
2016-02-05 12:06:58 -06:00
Chocobo1
48d2beece5 Fix potential race condition. Closes #4742. 2016-02-04 00:39:10 +08:00
Vladimir Golovnev (Glassez)
057cbed204 Fix upgrade corrupted fastresume file 2016-02-01 09:20:28 +03:00
sledgehammer999
193913129f Merge pull request #4360 from Chocobo1/signal_fix
Simplify signal handler
2016-01-28 16:08:49 -06:00
sledgehammer999
0d32b9a692 Fix splash screen staying on top of all windows. Closes #1391. 2016-01-25 15:59:20 +02:00
Chocobo1
4a3d9029d1 Add #include guard 2016-01-22 01:36:11 +08:00
Chocobo1
ef75ae4aee Try to concat most of the string at compile time
The lesser unsafe code in signal handler the better
Add license
2016-01-22 01:36:11 +08:00
Chocobo1
5c8a4b3912 Simplify signal handler
Try to use signal-safe functions as much as possible
Closes #3995
Define sys_signame[] ourselves on linux
2016-01-22 01:36:11 +08:00
Vladimir Golovnev (qlassez)
a5780dd66c Switch to using previous fastresume file names 2016-01-16 14:36:56 +03:00
Boris Nagaev
4706733846 convert includes like <Windows.h> to lowercase
There is header file windows.h, not Windows.h.
MinGW on Linux build machine is filename case-sensitive.
2016-01-05 23:29:26 +03:00
sledgehammer999
52d08f7112 Merge pull request #4413 from glassez/dlmgr
Improve Download Manager. Closes #4305
2016-01-05 10:10:08 -06:00
Vladimir Golovnev (qlassez)
12c151eb69 Save RSS cookies to common cookie storage
Closes #4305
2016-01-04 05:45:30 +03:00