Bug 67995

Summary: class view doesn't update when removing/adding files
Product: [Applications] kdevelop Reporter: Bruno Windels <saltwater>
Component: Build tools: QMakeAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.0.0b1   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:

Description Bruno Windels 2003-11-12 14:27:14 UTC
Version:           3.0.0b1 (using KDE KDE 3.1.4)
Installed from:    Debian stable Packages
Compiler:          g++ 
OS:          Linux

After creating a new project (QMake or Automake) with kdevelop, I deleted the source files created by the new project wizard. After that I added my own source files. The problem is that the class view (tree on the left side and comboboxes) doesn't update. They still contained the classes and functions created by the wizard. With the QMake project, when I clicked them kdevelop opened the old removed source files.
Comment 1 Amilcar do Carmo Lucas 2003-11-12 14:37:33 UTC
Trollproject needs to
emitAddedFiles ( list );

And it looks like it doesn't.
Comment 2 Alexander Dymo 2003-11-18 23:30:31 UTC
Subject: kdevelop/buildtools/qmake

CVS commit by dymo: 

Emit addedFilesToProject() and removeFilesFromProject() signals when necessary and pass correct arguments to those signals (filenames with paths relative to the project directory). Also corrected addFiles() slot of TrollprojectPart to work on files with relative paths. This makes file groups, file tree and class views work properly when creating/adding/removing files with QMake manager.

CCMAIL: 67995@bugs.kde.org

We need also correct automake manager and check customproject, so I won't close this bug for now.


  M +4 -0      trollprojectpart.cpp   1.69
  M +30 -3     trollprojectwidget.cpp   1.142



Comment 3 Alexander Dymo 2003-11-21 22:50:38 UTC
Subject: kdevelop/buildtools

CVS commit by dymo: 

Emit aboutToRemoveFromSourceInfo signal before doing the actual remove in the project manager. This allows the classview to delete properly assosiated symbols from class tree and combos.
CCMAIL: 67995-done@bugs.kde.org


  M +5 -5      ant/antprojectpart.cpp   1.23
  M +2 -3      autotools/removefiledlg.cpp   1.18
  M +3 -3      custommakefiles/customprojectpart.cpp   1.67
  M +2 -2      script/scriptprojectpart.cpp   1.38


--- kdevelop/buildtools/script/scriptprojectpart.cpp  #1.37:1.38
@@ -317,4 +317,6 @@ void ScriptProjectPart::removeFile(const
 void ScriptProjectPart::removeFiles ( const QStringList& fileList )
 {
+        emit removedFilesFromProject ( fileList );
+
         QStringList::ConstIterator it;
 
@@ -323,6 +325,4 @@ void ScriptProjectPart::removeFiles ( co
                 m_sourceFiles.remove ( ( *it ) );
         }
-
-        emit removedFilesFromProject ( fileList );
 }
 

--- kdevelop/buildtools/custommakefiles/customprojectpart.cpp  #1.66:1.67
@@ -456,4 +456,7 @@ void CustomProjectPart::removeFile(const
 void CustomProjectPart::removeFiles ( const QStringList& fileList )
 {
+        kdDebug(9025) << "Emitting removedFilesFromProject" << endl;
+        emit removedFilesFromProject ( fileList );
+
         QStringList::ConstIterator it;
 
@@ -462,7 +465,4 @@ void CustomProjectPart::removeFiles ( co
                 m_sourceFiles.remove ( *it );
         }
-
-        kdDebug(9025) << "Emitting removedFilesFromProject" << endl;
-        emit removedFilesFromProject ( fileList );
 }
 

--- kdevelop/buildtools/autotools/removefiledlg.cpp  #1.17:1.18
@@ -96,4 +95,6 @@ RemoveFileDialog::~RemoveFileDialog()
 void RemoveFileDialog::accept()
 {
+        m_widget->emitRemovedFile ( subProject->path.mid ( m_part->projectDirectory().length() + 1 ) + "/" + fileName );
+
         QMap<QString,QString> replaceMap;
 
@@ -175,6 +176,4 @@ void RemoveFileDialog::accept()
         if (removeCheckBox->isChecked())
                 QFile::remove(subProject->path + "/" + fileName);
-
-        m_widget->emitRemovedFile ( subProject->path.mid ( m_part->projectDirectory().length() + 1 ) + "/" + fileName );
 
         QDialog::accept();

--- kdevelop/buildtools/ant/antprojectpart.cpp  #1.22:1.23
@@ -346,4 +346,7 @@ void AntProjectPart::removeFile(const QS
 void AntProjectPart::removeFiles ( const QStringList& fileList )
 {
+        kdDebug() << "Emitting removedFilesFromProject" << endl;
+        emit removedFilesFromProject(fileList);
+
         QStringList::ConstIterator it;  
         
@@ -352,7 +355,4 @@ void AntProjectPart::removeFiles ( const
                 m_sourceFiles.remove ( *it );
         }
-
-        kdDebug() << "Emitting removedFilesFromProject" << endl;
-        emit removedFilesFromProject(fileList);
 }