Commit 983a45f025d11d554fb4b47337de258be125c0af

  • avatar
  • Nikolaj Hald Nielsen <nhn @k…e.org>
  • Sat Mar 13 14:46:19 CET 2010
Also allow moodbar file with no leading '.'

ChangeLog++
ChangeLog
(2 / 0)
  
77 FEATURES:
88
99 CHANGES:
10 * Allow moodbar files witout the leading '.' (both .<trackfilename>.mood
11 and <trackfilename>.mood now work)
1012
1113 BUGFIXES:
1214
  
9999 if( !QFile::exists( moodFilePath ) )
100100 {
101101 debug() << "no such file";
102 m_hasMoodMap.insert( track, false );
103 return false;
102 //for fun, try without the leading '.'
103
104 QFileInfo fInfo( moodFilePath );
105 QString testName = fInfo.fileName();
106 testName.remove( 0, 1 );
107
108 moodFilePath.replace( fInfo.fileName(), testName );
109
110 debug() << "trying : " << moodFilePath;
111 if( !QFile::exists( moodFilePath ) )
112 {
113 debug() << "no luck removing the leading '.' either...";
114 m_hasMoodMap.insert( track, false );
115 return false;
116 }
117
118 debug() << "whoops, missing leading '.', so mood file path: " << moodFilePath;
104119 }
105120
106121 //it is a local file with a matching .mood file. Good enough for now!