Bug 139911 - Filename of project filelist file does NOT regard case sensitive information
Summary: Filename of project filelist file does NOT regard case sensitive information
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-11 16:02 UTC by Achim Spangler
Modified: 2007-01-12 12:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Spangler 2007-01-11 16:02:48 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages
Compiler:          gcc 4.1 
OS:                Linux

I have compiled Kdevelop 3.4 from SVN state as of 11-01-2007 and things work very fine (esp. auto completion).

But I was irritated a little bit at the beginning, as Kdevelop told me, that my previous fine working CUSTOM Kdevelop-3.3.5 project wouldn't contain any file.

The project file uses a project filename with upper case letters - e.g. 3_2_VirtualTerminalMultiIso.kdevelop

Therefore Kdevelop-3.3.5 did open the project files that were referenced by the file:
3_2_VirtualTerminalMultiIso.kdevelop.filelist

I tried then to add manually a new file to the project.
Result:
Kdevelop-3.4svn created a new PURE LOWERCASE LETTER named file:
3_2_virtualterminalmultiiso.kdevelop.filelist

Thus my workaround is for now:
Create a copy of my original *.filelist file with pure lowercase letters (even if the *.kdevelop file uses still some uppercase letters!!) - and wonderful: Everything works!!

==>>
My assumption is that somewhere the filename conversion for the .filelist file looses the capitalizing information of  the filename.

My system is Kubuntu Edgy (10/2006) with a manually changed locale to ISO-8859-15 (ISO-8859-1 with euro sign).

Thanks for the good work,
Achim
Comment 1 Andreas Pakulat 2007-01-11 22:46:47 UTC
SVN commit 622458 by apaku:

Finally fix all mixed-case/lower-case problems by reading lower or mixed case and always saving using the projectname which defaults to the filename part of the .kdevelop file
BUG: 139911


 M  +8 -1      buildtools/custommakefiles/customprojectpart.cpp  
 M  +31 -11    languages/cpp/cppsupportpart.cpp  
 M  +10 -2     languages/java/javasupportpart.cpp  
 M  +1 -1      parts/doxygen/doxygenpart.cpp  


--- branches/kdevelop/3.4/buildtools/custommakefiles/customprojectpart.cpp #622457:622458
@@ -302,7 +302,14 @@
     if (m_filelistDir.isEmpty())
        m_filelistDir=dirName;
 
-    QFile f(m_filelistDir + "/" + projectName.lower() + ".kdevelop.filelist");
+    if( QFileInfo(m_filelistDir + "/" + projectName.lower() + 
+			    ".kdevelop.filelist").exists() )
+    {
+        QDir( m_filelistDir ).rename(
+			projectName.lower()+".kdevelop.filelist", 
+			projectName+".kdevelop.filelist");
+    }
+    QFile f( m_filelistDir + "/" + projectName + ".kdevelop.filelist" );
     if (f.open(IO_ReadOnly)) {
         QTextStream stream(&f);
         while (!stream.atEnd()) {
--- branches/kdevelop/3.4/languages/cpp/cppsupportpart.cpp #622457:622458
@@ -1349,11 +1349,23 @@
 	kapp->setOverrideCursor( waitCursor );
 
 	_jd = new JobData;
-	_jd->file.setName( project() ->projectDirectory() + "/" + project() ->projectName().lower() + ".kdevelop" + ".pcs" );
+	if( QFileInfo( project() ->projectDirectory() + "/" + project()->projectName().lower() 
+				+ ".kdevelop.pcs" ).exists())
+	{
+		QDir d(project()->projectDirectory()).rename( 
+				project()->projectName().lower() + ".kdevelop.pcs", 
+				project()->projectName() +".kdevelop.pcs");
+	}
+	_jd->file.setName( project() ->projectDirectory() + "/" + project()->projectName() 
+			+ ".kdevelop.pcs" );
+	
+	QString skip_file_name = project() ->projectDirectory() + "/" + 
+		project() ->projectName() + ".kdevelop.ignore_pcs";
+	QString skip_lower_file_name = project() ->projectDirectory() + "/" + 
+		project() ->projectName().lower() + ".kdevelop.ignore_pcs";
 
-	QString skip_file_name = project() ->projectDirectory() + "/" + project() ->projectName().lower() + ".kdevelop" + ".ignore_pcs";
-
-	if ( !force && !QFile::exists( skip_file_name ) && _jd->file.open( IO_ReadOnly ) )
+	if ( !force && !QFile::exists( skip_file_name ) && 
+			!QFile::exists( skip_lower_file_name ) && _jd->file.open( IO_ReadOnly ) )
 	{
 		_jd->stream.setDevice( &( _jd->file ) );
 
@@ -1494,8 +1506,13 @@
 				kapp->restoreOverrideCursor( );
 				emit updatedSourceInfo();
 				mainWindow( ) ->statusBar( ) ->message( i18n( "Done" ), 2000 );
-				QFile::remove
-					( project() ->projectDirectory() + "/" + project() ->projectName().lower() + ".kdevelop" + ".ignore_pcs" );
+				QFile::remove( project() ->projectDirectory() 
+						+ "/" + project() ->projectName() 
+						+ ".kdevelop.ignore_pcs" );
+				QFile::remove( project() ->projectDirectory() 
+						+ "/" + project() ->projectName().lower() 
+						+ ".kdevelop.ignore_pcs" );
+
 			}
 			else
 			{
@@ -2030,7 +2047,8 @@
 	if ( !project() || fileList.isEmpty() )
 		return ;
 
-	QFile f( project() ->projectDirectory() + "/" + project() ->projectName().lower() + ".kdevelop" + ".pcs" );
+	QFile f( project() ->projectDirectory() + "/" 
+			+ project() ->projectName() + ".kdevelop.pcs" );
 	if ( !f.open( IO_WriteOnly ) )
 		return ;
 
@@ -2070,9 +2088,10 @@
 		stream.device() ->at( end );
 	}
 
-	QString skip_file_name = project() ->projectDirectory() + "/" + project() ->projectName().lower() + ".kdevelop" + ".ignore_pcs";
-	QFile::remove
-		( skip_file_name );
+	QFile::remove(  project() ->projectDirectory() + "/" 
+			+ project() ->projectName() + ".kdevelop.ignore_pcs" );
+	QFile::remove(  project() ->projectDirectory() + "/" 
+			+ project() ->projectName().lower() + ".kdevelop.ignore_pcs" );
 
 	m_backgroundParser->unlock();
 }
@@ -2553,7 +2572,8 @@
 {
 	static QCString skip_me( "ignore me\n" );
 
-	QString skip_file_name = project() ->projectDirectory() + "/" + project() ->projectName().lower() + ".kdevelop" + ".ignore_pcs";
+	QString skip_file_name = project() ->projectDirectory() + "/" 
+		+ project() ->projectName() + ".kdevelop.ignore_pcs";
 	QFile skip_pcs_file( skip_file_name );
 	if ( skip_pcs_file.open( IO_WriteOnly ) )
 	{
--- branches/kdevelop/3.4/languages/java/javasupportpart.cpp #622457:622458
@@ -528,7 +528,14 @@
     QDataStream stream;
     QMap< QString, QPair<uint, uint> > pcs;
 
-    QFile f( project()->projectDirectory() + "/" + project()->projectName().lower() + ".kdevelop" + ".pcs" );
+    if( QFileInfo( project()->projectDirectory() + "/" + 
+			    project()->projectName().lower() + ".kdevelop.pcs" ).exists() )
+    {
+        QDir(project()->projectDirectory()).rename( 
+			project()->projectName().lower() + ".kdevelop.pcs",  
+			project()->projectName() + ".kdevelop.pcs");
+    }
+    QFile f(project()->projectDirectory() + "/" + project()->projectName() + ".kdevelop.pcs");
     if( f.open(IO_ReadOnly) ){
 	stream.setDevice( &f );
 
@@ -864,7 +871,8 @@
     if( !project() || fileList.isEmpty() )
 	return;
 
-    QFile f( project()->projectDirectory() + "/" + project()->projectName().lower() + ".kdevelop" + ".pcs" );
+    QFile f( project()->projectDirectory() + "/" + 
+		    project()->projectName() + ".kdevelop.pcs" );
     if( !f.open( IO_WriteOnly ) )
 	return;
 
--- branches/kdevelop/3.4/parts/doxygen/doxygenpart.cpp #622457:622458
@@ -195,7 +195,7 @@
   ConfigString *gen_tag = dynamic_cast<ConfigString*>(Config::instance()->get("GENERATE_TAGFILE"));
   if (gen_tag)
   {
-    gen_tag->setDefaultValue(QString(project()->projectName().lower().remove(".kdevelop")+".tag").latin1());
+    gen_tag->setDefaultValue(QString(project()->projectName()+".tag").latin1());
     gen_tag->init();
   }
 
Comment 2 Achim Spangler 2007-01-12 12:21:35 UTC
THANKS for the quick resolve. It works now FINE for my projects!

(in Bugzilla, I'd mark this now as "CLOSED" ;-)) )