1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Fix crash when application style is externally changed

Closes #1707
This commit is contained in:
David Rosca 2015-10-14 17:01:47 +02:00
parent 0fade63d86
commit ccabc336c0
3 changed files with 3 additions and 23 deletions

View File

@ -93,7 +93,6 @@ MainApplication::MainApplication(int &argc, char** argv)
, m_desktopNotifications(0)
, m_webProfile(0)
, m_autoSaver(0)
, m_proxyStyle(0)
, m_lastActiveWindow(0)
#if defined(Q_OS_WIN) && !defined(Q_OS_OS2)
, m_registerQAppAssociation(0)
@ -463,24 +462,10 @@ void MainApplication::reloadSettings()
emit settingsReloaded();
}
ProxyStyle* MainApplication::proxyStyle() const
{
return m_proxyStyle;
}
void MainApplication::setProxyStyle(ProxyStyle* style)
{
m_proxyStyle = style;
QApplication::setStyle(style);
}
QString MainApplication::styleName() const
{
if (m_proxyStyle && m_proxyStyle->baseStyle())
return m_proxyStyle->baseStyle()->objectName();
return style()->objectName();
QProxyStyle *proxyStyle = qobject_cast<QProxyStyle*>(style());
return proxyStyle ? proxyStyle->baseStyle()->objectName() : style()->objectName();
}
QString MainApplication::currentLanguageFile() const

View File

@ -37,7 +37,6 @@ class MainMenu;
class Bookmarks;
class CookieJar;
class AutoSaver;
class ProxyStyle;
class PluginProxy;
class BrowserWindow;
class NetworkManager;
@ -82,9 +81,6 @@ public:
void destroyRestoreManager();
void reloadSettings();
ProxyStyle* proxyStyle() const;
void setProxyStyle(ProxyStyle* style);
// Name of current Qt style
QString styleName() const;
@ -175,7 +171,6 @@ private:
QWebEngineProfile* m_webProfile;
AutoSaver* m_autoSaver;
ProxyStyle* m_proxyStyle;
QList<BrowserWindow*> m_windows;
BrowserWindow* m_lastActiveWindow;

View File

@ -163,7 +163,7 @@ int main(int argc, char* argv[])
if (app.isClosing())
return 0;
app.setProxyStyle(new ProxyStyle);
app.setStyle(new ProxyStyle);
return app.exec();
}