mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Preferences: Don't crash when opening with null BrowserWindow
Closes #1488
This commit is contained in:
parent
dac236d70b
commit
21fb7bff31
@ -392,8 +392,8 @@ void BrowserWindow::setupMenu()
|
||||
connect(inspectorAction, SIGNAL(activated()), this, SLOT(showWebInspector()));
|
||||
}
|
||||
|
||||
QAction *BrowserWindow::createEncodingAction(const QString &codecName,
|
||||
const QString &activeCodecName, QMenu *menu)
|
||||
QAction* BrowserWindow::createEncodingAction(const QString &codecName,
|
||||
const QString &activeCodecName, QMenu* menu)
|
||||
{
|
||||
QAction* action = new QAction(codecName, menu);
|
||||
action->setData(codecName);
|
||||
@ -405,7 +405,7 @@ QAction *BrowserWindow::createEncodingAction(const QString &codecName,
|
||||
return action;
|
||||
}
|
||||
|
||||
void BrowserWindow::createEncodingSubMenu(const QString &name, QStringList &codecNames, QMenu *menu)
|
||||
void BrowserWindow::createEncodingSubMenu(const QString &name, QStringList &codecNames, QMenu* menu)
|
||||
{
|
||||
if (codecNames.isEmpty()) {
|
||||
return;
|
||||
|
@ -265,7 +265,7 @@ Preferences::Preferences(BrowserWindow* window, QWidget* parent)
|
||||
bool pbInABuseCC = settings.value("UseCustomProgressColor", false).toBool();
|
||||
ui->checkBoxCustomProgressColor->setChecked(pbInABuseCC);
|
||||
ui->progressBarColorSelector->setEnabled(pbInABuseCC);
|
||||
QColor pbColor = settings.value("CustomProgressColor", m_window->palette().color(QPalette::Highlight)).value<QColor>();
|
||||
QColor pbColor = settings.value("CustomProgressColor", palette().color(QPalette::Highlight)).value<QColor>();
|
||||
setProgressBarColorIcon(pbColor);
|
||||
connect(ui->customColorToolButton, SIGNAL(clicked(bool)), SLOT(selectCustomProgressBarColor()));
|
||||
connect(ui->resetProgressBarcolor, SIGNAL(clicked()), SLOT(setProgressBarColorIcon()));
|
||||
@ -592,11 +592,17 @@ void Preferences::allowCacheChanged(bool state)
|
||||
|
||||
void Preferences::useActualHomepage()
|
||||
{
|
||||
if (!m_window)
|
||||
return;
|
||||
|
||||
ui->homepage->setText(m_window->weView()->url().toString());
|
||||
}
|
||||
|
||||
void Preferences::useActualNewTab()
|
||||
{
|
||||
if (!m_window)
|
||||
return;
|
||||
|
||||
ui->newTabUrl->setText(m_window->weView()->url().toString());
|
||||
}
|
||||
|
||||
@ -1118,7 +1124,7 @@ void Preferences::setProgressBarColorIcon(QColor color)
|
||||
const int size = style()->pixelMetric(QStyle::PM_ToolBarIconSize);
|
||||
QPixmap pm(QSize(size, size));
|
||||
if (!color.isValid()) {
|
||||
color = m_window->palette().color(QPalette::Highlight);
|
||||
color = palette().color(QPalette::Highlight);
|
||||
}
|
||||
pm.fill(color);
|
||||
ui->customColorToolButton->setIcon(pm);
|
||||
|
Loading…
Reference in New Issue
Block a user