mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 14:27:56 +00:00
Fix crash when hiding RSS and then showing it again
This commit is contained in:
parent
ad087d7e88
commit
e11545c8a3
@ -364,7 +364,7 @@ void GUI::displayRSSTab(bool enable) {
|
||||
if(enable) {
|
||||
// RSS tab
|
||||
if(!rssWidget) {
|
||||
rssWidget = new RSSImp(BTSession);
|
||||
rssWidget = new RSSImp(tabs);
|
||||
int index_tab = tabs->addTab(rssWidget, tr("RSS"));
|
||||
tabs->setTabIcon(index_tab, QIcon(QString::fromUtf8(":/Icons/rss32.png")));
|
||||
}
|
||||
|
@ -2641,6 +2641,8 @@ QBtSession * QBtSession::instance()
|
||||
|
||||
void QBtSession::drop()
|
||||
{
|
||||
if(m_instance)
|
||||
if(m_instance) {
|
||||
delete m_instance;
|
||||
m_instance = 0;
|
||||
}
|
||||
}
|
||||
|
@ -307,9 +307,9 @@ void RSSImp::downloadTorrent() {
|
||||
foreach(const QTreeWidgetItem* item, selected_items) {
|
||||
RssArticle* article = listStreams->getRSSItemFromUrl(item->text(NEWS_URL_COL))->getItem(item->text(NEWS_ID));
|
||||
if(article->has_attachment()) {
|
||||
BTSession->downloadFromUrl(article->getTorrentUrl());
|
||||
QBtSession::instance()->downloadFromUrl(article->getTorrentUrl());
|
||||
} else {
|
||||
BTSession->downloadFromUrl(article->getLink());
|
||||
QBtSession::instance()->downloadFromUrl(article->getLink());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -577,7 +577,7 @@ void RSSImp::updateRefreshInterval(unsigned int val) {
|
||||
rssmanager->updateRefreshInterval(val);
|
||||
}
|
||||
|
||||
RSSImp::RSSImp(QBtSession *BTSession) : QWidget(), BTSession(BTSession){
|
||||
RSSImp::RSSImp(QWidget *parent) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
|
||||
rssmanager = RssManager::instance();
|
||||
|
@ -36,7 +36,6 @@
|
||||
|
||||
#include "ui_rss.h"
|
||||
|
||||
class QBtSession;
|
||||
class FeedListWidget;
|
||||
class QTreeWidgetItem;
|
||||
class RssFolder;
|
||||
@ -46,7 +45,7 @@ class RSSImp : public QWidget, public Ui::RSS{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RSSImp(QBtSession *BTSession);
|
||||
RSSImp(QWidget *parent);
|
||||
~RSSImp();
|
||||
|
||||
public slots:
|
||||
@ -85,7 +84,6 @@ private slots:
|
||||
|
||||
private:
|
||||
RssManager *rssmanager;
|
||||
QBtSession *BTSession;
|
||||
FeedListWidget *listStreams;
|
||||
QTreeWidgetItem* previous_news;
|
||||
|
||||
|
@ -149,6 +149,8 @@ RssManager * RssManager::instance()
|
||||
|
||||
void RssManager::drop()
|
||||
{
|
||||
if(m_instance)
|
||||
if(m_instance) {
|
||||
delete m_instance;
|
||||
m_instance = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user