From 05a8b7fcc5dd9ea04a12795e0613cdbf73d99c0f Mon Sep 17 00:00:00 2001 From: "S. Razi Alavizadeh" Date: Sat, 9 Feb 2013 03:47:58 +0330 Subject: [PATCH] [Mac] Fixed, actions were not triggered. --- src/lib/app/mainapplication.h | 6 +++--- src/lib/app/qupzilla.cpp | 6 ++++++ src/lib/other/macmenureceiver.cpp | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib/app/mainapplication.h b/src/lib/app/mainapplication.h index e22b235ea..6e9e99d6e 100644 --- a/src/lib/app/mainapplication.h +++ b/src/lib/app/mainapplication.h @@ -182,9 +182,6 @@ private: #endif DatabaseWriter* m_dbWriter; UserAgentManager* m_uaManager; -#ifdef Q_OS_MAC - MacMenuReceiver* m_macMenuReceiver; -#endif QList > m_mainWindows; QString m_activeProfil; @@ -203,6 +200,9 @@ private: #ifdef Q_OS_WIN RegisterQAppAssociation* m_registerQAppAssociation; #endif +#ifdef Q_OS_MAC + MacMenuReceiver* m_macMenuReceiver; +#endif }; #endif // MAINAPPLICATION_H diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index c305f68b2..c4aa7e339 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -1076,7 +1076,9 @@ void QupZilla::aboutToShowViewMenu() void QupZilla::aboutToHideViewMenu() { +#ifndef Q_OS_MAC m_actionPageSource->setEnabled(false); +#endif } void QupZilla::aboutToShowEditMenu() @@ -1095,9 +1097,11 @@ void QupZilla::aboutToShowEditMenu() void QupZilla::aboutToHideEditMenu() { +#ifndef Q_OS_MAC foreach(QAction * act, m_menuEdit->actions()) { act->setEnabled(false); } +#endif m_menuEdit->actions().at(8)->setEnabled(true); m_actionPreferences->setEnabled(true); @@ -1110,7 +1114,9 @@ void QupZilla::aboutToShowToolsMenu() void QupZilla::aboutToHideToolsMenu() { +#ifndef Q_OS_MAC m_actionPageInfo->setEnabled(false); +#endif } void QupZilla::aboutToShowEncodingMenu() diff --git a/src/lib/other/macmenureceiver.cpp b/src/lib/other/macmenureceiver.cpp index 5cc6eb0a8..023128fcf 100644 --- a/src/lib/other/macmenureceiver.cpp +++ b/src/lib/other/macmenureceiver.cpp @@ -29,8 +29,8 @@ MacMenuReceiver::MacMenuReceiver(QObject* parent) : QObject(parent) , m_macMenuBar(0) - , m_menuBookmarksAction(0) , m_bookmarksMenuChanged(true) + , m_menuBookmarksAction(0) { } @@ -49,7 +49,7 @@ void MacMenuReceiver::setEnabledSelectedMenuActions(QMenu* menu, const QList= menu->actions().size()); + Q_ASSERT(index >= 0 && index < menu->actions().size()); menu->actions().at(index)->setEnabled(true); } } @@ -69,7 +69,7 @@ void MacMenuReceiver::setDisabledSelectedMenuActions(QMenu* menu, const QList= menu->actions().size()); + Q_ASSERT(index >= 0 && index < menu->actions().size()); menu->actions().at(index)->setDisabled(true); } }