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

List:       kde-commits
Subject:    branches/kdevelop/3.4/src
From:       Adam Treat <treat () kde ! org>
Date:       2005-10-25 15:04:26
Message-ID: 1130252666.454035.19560.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 474124 by treat:

* Don't assume that a language part has been loaded


 M  +11 -4     multibuffer.cpp  
 M  +15 -10    partcontroller.cpp  


--- branches/kdevelop/3.4/src/multibuffer.cpp #474123:474124
@@ -53,10 +53,17 @@
         m_activeBuffer( 0 )
 {
     EditorProxy::getInstance() ->registerEditor( this );
-    KDevLanguageSupport *language = API::getInstance() ->languageSupport();
-    setOrientation( language->splitOrientation() );
-    connect( language, SIGNAL( splitOrientationChanged( Qt::Orientation ) ),
-             this, SLOT( setOrientation( Qt::Orientation ) ) );
+    if ( KDevLanguageSupport *lang = 
+         API::getInstance() ->languageSupport() )
+    {
+        setOrientation( lang->splitOrientation() );
+        connect( lang, SIGNAL( splitOrientationChanged( Qt::Orientation ) ),
+                 this, SLOT( setOrientation( Qt::Orientation ) ) );
+    }
+    else
+    {
+        setOrientation( Qt::Vertical );
+    }
 }
 
 MultiBuffer::~MultiBuffer()
--- branches/kdevelop/3.4/src/partcontroller.cpp #474123:474124
@@ -332,17 +332,22 @@
     
     if ( !addToCurrentBuffer )
     {
-        // Let the language part override the addToCurrentBuffer flag 
-        // if it decides to...
-        addToCurrentBuffer =
-            API::getInstance()->languageSupport()->shouldSplitDocument( inputUrl );
-
-        if ( addToCurrentBuffer )
+        if ( KDevLanguageSupport *lang =
+             API::getInstance()->languageSupport() )
         {
-            kdDebug(9000) << "languagePart() insists addToCurrentBuffer = true" << endl;
-            // Set activate = true, otherwise we have hard to fix multi-buffer 
-            // delayed activation.  I'll re-look at this later...
-            activate = true;
+            // Let the language part override the addToCurrentBuffer flag 
+            // if it decides to...
+            addToCurrentBuffer = lang->shouldSplitDocument( inputUrl );
+    
+            if ( addToCurrentBuffer )
+            {
+                kdDebug(9000) << 
+                    "languagePart() insists addToCurrentBuffer = true" << endl;
+                // Set activate = true, otherwise we have hard to fix 
+                // multi-buffer delayed activation.  
+                // I'll re-look at this later...
+                activate = true;
+            }
         }
     }
     
[prev in list] [next in list] [prev in thread] [next in thread] 

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