mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Don't check for null pointer before deleting objects.
- as delete 0 is safe
This commit is contained in:
parent
92b18f5466
commit
2d5b0c0bc0
@ -225,12 +225,7 @@ void CookieManager::addWhitelist()
|
||||
|
||||
void CookieManager::removeWhitelist()
|
||||
{
|
||||
QListWidgetItem* current = ui->whiteList->currentItem();
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete current;
|
||||
delete ui->whiteList->currentItem();
|
||||
}
|
||||
|
||||
void CookieManager::addBlacklist()
|
||||
@ -245,12 +240,7 @@ void CookieManager::addBlacklist()
|
||||
|
||||
void CookieManager::removeBlacklist()
|
||||
{
|
||||
QListWidgetItem* current = ui->blackList->currentItem();
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete current;
|
||||
delete ui->blackList->currentItem();
|
||||
}
|
||||
|
||||
void CookieManager::deletePressed()
|
||||
|
@ -113,9 +113,7 @@ void DownloadFileHelper::optionsDialogAccepted(int finish)
|
||||
|
||||
switch (finish) {
|
||||
case 0: // Cancelled
|
||||
if (m_timer) {
|
||||
delete m_timer;
|
||||
}
|
||||
|
||||
m_reply->abort();
|
||||
m_reply->deleteLater();
|
||||
@ -144,9 +142,7 @@ void DownloadFileHelper::optionsDialogAccepted(int finish)
|
||||
|
||||
default:
|
||||
qWarning() << "DownloadFileHelper::optionsDialogAccepted invalid return value!";
|
||||
if (m_timer) {
|
||||
delete m_timer;
|
||||
}
|
||||
|
||||
m_reply->abort();
|
||||
m_reply->deleteLater();
|
||||
@ -198,9 +194,7 @@ void DownloadFileHelper::fileNameChoosed(const QString &name, bool fileNameAutoG
|
||||
m_reply->abort();
|
||||
m_reply->deleteLater();
|
||||
|
||||
if (m_timer) {
|
||||
delete m_timer;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -163,10 +163,7 @@ void AcceptLanguage::addLanguage()
|
||||
|
||||
void AcceptLanguage::removeLanguage()
|
||||
{
|
||||
QListWidgetItem* currentItem = ui->listWidget->currentItem();
|
||||
if (currentItem) {
|
||||
delete currentItem;
|
||||
}
|
||||
delete ui->listWidget->currentItem();
|
||||
}
|
||||
|
||||
void AcceptLanguage::upLanguage()
|
||||
|
@ -573,10 +573,8 @@ void Preferences::openSslManager()
|
||||
|
||||
void Preferences::showAcceptLanguage()
|
||||
{
|
||||
AcceptLanguage* a = new AcceptLanguage(this);
|
||||
a->exec();
|
||||
|
||||
delete a;
|
||||
AcceptLanguage a(this);
|
||||
a.exec();
|
||||
}
|
||||
|
||||
void Preferences::newTabChanged(int value)
|
||||
@ -936,7 +934,5 @@ Preferences::~Preferences()
|
||||
delete ui;
|
||||
delete m_autoFillManager;
|
||||
delete m_pluginsList;
|
||||
if (m_notification) {
|
||||
delete m_notification.data();
|
||||
}
|
||||
}
|
||||
|
@ -65,12 +65,7 @@ void SSLManager::addPath()
|
||||
|
||||
void SSLManager::deletePath()
|
||||
{
|
||||
QListWidgetItem* currentItem = ui->pathList->currentItem();
|
||||
if (!currentItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
delete currentItem;
|
||||
delete ui->pathList->currentItem();
|
||||
}
|
||||
|
||||
void SSLManager::refreshCAList()
|
||||
|
@ -290,7 +290,5 @@ void SiteInfo::securityDetailsClicked()
|
||||
SiteInfo::~SiteInfo()
|
||||
{
|
||||
delete ui;
|
||||
if (m_certWidget) {
|
||||
delete m_certWidget;
|
||||
}
|
||||
}
|
||||
|
@ -322,7 +322,5 @@ void WebTab::disconnectObjects()
|
||||
|
||||
WebTab::~WebTab()
|
||||
{
|
||||
if (m_locationBar) {
|
||||
delete m_locationBar.data();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user