All pastes #347932 Raw Edit

Something

public text v1 · immutable
·published 2007-02-09 20:20 UTC
rendered paste body
Index: katedocmanager.cpp
===================================================================
--- katedocmanager.cpp  (revision 632021)
+++ katedocmanager.cpp  (working copy)
@@ -222,10 +222,15 @@

 KTextEditor::Document *KateDocManager::openUrl (const KUrl& url, const QString &encoding, bool isTempFile)
 {
+  KTextEditor::Document *doc = 0;
+
   // special handling if still only the first initial doc is there
-  if (!documentList().isEmpty() && (documentList().count() == 1) && (!documentList().at(0)->isModified() && documentList().at(0)->url().isEmpty()))
+  if (!documentList().isEmpty() &&
+      (documentList().count() == 1) &&
+      ( !documentList().at(0)->isModified() &&
+        documentList().at(0)->url().isEmpty()))
   {
-    KTextEditor::Document* doc = documentList().first();
+    doc = documentList().first();

     doc->setEncoding(encoding);

@@ -246,10 +251,11 @@

     emit initialDocumentReplaced();

+    emit opened(doc);
     return doc;
   }

-  KTextEditor::Document *doc = findDocument (url);
+  doc = findDocument (url);
   if ( !doc )
   {
     doc = (KTextEditor::Document *)createDoc ();
@@ -260,6 +266,7 @@
       doc->openUrl (url);
   }

+  emit opened(doc);
   return doc;
 }