mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 08:43:08 -07:00
- Little pointer code cleanup
This commit is contained in:
parent
59f21d592e
commit
6dbd1daa5c
2 changed files with 4 additions and 8 deletions
10
src/GUI.cpp
10
src/GUI.cpp
|
@ -169,9 +169,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
||||||
searchEngine = new SearchEngine(BTSession, myTrayIcon, systrayIntegration);
|
searchEngine = new SearchEngine(BTSession, myTrayIcon, systrayIntegration);
|
||||||
tabs->addTab(searchEngine, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")), tr("Search"));
|
tabs->addTab(searchEngine, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")), tr("Search"));
|
||||||
|
|
||||||
// RSS Tab
|
|
||||||
rssWidget = 0;
|
|
||||||
|
|
||||||
// Configure BT session according to options
|
// Configure BT session according to options
|
||||||
loadPreferences(false);
|
loadPreferences(false);
|
||||||
// Resume unfinished torrents
|
// Resume unfinished torrents
|
||||||
|
@ -275,7 +272,7 @@ GUI::~GUI() {
|
||||||
delete statusSep2;
|
delete statusSep2;
|
||||||
delete statusSep3;
|
delete statusSep3;
|
||||||
delete statusSep4;
|
delete statusSep4;
|
||||||
if(rssWidget != 0)
|
if(rssWidget)
|
||||||
delete rssWidget;
|
delete rssWidget;
|
||||||
delete searchEngine;
|
delete searchEngine;
|
||||||
delete transferListFilters;
|
delete transferListFilters;
|
||||||
|
@ -315,15 +312,14 @@ GUI::~GUI() {
|
||||||
void GUI::displayRSSTab(bool enable) {
|
void GUI::displayRSSTab(bool enable) {
|
||||||
if(enable) {
|
if(enable) {
|
||||||
// RSS tab
|
// RSS tab
|
||||||
if(rssWidget == 0) {
|
if(!rssWidget) {
|
||||||
rssWidget = new RSSImp(BTSession);
|
rssWidget = new RSSImp(BTSession);
|
||||||
int index_tab = tabs->addTab(rssWidget, tr("RSS"));
|
int index_tab = tabs->addTab(rssWidget, tr("RSS"));
|
||||||
tabs->setTabIcon(index_tab, QIcon(QString::fromUtf8(":/Icons/rss32.png")));
|
tabs->setTabIcon(index_tab, QIcon(QString::fromUtf8(":/Icons/rss32.png")));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(rssWidget != 0) {
|
if(rssWidget) {
|
||||||
delete rssWidget;
|
delete rssWidget;
|
||||||
rssWidget = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
||||||
// Search
|
// Search
|
||||||
SearchEngine *searchEngine;
|
SearchEngine *searchEngine;
|
||||||
// RSS
|
// RSS
|
||||||
RSSImp *rssWidget;
|
QPointer<RSSImp> rssWidget;
|
||||||
// Web UI
|
// Web UI
|
||||||
QPointer<HttpServer> httpServer;
|
QPointer<HttpServer> httpServer;
|
||||||
// Misc
|
// Misc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue