Ticket #46536: deactivate-menurole-heuristics.patch

File deactivate-menurole-heuristics.patch, 2.3 KB (added by RJVB (René Bertin), 10 years ago)
  • qtbase/src/plugins/platforms/cocoa/messages.cpp

     
    7070{
    7171    QString captionNoAmpersand(caption);
    7272    captionNoAmpersand.remove(QChar('&'));
    73     const QString aboutString = QCoreApplication::translate("QCocoaMenuItem", "About");
    74     if (captionNoAmpersand.startsWith(aboutString, Qt::CaseInsensitive) || caption.endsWith(aboutString, Qt::CaseInsensitive))
    75         return QPlatformMenuItem::AboutRole;
    76     if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive)
    77         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive)
    78         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive)
    79         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive)
    80         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) {
    81         return QPlatformMenuItem::PreferencesRole;
    82     }
     73//     const QString aboutString = QCoreApplication::translate("QCocoaMenuItem", "About");
     74//     if (captionNoAmpersand.startsWith(aboutString, Qt::CaseInsensitive) || caption.endsWith(aboutString, Qt::CaseInsensitive))
     75//         return QPlatformMenuItem::AboutRole;
     76//     if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive)
     77//         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive)
     78//         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive)
     79//         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive)
     80//         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) {
     81//         return QPlatformMenuItem::PreferencesRole;
     82//     }
    8383    if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Quit"), Qt::CaseInsensitive)
    8484        || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Exit"), Qt::CaseInsensitive)) {
    8585        return QPlatformMenuItem::QuitRole;