Bug 58272 - Doc tab doesn't change with document change
Summary: Doc tab doesn't change with document change
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-09 13:57 UTC by jalal
Modified: 2004-01-08 00:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jalal 2003-05-09 13:57:55 UTC
Version:           Gideon from CVS (using KDE KDE 3.1.1a)
Installed from:    SuSE RPMs
Compiler:          gcc 2.95.3 
OS:          Linux

Selecting a different page in the documentation tree doesn't change the title of the tab. 

In IDEAl mode.

Following patch fixes it:

Index: src/mainwindowideal.cpp
===================================================================
RCS file: /home/kde/kdevelop/src/mainwindowideal.cpp,v
retrieving revision 1.25
diff -u -3 -p -r1.25 mainwindowideal.cpp
--- src/mainwindowideal.cpp	28 Apr 2003 15:13:45 -0000	1.25
+++ src/mainwindowideal.cpp	8 May 2003 20:43:28 -0000
@@ -59,7 +59,7 @@
 #include "settingswidget.h"
 #include "statusbar.h"
 #include "kpopupmenu.h"
-
+#include "documentationpart.h"
 
 #include "toplevel.h"
 #include "mainwindowshare.h"
@@ -546,8 +546,15 @@ void MainWindowIDEAl::slotBufferSelected
 }
 
 void MainWindowIDEAl::slotPartAdded(KParts::Part* part) {
+    if( !part ) return;
+
+    if( QString(part->name()) == "DocumentationPart" ){
+        connect( part, SIGNAL( fileNameChanged(const KURL&) ),
+                 this, SLOT(slotDocChanged(const KURL&) ) );
+        return;
+    }
 
-    if ( !part || !part->inherits("KTextEditor::Document") )
+    if ( /*!part || */!part->inherits("KTextEditor::Document") )
         return;
 
 //    connect( part, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) );
@@ -626,6 +633,14 @@ void MainWindowIDEAl::slotNewStatus()
             m_tabWidget->changeTab( rw_part->widget(), rw_part->url().fileName() );
         }
     }
+}
+
+void MainWindowIDEAl::slotDocChanged(const KURL& url)
+{
+    QObject * senderobj = const_cast<QObject*>( sender() );
+    DocumentationPart* doc = dynamic_cast<DocumentationPart*>( senderobj );
+    if( !doc ) return;
+    m_tabWidget->changeTab( doc->widget(), url.fileName() );
 }
 
 /* // Disabled until I know it doesn't break anything to remove it
Index: src/mainwindowideal.h
===================================================================
RCS file: /home/kde/kdevelop/src/mainwindowideal.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 mainwindowideal.h
--- src/mainwindowideal.h	28 Apr 2003 15:13:45 -0000	1.9
+++ src/mainwindowideal.h	8 May 2003 20:43:28 -0000
@@ -99,6 +99,7 @@ private slots:
   void slotPartAdded(KParts::Part*);
 //  void slotTextChanged();
 //  void slotUpdateModifiedFlags();
+  void slotDocChanged(const KURL& url);
   void slotNewStatus();
   void slotBottomTabsChanged();
   void slotRightTabsChanged();
Index: src/documentationpart.h
===================================================================
RCS file: /home/kde/kdevelop/src/documentationpart.h,v
retrieving revision 1.7
diff -u -3 -p -r1.7 documentationpart.h
--- src/documentationpart.h	21 Feb 2003 00:03:24 -0000	1.7
+++ src/documentationpart.h	8 May 2003 20:43:28 -0000
@@ -19,7 +19,7 @@ public:
   static QString resolveEnvVarsInURL(const QString& url);
 
 signals:
-  void fileNameChanged();
+  void fileNameChanged(const KURL& url);
 
 private slots:
  
Index: src/documentationpart.cpp
===================================================================
RCS file: /home/kde/kdevelop/src/documentationpart.cpp,v
retrieving revision 1.12
diff -u -3 -p -r1.12 documentationpart.cpp
--- src/documentationpart.cpp	3 Feb 2003 10:15:40 -0000	1.12
+++ src/documentationpart.cpp	8 May 2003 20:43:28 -0000
@@ -180,6 +180,7 @@ bool DocumentationPart::openURL(const KU
 {
   QString path = resolveEnvVarsInURL(url.url());
   KURL newUrl(path);
+  emit fileNameChanged(newUrl);
   return KHTMLPart::openURL(newUrl);
 }
Comment 1 Alexander Dymo 2003-05-09 15:59:39 UTC
Subject: Re: Doc tab doesn't change with document change

Thanks for the patch. Applied.

Comment 2 jalal 2003-12-24 18:56:02 UTC
This bug has reappeared since mainwindowideal.* disappeared.

CVS from 24/12/03
Comment 3 Jens Dagerbo 2004-01-08 00:14:09 UTC
Subject: kdevelop

CVS commit by dagerbo: 

A rather large patch, but these things are all more or less related.

It fixes the following issues:
1. Bugs #58272, #71057 and #71650
2. Modify one file. do file -> close all. katepart will show a "save file?" dialog.
click cancel. the same dialog comes up again. and again...
3. Saving resets the "externally modified" icon even when it doesn't actually save
4. "Save as" a different name - tab isn't updated

CCMAIL: 58272-done@bugs.kde.org
CCMAIL: 71057-done@bugs.kde.org
CCMAIL: 71650-done@bugs.kde.org


  M +112 -0    lib/util/ksavealldialog.cpp   1.5
  M +25 -0     lib/util/ksavealldialog.h   1.2
  M +6 -2      src/documentationpart.cpp   1.17
  M +1 -1      src/documentationpart.h   1.12
  M +16 -0     src/mainwindow.cpp   1.68
  M +1 -0      src/mainwindow.h   1.20
  M +90 -94    src/partcontroller.cpp   1.111
  M +10 -2     src/partcontroller.h   1.43
  M +2 -17     src/projectmanager.cpp   1.64
  M +0 -1      src/projectmanager.h   1.17