[Bug 62375] project name should be displayed in window title

Jens Dagerbo jens.dagerbo at swipnet.se
Thu Jan 8 03:15:08 UTC 2004


------- 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=62375      
jens.dagerbo at swipnet.se changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From jens.dagerbo at swipnet.se  2004-01-08 01:31 -------
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 at 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();




More information about the KDevelop-devel mailing list