1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Fixed crash when opening preferences and not loaded passwords manager

This commit is contained in:
nowrep 2013-06-05 00:06:23 +02:00
parent 05ca29715f
commit 7001823511
3 changed files with 12 additions and 11 deletions

View File

@ -119,13 +119,15 @@ void PasswordManager::removeAllEntries()
m_backend->removeAll(); m_backend->removeAll();
} }
QHash<QString, PasswordBackend*> PasswordManager::availableBackends() const QHash<QString, PasswordBackend*> PasswordManager::availableBackends()
{ {
ensureLoaded();
return m_backends; return m_backends;
} }
PasswordBackend* PasswordManager::activeBackend() const PasswordBackend* PasswordManager::activeBackend()
{ {
ensureLoaded();
return m_backend; return m_backend;
} }

View File

@ -72,8 +72,8 @@ public:
void removeEntry(const PasswordEntry &entry); void removeEntry(const PasswordEntry &entry);
void removeAllEntries(); void removeAllEntries();
QHash<QString, PasswordBackend*> availableBackends() const; QHash<QString, PasswordBackend*> availableBackends();
PasswordBackend* activeBackend() const; PasswordBackend* activeBackend();
void switchBackend(PasswordBackend* backend); void switchBackend(PasswordBackend* backend);
bool registerBackend(const QString &id, PasswordBackend* backend); bool registerBackend(const QString &id, PasswordBackend* backend);

View File

@ -65,6 +65,12 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this); ui->setupUi(this);
m_themesManager = new ThemeManager(ui->themesWidget, this);
m_autoFillManager = new AutoFillManager(this);
ui->autoFillFrame->addWidget(m_autoFillManager);
m_pluginsList = new PluginsManager(this);
ui->pluginsFrame->addWidget(m_pluginsList);
if (QIcon::themeName().toLower() == QLatin1String("oxygen")) { if (QIcon::themeName().toLower() == QLatin1String("oxygen")) {
ui->listWidget->item(0)->setIcon(QIcon::fromTheme("preferences-desktop", QIcon(":/icons/preferences/preferences-desktop.png"))); ui->listWidget->item(0)->setIcon(QIcon::fromTheme("preferences-desktop", QIcon(":/icons/preferences/preferences-desktop.png")));
ui->listWidget->item(1)->setIcon(QIcon::fromTheme("format-stroke-color", QIcon(":/icons/preferences/application-x-theme.png"))); ui->listWidget->item(1)->setIcon(QIcon::fromTheme("format-stroke-color", QIcon(":/icons/preferences/application-x-theme.png")));
@ -177,7 +183,6 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
startProfileIndexChanged(ui->startProfile->currentText()); startProfileIndexChanged(ui->startProfile->currentText());
//APPEREANCE //APPEREANCE
m_themesManager = new ThemeManager(ui->themesWidget, this);
settings.beginGroup("Browser-View-Settings"); settings.beginGroup("Browser-View-Settings");
ui->showStatusbar->setChecked(settings.value("showStatusBar", true).toBool()); ui->showStatusbar->setChecked(settings.value("showStatusBar", true).toBool());
if (p_QupZilla) { if (p_QupZilla) {
@ -276,8 +281,6 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
ui->allowPassManager->setChecked(settings.value("SavePasswordsOnSites", true).toBool()); ui->allowPassManager->setChecked(settings.value("SavePasswordsOnSites", true).toBool());
connect(ui->allowPassManager, SIGNAL(toggled(bool)), this, SLOT(showPassManager(bool))); connect(ui->allowPassManager, SIGNAL(toggled(bool)), this, SLOT(showPassManager(bool)));
m_autoFillManager = new AutoFillManager(this);
ui->autoFillFrame->addWidget(m_autoFillManager);
showPassManager(ui->allowPassManager->isChecked()); showPassManager(ui->allowPassManager->isChecked());
//PRIVACY //PRIVACY
@ -346,10 +349,6 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
ui->loadSpeedDialsCtrl->setChecked(settings.value("useSpeedDialNumberShortcuts", true).toBool()); ui->loadSpeedDialsCtrl->setChecked(settings.value("useSpeedDialNumberShortcuts", true).toBool());
settings.endGroup(); settings.endGroup();
//PLUGINS
m_pluginsList = new PluginsManager(this);
ui->pluginsFrame->addWidget(m_pluginsList);
//NOTIFICATIONS //NOTIFICATIONS
ui->useNativeSystemNotifications->setEnabled(mApp->desktopNotifications()->supportsNativeNotifications()); ui->useNativeSystemNotifications->setEnabled(mApp->desktopNotifications()->supportsNativeNotifications());