[Bug 66095] tags generation with ctags does not works for large file count

Ralf Habacker ralf.habacker at freenet.de
Thu Oct 16 08:37:07 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=66095     




------- Additional Comments From ralf.habacker at freenet.de  2003-10-16 08:36 -------
The following patch fixes this by using a temporay file list in the same location of the created tags file. 


cvs server: Diffing parts/ctags
Index: parts/ctags/ctagspart.cpp
===================================================================
RCS file: /home/kde/kdevelop/parts/ctags/ctagspart.cpp,v
retrieving revision 1.23
diff -u -b -r1.23 ctagspart.cpp
--- parts/ctags/ctagspart.cpp   20 Sep 2003 11:03:46 -0000      1.23
+++ parts/ctags/ctagspart.cpp   16 Oct 2003 06:32:58 -0000
@@ -295,24 +295,37 @@
 {
        kdDebug(9022) << "create tags file" << endl;

+       QString tagFilesListName = project()->projectDirectory() + "/tags.files";
+
        KProcess proc;
        proc.setWorkingDirectory( project()->projectDirectory() );

        proc << "ctags";
        proc << "-n";
        proc << "--c++-types=+px";
+       proc << "-L " << tagFilesListName;
+
+       QFile f(tagFilesListName);
+       if (!f.open(IO_WriteOnly)) {
+               return false;
+       }
+
+       QTextStream stream(&f);

        QStringList l = project()->allFiles();
        QStringList::ConstIterator it;
        for (it = l.begin(); it != l.end(); ++it)
        {
-               proc << *it;
+               stream << *it << endl;
        }

+       f.close();
     QApplication::setOverrideCursor(Qt::waitCursor);
     bool success = proc.start(KProcess::Block);
     QApplication::restoreOverrideCursor();

+       f.remove();
+
     return success;
 }




More information about the KDevelop-devel mailing list