[Bug 58272] New: Doc tab doesn't change with document change
jalal
the_jalal at fastmail.fm
Fri May 9 13:59:06 UTC 2003
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=58272
Summary: Doc tab doesn't change with document change
Product: kdevelop
Version: unspecified
Platform: SuSE RPMs
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
AssignedTo: kdevelop-devel at kdevelop.org
ReportedBy: the_jalal at fastmail.fm
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);
}
More information about the KDevelop-devel
mailing list