Commit graph

5424 commits

Author SHA1 Message Date
Gabriele
4ff999d1c5 Change background color of rows of torrent content 2014-11-09 00:25:40 +01:00
Gabriele
c9db08f0f4 Change background color of filterlist on hover 2014-11-09 00:25:40 +01:00
Gabriele
59abcc554d Remove "Downloaded" from transferlist header and reduce column width 2014-11-09 00:25:40 +01:00
Gabriele
863dc71100 Focus username input on load 2014-11-09 00:25:40 +01:00
Gabriele
0bfad7dce6 Add type attribute to style tag 2014-11-09 00:25:40 +01:00
Gabriele
5e77d99a5e Add alt attribute to images 2014-11-09 00:25:40 +01:00
Gabriele
b2e86bae7e Remove extra double quotes 2014-11-09 00:25:34 +01:00
sledgehammer999
f5c93e0b4d Merge pull request #2129 from glassez/webui
WebUI Fixes
2014-11-09 01:21:00 +02:00
Ivan Sorokin
c37e5abeff Fix torrent removal. Closes #2132
It was reported that qbittorrent crashes on Mac OS X when user deletes
torrents from label view when label filter is active.

The callstack of the crash is the following:

1   abort + 129
2   __assert_rtn + 321
3   QTorrentHandle::total_size() const + 124
4   TorrentModelItem::data(int, int) const + 307
5   TorrentModel::data(QModelIndex const&, int) const + 255
6   QSortFilterProxyModel::data(QModelIndex const&, int) const + 109
7   QSortFilterProxyModel::data(QModelIndex const&, int) const + 109
8   QSortFilterProxyModel::data(QModelIndex const&, int) const + 109
9   QItemDelegate::rect(QStyleOptionViewItem const&, QModelIndex const&, int) const + 75
10  QItemDelegate::sizeHint(QStyleOptionViewItem const&, QModelIndex const&) const + 172
11  TransferListDelegate::sizeHint(QStyleOptionViewItem const&, QModelIndex const&) const + 14
12  QTreeView::indexRowSizeHint(QModelIndex const&) const + 887
13  QTreeViewPrivate::layout(int, bool, bool) + 462
14  QTreeView::doItemsLayout() + 356
15  QTreeViewPrivate::updateScrollBars() + 109
16  QTreeView::scrollTo(QModelIndex const&, QAbstractItemView::ScrollHint) + 124
17  TransferListWidget::currentChanged(QModelIndex const&, QModelIndex const&) + 548
18  TransferListWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 641
19  QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2196
20  QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(QModelIndex const&, int, int) + 3729
21  QItemSelectionModel::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 398
22  QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2196
23  QAbstractItemModel::rowsAboutToBeRemoved(QModelIndex const&, int, int) + 78
24  QAbstractItemModel::beginRemoveRows(QModelIndex const&, int, int) + 106
25  QSortFilterProxyModelPrivate::remove_proxy_interval(QVector<int>&, QVector<int>&, int, int, QModelIndex const&, Qt::Orientation, bool) + 58
26  QSortFilterProxyModelPrivate::remove_source_items(QVector<int>&, QVector<int>&, QVector<int> const&, QModelIndex const&, Qt::Orientation, bool) + 265
27  QSortFilterProxyModelPrivate::source_items_about_to_be_removed(QModelIndex const&, int, int, Qt::Orientation) + 232
28  QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2196
29  QAbstractItemModel::rowsAboutToBeRemoved(QModelIndex const&, int, int) + 78
30  QAbstractItemModel::beginRemoveRows(QModelIndex const&, int, int) + 106
31  QSortFilterProxyModelPrivate::remove_proxy_interval(QVector<int>&, QVector<int>&, int, int, QModelIndex const&, Qt::Orientation, bool) + 58
32  QSortFilterProxyModelPrivate::remove_source_items(QVector<int>&, QVector<int>&, QVector<int> const&, QModelIndex const&, Qt::Orientation, bool) + 265
33  QSortFilterProxyModelPrivate::source_items_about_to_be_removed(QModelIndex const&, int, int, Qt::Orientation) + 232
34  QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2196
35  QAbstractItemModel::rowsAboutToBeRemoved(QModelIndex const&, int, int) + 78
36  QAbstractItemModel::beginRemoveRows(QModelIndex const&, int, int) + 106
37  QSortFilterProxyModelPrivate::remove_proxy_interval(QVector<int>&, QVector<int>&, int, int, QModelIndex const&, Qt::Orientation, bool) + 58
38  QSortFilterProxyModelPrivate::remove_source_items(QVector<int>&, QVector<int>&, QVector<int> const&, QModelIndex const&, Qt::Orientation, bool) + 265
39  QSortFilterProxyModelPrivate::source_items_about_to_be_removed(QModelIndex const&, int, int, Qt::Orientation) + 232
40  QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2196
41  QAbstractItemModel::rowsAboutToBeRemoved(QModelIndex const&, int, int) + 78
42  QAbstractItemModel::beginRemoveRows(QModelIndex const&, int, int) + 106
43  TorrentModel::removeTorrent(QString const&) + 81
44  TorrentModel::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 345
45  QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2196
46  QBtSession::deletedTorrent(QString const&) + 56
47  QBtSession::deleteTorrent(QString const&, bool) + 2855
48  TransferListWidget::deleteSelectedTorrents() + 292
49  TransferListWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 230
50  QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2196
51  QAction::activate(QAction::ActionEvent) + 227
52  QMenuPrivate::activateCausedStack(QList<QPointer<QWidget> > const&, QAction*, QAction::ActionEvent, bool) + 77
53  QMenuPrivate::activateAction(QAction*, QAction::ActionEvent, bool) + 470
54  QWidget::event(QEvent*) + 687
55  QMenu::event(QEvent*) + 617
56  QApplicationPrivate::notify_helper(QObject*, QEvent*) + 194
57  QApplication::notify(QObject*, QEvent*) + 2716
58  SessionApplication::notify(QObject*, QEvent*) + 21
59  QCoreApplication::notifyInternal(QObject*, QEvent*) + 118
60  QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) + 448
61  qt_mac_handleMouseEvent(NSEvent*, QEvent::Type, Qt::MouseButton, QWidget*, bool) + 1300
62  -[NSWindow _reallySendEvent:] + 759
63  -[NSWindow sendEvent:] + 368
64  -[QCocoaPanel sendEvent:] + 113
65  -[NSApplication sendEvent:] + 2238
66  -[QNSApplication sendEvent:] + 97
67  -[NSApplication run] + 711
68  QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1522
69  QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 77
70  QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 370
71  QMenu::exec(QPoint const&, QAction*) + 103
72  TransferListWidget::displayListMenu(QPoint const&) + 8741
73  TransferListWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 622
74  QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 2196
75  QWidget::event(QEvent*) + 3082
76  QFrame::event(QEvent*) + 45
77  QAbstractScrollArea::viewportEvent(QEvent*) + 108
78  QAbstractItemView::viewportEvent(QEvent*) + 1390
79  QTreeView::viewportEvent(QEvent*) + 218
80  QAbstractScrollAreaFilter::eventFilter(QObject*, QEvent*) + 37
81  QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) + 115
82  QApplicationPrivate::notify_helper(QObject*, QEvent*) + 178
83  QApplication::notify(QObject*, QEvent*) + 5742
84  SessionApplication::notify(QObject*, QEvent*) + 21
85  QCoreApplication::notifyInternal(QObject*, QEvent*) + 118
86  qt_sendSpontaneousEvent(QObject*, QEvent*) + 45
87  qt_mac_handleMouseEvent(NSEvent*, QEvent::Type, Qt::MouseButton, QWidget*, bool) + 1378
88  -[NSWindow _reallySendEvent:] + 5682
89  -[NSWindow sendEvent:] + 368
90  -[QCocoaWindow sendEvent:] + 113
91  -[NSApplication sendEvent:] + 2238
92  -[QNSApplication sendEvent:] + 97
93  -[NSApplication run] + 711
94  QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1522
95  QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 77
96  QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 370
97  QCoreApplication::exec() + 199
98  main + 3415
99  start + 52

As we can see the user deleted some torrent (48). QBtSession deleted the torrent
from libtorrent::session (47) and emitted a signal (46), about torrent deletion.
In responce to the signal (43) the TorrentModel notifies (42) its views about a change.
After a long chain of notifications (42-6) the view requested (5) a value of
total_size from TorrentModel. QTorrentHandle is already invalid as the torrent
was removed in (47). So we've got a crash in (3).

The fix is relatively straightforward: do notify TorrentModel about removal not after,
but before torrent is removed from libtorrent::session. This commit does the same
thing to TorrentSpeedMonitor.

This bug reveals a major flaw in a design: currently we have a several components all
subscribed to the torrent removal signal. Signal is delivered to them in arbitrary
order, but they access each other in the handlers of this signal. E.g. TorrentModel
can access TorrentSpeedMonitor. This doesn't lead to a crash because
TorrentSpeedMonitor returns MAX_ETA when ETA is queried for unknown torrent.
2014-11-09 00:25:59 +03:00
sledgehammer999
3202ad368f Merge pull request #2141 from sorokin/fix-a-warning
Fix a warning
2014-11-08 21:21:43 +02:00
Ivan Sorokin
6bbfd0aeb7 Fix a warning 2014-11-08 19:00:04 +03:00
sledgehammer999
c9e13dfe8b Merge pull request #2120 from sorokin/ip-filter-moc
split filterparserthread into .h and .cpp and (probably) fixes #2119
2014-11-08 14:35:23 +02:00
Vladimir Golovnev (Glassez)
cd0bcacd9f WebUI: Fix upload window closing on old browsers. 2014-11-07 15:53:11 +03:00
Vladimir Golovnev (Glassez)
d85c3170b2 WebUI: Add charset attribute to text content types. 2014-11-05 20:24:17 +03:00
Vladimir Golovnev (Glassez)
7b7f88ae4f WebUI: Fix WebAPI returned data. 2014-11-05 20:24:02 +03:00
Ivan Sorokin
da867fd022 Split trackerlogin into .h and .cpp 2014-11-05 03:10:39 +03:00
Ivan Sorokin
ed197a193d Split statusbar into .h and .cpp 2014-11-05 03:10:39 +03:00
Ivan Sorokin
6347700ee3 Move libtorrent includes to .cpp
This commit probably fixes #2119.

The only important change in this commit is moving
session::get_ip_filter() from FilterParserThread::processFilterFile() to
FilterParserThread::run(). Previously we called it in main thread, but
now we calls it in worker thread. I don't now what libtorrent contract
about threads, but I assume that if it is ok to set_ip_filter from
other thread, it is ok to get it.
2014-11-05 03:10:39 +03:00
Ivan Sorokin
17f5ffcaec Split filterparserthread into .h and .cpp 2014-11-05 03:10:39 +03:00
sledgehammer999
a63d4e3400 Merge pull request #2117 from glassez/webui
WebUI Fixes
2014-11-03 17:00:34 +02:00
Vladimir Golovnev (Glassez)
0660398c28 Replace Mascot with qBittorrent logo on WebUI login page. 2014-11-03 16:31:41 +03:00
Vladimir Golovnev (Glassez)
651bf4f9aa Fix status returned to banned user. 2014-11-03 16:31:40 +03:00
sledgehammer999
6f14b34470 WEBUI: Protect against timing attacks. Closes #2108. 2014-11-02 21:41:29 +02:00
sledgehammer999
09ab5c37ce Merge pull request #2077 from pmzqla/columns
Add new columns to transfer list
2014-11-02 21:00:35 +02:00
Gabriele
b63f647c2c Add "Total Size" column to transfer list
This column shows the total size of the related torrent taking into
account also the unwanted data.

Closes #1233.
2014-11-02 19:56:03 +01:00
Gabriele
b1af99ffba Add "Last Activity" column to transfer list
This column shows the time elapsed since the related torrent has
received or sent a chunk.

Closes #517.
2014-11-02 19:56:03 +01:00
Gabriele
a501f9d223 Add "Last Seen Complete" column to transfer list
This column shows when we or one of our peers last saw a complete
copy of the related torrent.

Closes #483.
2014-11-02 19:15:10 +01:00
sledgehammer999
ea486d45c9 Merge pull request #2110 from sorokin/o1-torrent-speed-monitor
O(1) torrent speed monitor
2014-11-02 19:55:03 +02:00
Ivan Sorokin
51c9d358b4 Implement O(1) SpeedSample::average() instead of O(N) 2014-11-02 20:03:49 +03:00
Ivan Sorokin
4ff08ff691 New improved Sample in TorrentSpeedMonitor 2014-11-02 20:03:49 +03:00
Ivan Sorokin
0d311062f3 Unused function 2014-11-02 20:03:49 +03:00
sledgehammer999
d62498b48c Merge pull request #2106 from sorokin/fix-memleak-in-torrentmodel
Fix a memleak in torrentmodel.
2014-11-02 16:43:04 +02:00
sledgehammer999
37d83cf6a8 Merge pull request #2092 from pmzqla/cleanup
Remove unused code
2014-11-02 16:41:40 +02:00
sledgehammer999
4f2b7c2e10 Merge pull request #2081 from sorokin/split
Split a few files into .h and .cpp
2014-11-02 16:40:41 +02:00
sledgehammer999
cfa28ec68c Merge pull request #2080 from sorokin/cleanup-torrent-model
Cleanup torrent model item
2014-11-02 16:36:52 +02:00
sledgehammer999
73a05a67a4 Merge pull request #2057 from pmzqla/sort-content
Put directories first when sorting torrent content by name
2014-11-02 16:28:25 +02:00
sledgehammer999
6d5c9ff7d4 Merge pull request #2095 from DoumanAsh/piratebay_https
Return https connection for piratebay
2014-11-02 15:48:40 +02:00
sledgehammer999
08de7f7439 Merge pull request #2059 from sorokin/fix-eta
Fix ETA calculation
2014-11-02 15:41:40 +02:00
sledgehammer999
46f3009e4b Merge pull request #2051 from pmzqla/filter-input
Improve input box to filter torrent list
2014-11-02 15:25:49 +02:00
sledgehammer999
238703cb0e Remove unused variables. 2014-11-02 15:03:53 +02:00
sledgehammer999
9e6d57057f Add back contact info in the copyright notices. 2014-11-02 15:03:40 +02:00
sledgehammer999
c8e72ff409 Merge pull request #1890 from glassez/webui
WebUI Core Redesign
2014-11-02 15:02:22 +02:00
Ivan Sorokin
9771cb796c Unused include 2014-11-02 15:37:07 +03:00
Ivan Sorokin
807960b768 Fix a memleak in torrentmodel.
Perhaps we should finally move to C++11 and std::unique_ptr?
2014-11-02 14:56:19 +03:00
Vladimir Golovnev (Glassez)
8a65dbaa4f WebUI core redesign. 2014-11-02 13:54:48 +03:00
DoumanAsh
b4e31c9a1b Use https for Piratebay search plugin. Closes #2093 2014-10-30 21:30:45 +03:00
Gabriele
fe030f1540 Remove unused code
Leftovers of 4ec176b683 ("Make possible to move file to .unwanted
directory after downloading")
2014-10-28 23:12:22 +01:00
Vladimir Golovnev (Glassez)
9853a9fec9 Modify Http parser/generator classes. 2014-10-26 19:52:15 +03:00
Vladimir Golovnev (Glassez)
3d20f2f670 Prepare WebUI resources.
Html/Css/JavaScript files displacement.
Also add new icon.
2014-10-26 19:52:01 +03:00
Gabriele
bdf27451ad Put directories first when sorting torrent content by name
Closes #1594.
2014-10-25 21:14:56 +02:00