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

List:       kde-commits
Subject:    branches/work/kdevelop3/src
From:       Vladimir Prus <ghost () cs ! msu ! su>
Date:       2005-09-07 7:49:33
Message-ID: 1126079374.000013.12142.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 458082 by vprus:

Merge debugger-related change from KDE 3.5 branch:
   svn merge -r 454609:454610 
   svn+ssh://vprus@svn.kde.org/home/kde/branches/KDE/3.5/kdevelop/src 
   .


 M  +48 -37    partcontroller.cpp  


--- branches/work/kdevelop3/src/partcontroller.cpp #458081:458082
@@ -573,43 +573,6 @@
       return; // to avoid later crash
   }
 
-  // There's shortcut conflict between Kate and the debugger, resolve
-  // it here. Ideally, the should be some standard mechanism, configurable
-  // by config files.
-  // However, it does not exists and situation here some rare commands
-  // like "Dynamic word wrap" or "Show line numbers" from Kate take
-  // all possible shortcuts, leaving us with IDE that has no shortcuts for
-  // debugger, is very bad.
-  //
-  // We could try to handle this in debugger, but that would require
-  // the debugger to intercept all new KTextEditor::View creations, which is
-  // not possible.
-
-  KTextEditor::View* view = dynamic_cast<KTextEditor::View*>(widget);
-  if (view)
-  {
-    KActionCollection* c = view->actionCollection();
-    // Be extra carefull, in case the part either don't provide those
-    // action, or uses different shortcuts.
-
-    if (KAction* a = c->action("view_folding_markers"))
-    {
-      if (a->shortcut() == KShortcut(Key_F9))
-        a->setShortcut(KShortcut());
-    }
-
-    if (KAction* a = c->action("view_dynamic_word_wrap"))
-    {
-      if (a->shortcut() == KShortcut(Key_F10))
-        a->setShortcut(KShortcut());
-    }
-
-    if (KAction* a = c->action("view_line_numbers"))
-    {
-      if (a->shortcut() == KShortcut(Key_F11))
-        a->setShortcut(KShortcut());
-    }
-  }
       
   TopLevel::getInstance()->embedPartView(widget, url.fileName(), url.url());
 
@@ -661,6 +624,54 @@
 
 void PartController::integrateTextEditorPart(KTextEditor::Document* doc)
 {
+  // There's shortcut conflict between Kate and the debugger, resolve
+  // it here. Ideally, the should be some standard mechanism, configurable
+  // by config files.
+  // However, it does not exists and situation here some rare commands
+  // like "Dynamic word wrap" or "Show line numbers" from Kate take
+  // all possible shortcuts, leaving us with IDE that has no shortcuts for
+  // debugger, is very bad.
+  //
+  // We could try to handle this in debugger, but that would require
+  // the debugger to intercept all new KTextEditor::View creations, which is
+  // not possible.
+
+  QWidget* widget = 0;
+  KTextEditor::View* view = 0;
+  if (KTextEditor::Editor* edit = dynamic_cast<KTextEditor::Editor*>(doc))
+  {
+    widget = edit->widget();
+  }
+  if (widget)
+  {
+    view = dynamic_cast<KTextEditor::View*>(widget);
+  }
+  
+  if (view)
+  {
+    KActionCollection* c = view->actionCollection();
+    // Be extra carefull, in case the part either don't provide those
+    // action, or uses different shortcuts.
+
+    if (KAction* a = c->action("view_folding_markers"))
+    {
+      if (a->shortcut() == KShortcut(Key_F9))
+        a->setShortcut(KShortcut());
+    }
+
+    if (KAction* a = c->action("view_dynamic_word_wrap"))
+    {
+      if (a->shortcut() == KShortcut(Key_F10))
+        a->setShortcut(KShortcut());
+    }
+
+    if (KAction* a = c->action("view_line_numbers"))
+    {
+      if (a->shortcut() == KShortcut(Key_F11))
+        a->setShortcut(KShortcut());
+    }
+  }
+
   //EditorProxy::getInstance()->installPopup(doc, contextPopupMenu());
 
   // What's potentially problematic is that this signal isn't officially part of the
[prev in list] [next in list] [prev in thread] [next in thread] 

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