Bug 62375

Summary: project name should be displayed in window title
Product: [Applications] kdevelop Reporter: Ga <Gael.de-Chalendar>
Component: generalAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ga 2003-08-08 11:37:32 UTC
Version:           CVS (using KDE KDE 3.1.1a)
Installed from:    Compiled From Sources
Compiler:          gcc 3.2 
OS:          Linux

When one works with multiple related projects and even more when debugging a project using files of another opened project, one should be able to know easily what kdevelop instance she his working on.

One way to do that would be to display the project name in the title of the window along with the active filename and the application name
Comment 1 Jens Dagerbo 2004-01-08 01:31:43 UTC
Subject: kdevelop/src

CVS commit by dagerbo: 

Show project name in window caption. Very useful for those of us 
who keep ending up with multiple KDevelop windows open.. ;)

CCMAIL: 62375-done@bugs.kde.org


  M +17 -0     mainwindow.cpp   1.69
  M +1 -0      mainwindow.h   1.21


--- kdevelop/src/mainwindow.cpp  #1.68:1.69
@@ -41,4 +41,5 @@
 #include <kiconloader.h>
 
+#include <kdevproject.h>
 #include "projectmanager.h"
 #include "partcontroller.h"
@@ -1425,3 +1426,19 @@ void MainWindow::setWindowMenu(QPopupMen
 }
 
+void MainWindow::setCaption( const QString & caption )
+{
+        if ( KDevProject * project = API::getInstance()->project() )
+        {
+                QString projectname = project->projectName();
+                
+                QString suffix(".kdevelop");
+                if ( projectname.endsWith( suffix ) )
+                {
+                        projectname.truncate( projectname.length() - suffix.length() );
+                }
+                        
+                KMdiMainFrm::setCaption( projectname + " - " + caption );
+        }
+}
+
 #include "mainwindow.moc"

--- kdevelop/src/mainwindow.h  #1.20:1.21
@@ -88,4 +88,5 @@ public:
 public slots:
 
+  void setCaption( const QString &);
   void createGUI(KParts::Part *part);
   void gotoNextWindow();


Comment 2 Gaƫl de Chalendar (aka Kleag) 2004-01-08 22:08:48 UTC
Thank you Jens, it's quite exactly the solving of my wish. But one case is not treated: when all editor windows are closed, the only caption is "Kdevelop" while it should, for example, "Kdevelop - Project name" or maybe only "Project name"