[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Shortcuts / konsolepart conflict
From:       Eduardo Robles Elvira <edulix () gmail ! com>
Date:       2008-03-29 9:55:58
Message-ID: 200803291055.58574.edulix () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


El Sábado 29 Marzo 2008, Yo mismo escribí:
> BTW this reminds me that Hamish Rodda commited a lot of preprocessor rules
> that checked if Qt 4.4 was available or not to use
> WidgetWithChildrenShortcut or not, and all that code is not necessary
> anymore as Qt 4.4 is mandatory. Some apps as konsole have already removed
> it, but many haven't yet. Developers be aware! :P
>
> Greetings,
>       Eduardo Robles Elvira.

Attached is the mentioned patch for kdelibs. Should I commit?
-- 
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man." (George Bernard Shaw)

["remove-qt44-checks.diff" (text/x-diff)]

Index: kate/utils/katesearchbar.cpp
===================================================================
--- kate/utils/katesearchbar.cpp	(revisión: 788800)
+++ kate/utils/katesearchbar.cpp	(copia de trabajo)
@@ -1499,12 +1499,6 @@
         QLineEdit * const replacementLineEdit = m_powerUi->pattern->lineEdit();
         Q_ASSERT(replacementLineEdit != NULL);
         replacementLineEdit->completer()->setCaseSensitivity(Qt::CaseSensitive);
-
-        // Shortcut hack
-        #if QT_VERSION < KDE_MAKE_VERSION(4,4,0) // Remove this once Qt 4.4 becomes necessary
-        foreach (QWidget* widget, m_widget->findChildren<QWidget*>())
-            m_view->actionCollection ()->addAssociatedWidget(widget);
-        #endif
     }
 
     // Guess settings from context
@@ -1635,12 +1629,6 @@
 
         // Focus proxy
         centralWidget()->setFocusProxy(m_incUi->pattern);
-
-        // Shortcut hack
-        #if QT_VERSION < KDE_MAKE_VERSION(4,4,0) // Remove this once Qt 4.4 becomes necessary
-        foreach (QWidget* widget, m_widget->findChildren<QWidget*>())
-            m_view->actionCollection ()->addAssociatedWidget(widget);
-        #endif
     }
 
     // Guess settings from context
Index: kate/view/kateview.cpp
===================================================================
--- kate/view/kateview.cpp	(revisión: 788800)
+++ kate/view/kateview.cpp	(copia de trabajo)
@@ -567,11 +567,7 @@
 
   ac->addAssociatedWidget(m_viewInternal);
   foreach (QAction* action, ac->actions())
-#if QT_VERSION < KDE_MAKE_VERSION(4,4,0)
-    action->setShortcutContext(Qt::WidgetShortcut); // remove after Qt4.4 becomes mandatory
-#else
     action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
-#endif
 
   connect (this, SIGNAL(selectionChanged(KTextEditor::View*)), this, SLOT(slotSelectionChanged()));
 }
@@ -817,11 +813,7 @@
 
   m_editActions->addAssociatedWidget(m_viewInternal);
   foreach (QAction* action, m_editActions->actions())
-#if QT_VERSION < KDE_MAKE_VERSION(4,4,0)
-    action->setShortcutContext(Qt::WidgetShortcut); // remove after Qt4.4 becomes mandatory
-#else
     action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
-#endif
 }
 
 void KateView::setupCodeFolding()
@@ -2502,10 +2494,6 @@
     return m_gotoBar;
 
   m_gotoBar = new KateGotoBar (m_viewBar);
-#if QT_VERSION < KDE_MAKE_VERSION(4,4,0) // Remove this once Qt 4.4 becomes necessary
-  foreach (QWidget* widget, m_gotoBar->findChildren<QWidget*>())
-    actionCollection ()->addAssociatedWidget(widget);
-#endif
   return m_gotoBar;
 }
 
Index: kdeui/dialogs/kedittoolbar.cpp
===================================================================
--- kdeui/dialogs/kedittoolbar.cpp	(revisión: 788800)
+++ kdeui/dialogs/kedittoolbar.cpp	(copia de trabajo)
@@ -737,11 +737,7 @@
 
   m_widget->actionCollection()->addAssociatedWidget( m_widget );
   foreach (QAction* action, m_widget->actionCollection()->actions())
-#if QT_VERSION < KDE_MAKE_VERSION(4,4,0)
-    action->setShortcutContext(Qt::WidgetShortcut); // remove after Qt4.4 becomes mandatory
-#else
     action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
-#endif
 }
 
 bool KEditToolBarWidget::save()
Index: kdeui/shortcuts/kacceleratormanager.cpp
===================================================================
--- kdeui/shortcuts/kacceleratormanager.cpp	(revisión: 788800)
+++ kdeui/shortcuts/kacceleratormanager.cpp	(copia de trabajo)
@@ -301,11 +301,7 @@
   if ( dock )
   {
       //QWidgetStackAccelManager::manage( wds );
-#if QT_VERSION < KDE_MAKE_VERSION(4,3,0)
-      return;
-#else
       manageDockWidget(dock, item);
-#endif
   }
 
 
Index: kdeui/widgets/kdatetable.cpp
===================================================================
--- kdeui/widgets/kdatetable.cpp	(revisión: 788800)
+++ kdeui/widgets/kdatetable.cpp	(copia de trabajo)
@@ -260,11 +260,7 @@
     localCollection->readSettings();
     localCollection->addAssociatedWidget( this );
     foreach (QAction* action, localCollection->actions())
-#if QT_VERSION < KDE_MAKE_VERSION(4,4,0)
-        action->setShortcutContext(Qt::WidgetShortcut); // remove after Qt4.4 becomes mandatory
-#else
         action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
-#endif
 }
 
 int KDateTable::posFromDate( const QDate &date_ )

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic