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

Fix MainApplication::styleName()

This commit is contained in:
David Rosca 2017-01-31 21:37:12 +01:00
parent a82a1c396b
commit c6a7935a67
3 changed files with 11 additions and 3 deletions

View File

@ -470,8 +470,13 @@ void MainApplication::reloadSettings()
QString MainApplication::styleName() const
{
QProxyStyle *proxyStyle = qobject_cast<QProxyStyle*>(style());
return proxyStyle ? proxyStyle->baseStyle()->objectName() : style()->objectName();
return m_proxyStyle ? m_proxyStyle->name() : QString();
}
void MainApplication::setProxyStyle(ProxyStyle *style)
{
m_proxyStyle = style;
setStyle(style);
}
QString MainApplication::currentLanguageFile() const

View File

@ -48,6 +48,7 @@ class SearchEnginesManager;
class HTML5PermissionsManager;
class RegisterQAppAssociation;
class DesktopNotificationsFactory;
class ProxyStyle;
class QUPZILLA_EXPORT MainApplication : public QtSingleApplication
{
@ -84,6 +85,7 @@ public:
// Name of current Qt style
QString styleName() const;
void setProxyStyle(ProxyStyle *style);
QString currentLanguageFile() const;
QString currentLanguage() const;
@ -175,6 +177,7 @@ private:
QWebEngineProfile* m_webProfile;
AutoSaver* m_autoSaver;
ProxyStyle *m_proxyStyle = nullptr;
QList<BrowserWindow*> m_windows;
QPointer<BrowserWindow> m_lastActiveWindow;

View File

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