From kdevelop-devel Wed Aug 11 22:05:41 2004 From: Ian Reinhart Geiser Date: Wed, 11 Aug 2004 22:05:41 +0000 To: kdevelop-devel Subject: Patch for showstopper in file list and distpart Message-Id: <200408111805.42542.ian () geiseri ! com> X-MARC-Message: https://marc.info/?l=kdevelop-devel&m=109265047225639 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_2gpGBEFVuDwdveq" --Boundary-00=_2gpGBEFVuDwdveq Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline These patches fix issues with QMake and Automake not exporting complete lists of files that are part of the project, basicly it was ignoring files associated with the build system. Also in QMake ui files and translations where ignored. Lastly there is a small patch to the distpart that puts things in a subdir, vs at the top level, somehow this behavior changed. These are kindof showstoppers imho for 3.1 because they effect some very visible aspects of KDevelop, and can cause issues in areas that require a list of files that are part of a project. Cheers -ian reinhart geiser -- ------(Ian Reinhart Geiser)---------- These precious things, let them break, let them wash away -Tori Amos, Precious Things --Boundary-00=_2gpGBEFVuDwdveq Content-Type: text/x-diff; charset="us-ascii"; name="filelist.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="filelist.patch" Index: autotools/autoprojectpart.cpp =================================================================== RCS file: /home/kde/kdevelop/buildtools/autotools/autoprojectpart.cpp,v retrieving revision 1.134 diff -u -u -r1.134 autoprojectpart.cpp --- autotools/autoprojectpart.cpp 15 Jul 2004 22:19:14 -0000 1.134 +++ autotools/autoprojectpart.cpp 11 Aug 2004 22:01:25 -0000 @@ -1290,9 +1290,33 @@ return UsesAutotoolsBuildSystem; } -#include "autoprojectpart.moc" +QStringList recursiveATFind( const QString &currDir, const QString &baseDir ) +{ + kdDebug() << "Dir " << currDir << endl; + QStringList fileList; + + if( !currDir.contains( "/..") && !currDir.contains("/.") ) + { + QDir dir(currDir); + QStringList dirList = dir.entryList(QDir::Dirs ); + QStringList::Iterator idx = dirList.begin(); + for( ; idx != dirList.end(); ++idx ) + { + fileList += recursiveATFind( currDir + "/" + (*idx),baseDir ); + } + QStringList newFiles = dir.entryList("*.am *.in"); + idx = newFiles.begin(); + for( ; idx != newFiles.end(); ++idx ) + { + QString file = currDir + "/" + (*idx); + fileList.append( file.remove( baseDir ) ); + } + } + return fileList; +} + /*! \fn AutoProjectPart::distFiles() const */ @@ -1302,6 +1326,23 @@ // Scan current source directory for any .pro files. QString projectDir = projectDirectory(); QDir dir(projectDir); - QStringList files = dir.entryList( "Makefile.am configure* admin/* INSTALL README NEWS TODO ChangeLog COPYING AUTHORS stamp-h.in"); + QDir admin(projectDir +"/admin"); + QStringList files = dir.entryList( "Makefile.cvs Makefile.am configure* INSTALL README NEWS TODO ChangeLog COPYING AUTHORS stamp-h.in"); + QStringList adminFiles = admin.entryList(QDir::Files); + QStringList::Iterator idx = adminFiles.begin(); + for( ; idx != adminFiles.end(); ++idx) + { + files.append( "admin/" + (*idx) ); + } + QStringList srcDirs = dir.entryList(QDir::Dirs); + idx = srcDirs.begin(); + for(; idx != srcDirs.end(); ++idx) + { + sourceList += recursiveATFind( projectDirectory() + "/" + (*idx), projectDirectory()); + } return sourceList + files; } +#include "autoprojectpart.moc" + + + Index: qmake/trollprojectpart.cpp =================================================================== RCS file: /home/kde/kdevelop/buildtools/qmake/trollprojectpart.cpp,v retrieving revision 1.77 diff -u -u -r1.77 trollprojectpart.cpp --- qmake/trollprojectpart.cpp 23 Jul 2004 08:39:01 -0000 1.77 +++ qmake/trollprojectpart.cpp 11 Aug 2004 22:01:26 -0000 @@ -221,7 +221,7 @@ QVBox *vbox; vbox = dlg->addVBoxPage(i18n("Run Options")); RunOptionsWidget *optdlg = new RunOptionsWidget(*projectDom(), "/kdevtrollproject", buildDirectory(), vbox); - + vbox = dlg->addVBoxPage(i18n("Make Options")); MakeOptionsWidget *w4 = new MakeOptionsWidget(*projectDom(), "/kdevtrollproject", vbox); connect( dlg, SIGNAL(okClicked()), w4, SLOT(accept()) ); @@ -240,8 +240,8 @@ if (DomUtil::readEntry(dom, "/kdevtrollproject/run/directoryradio") == "" ) { DomUtil::writeEntry(dom, "/kdevtrollproject/run/directoryradio", "executable"); } - - KDevProject::openProject( dirName, projectName ); + + KDevProject::openProject( dirName, projectName ); } @@ -395,15 +395,15 @@ /// \FIXME /* QStringList fileList; fileList.append ( fileName ); - + this->removeFiles ( fileList );*/ } void TrollProjectPart::removeFiles ( const QStringList& fileList ) { /// \FIXME missing remove files functionality -// QStringList::ConstIterator it; -// +// QStringList::ConstIterator it; +// // it = fileList.begin(); // // for ( ; it != fileList.end(); ++it ) @@ -563,9 +563,33 @@ return lst; } -#include "trollprojectpart.moc" +QStringList recursiveProFind( const QString &currDir, const QString &baseDir ) +{ + kdDebug() << "Dir " << currDir << endl; + QStringList fileList; + + if( !currDir.contains( "/..") && !currDir.contains("/.") ) + { + QDir dir(currDir); + QStringList dirList = dir.entryList(QDir::Dirs ); + QStringList::Iterator idx = dirList.begin(); + for( ; idx != dirList.end(); ++idx ) + { + fileList += recursiveProFind( currDir + "/" + (*idx),baseDir ); + } + QStringList newFiles = dir.entryList("*.pro *.PRO"); + idx = newFiles.begin(); + for( ; idx != newFiles.end(); ++idx ) + { + QString file = currDir + "/" + (*idx); + fileList.append( file.remove( baseDir ) ); + } + } + return fileList; +} + /*! \fn TrollProjectPart::distFiles() const */ @@ -574,7 +598,11 @@ QStringList sourceList = allFiles(); // Scan current source directory for any .pro files. QString projectDir = projectDirectory(); - QDir dir(projectDir); - QStringList files = dir.entryList( "*.pro *.PRO Makefile"); + QStringList files = recursiveProFind( projectDir, projectDir + "/" ); return sourceList + files; } + +#include "trollprojectpart.moc" + + + Index: qmake/trollprojectwidget.cpp =================================================================== RCS file: /home/kde/kdevelop/buildtools/qmake/trollprojectwidget.cpp,v retrieving revision 1.151 diff -u -u -r1.151 trollprojectwidget.cpp --- qmake/trollprojectwidget.cpp 6 Jul 2004 20:18:25 -0000 1.151 +++ qmake/trollprojectwidget.cpp 11 Aug 2004 22:01:26 -0000 @@ -595,8 +595,9 @@ for (QPtrListIterator tit(spitem->groups); tit.current(); ++tit) { GroupItem::GroupType type = (*tit)->groupType; - if (type == GroupItem::Sources || type == GroupItem::Headers) { - + if (type == GroupItem::Sources || type == GroupItem::Headers || type == GroupItem::Forms || type == GroupItem::Images || + type == GroupItem::Lexsources || type == GroupItem::Yaccsources || type == GroupItem::Distfiles || + type == GroupItem::Translations || type == GroupItem::IDLs || type == GroupItem::InstallObject ) { for (QPtrListIterator fit(tit.current()->files); fit.current(); ++fit){ QString filePath = path.mid( projectDirectory().length() + 1 ); @@ -1460,12 +1461,12 @@ while ( it.current() != 0 ) { if(it.current()->name == filename) //File already exists in this subproject - return; + return; ++it; - } - - FileItem *fitem = createFileItem(filename); - + } + + FileItem *fitem = createFileItem(filename); + fitem->uiFileLink = getUiFileLink(titem->owner->relpath+"/",filename); if (titem->groupType != GroupItem::InstallObject) titem->files.append(fitem); @@ -1523,9 +1524,9 @@ while ( it.current() != 0 ) { if(it.current()->name == filename) //File already exists in this subproject - return; + return; ++it; - } + } break; } } --Boundary-00=_2gpGBEFVuDwdveq Content-Type: text/x-diff; charset="us-ascii"; name="distpart.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="distpart.patch" Index: distpart_widget.cpp =================================================================== RCS file: /home/kde/kdevelop/parts/distpart/distpart_widget.cpp,v retrieving revision 1.20 diff -u -u -r1.20 distpart_widget.cpp --- distpart_widget.cpp 22 Feb 2004 23:53:43 -0000 1.20 +++ distpart_widget.cpp 11 Aug 2004 22:01:45 -0000 @@ -45,7 +45,7 @@ #include #include #include "kdevmakefrontend.h" -#include +#include #include #include "specsupport.h" @@ -128,7 +128,7 @@ "-" + getversionLineEditText() + ((getcustomProjectCheckBoxState() && getbzipCheckBoxState()) ? ".tar.bz2" : ".tar.gz"); - + KTar tar(filename, dist); if ( tar.open(IO_WriteOnly) ) { @@ -137,7 +137,7 @@ prog->show(); for( uint idx = 0; idx < files.count(); ++idx) { - if ( !tar.addLocalFile( m_part->project()->projectDirectory() + "/" + files[idx], files[idx]) ) + if ( !tar.addLocalFile( m_part->project()->projectDirectory() + "/" + files[idx], getappNameFormatLineEditText() + "/" + files[idx]) ) { kdDebug() << "Failed to write file " << files[idx] << endl; } @@ -151,13 +151,13 @@ prog->hide(); delete prog; KMessageBox::information(this, "Archive made at: " + filename,"Archive Done"); - + } else { kdDebug() << "Failed to open archive..." << endl; - } - + } + } // QPushButton* resetSrcPushButton; @@ -460,7 +460,7 @@ void DistpartDialog::loadSettings() { QDomDocument &dom = *m_part->projectDom(); - + srcDistFileListBox->insertStringList( m_part->project()->distFiles() ); // First Tab --Boundary-00=_2gpGBEFVuDwdveq-- _______________________________________________ KDevelop-devel mailing list KDevelop-devel@barney.cs.uni-potsdam.de http://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel