Custom icon support for Sound dir dictionaries - default to no custom icon

This commit is contained in:
Julian Depetris Chauvin 2013-02-02 19:00:19 -03:00
parent 1b04dbf3e9
commit c6cbaa64cd
3 changed files with 7 additions and 7 deletions

View file

@ -309,7 +309,7 @@ Class load() throw( exError )
c.paths.push_back( Path( "/usr/share/dictd", true ) );
if ( QDir( "/usr/share/WyabdcRealPeopleTTS" ).exists() )
c.soundDirs.push_back( SoundDir( "/usr/share/WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS", "" ) );
c.soundDirs.push_back( SoundDir( "/usr/share/WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS" ) );
if ( QDir( "/usr/share/myspell/dicts" ).exists() )
c.hunspell.dictionariesPath = "/usr/share/myspell/dicts";
@ -329,10 +329,10 @@ Class load() throw( exError )
c.paths.push_back( Path( pathToProgramFiles + "\\StarDict\\dic", true ) );
if ( QDir( pathToProgramFiles + "\\StarDict\\WyabdcRealPeopleTTS" ).exists() )
c.soundDirs.push_back( SoundDir( pathToProgramFiles + "\\StarDict\\WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS", "" ) );
c.soundDirs.push_back( SoundDir( pathToProgramFiles + "\\StarDict\\WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS" ) );
else
if ( QDir( pathToProgramFiles + "\\WyabdcRealPeopleTTS" ).exists() )
c.soundDirs.push_back( SoundDir( pathToProgramFiles + "\\WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS", "" ) );
c.soundDirs.push_back( SoundDir( pathToProgramFiles + "\\WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS" ) );
// #### "C:/Program Files" is bad! will not work for German Windows etc.
// #### should be replaced to system path
@ -341,10 +341,10 @@ Class load() throw( exError )
// c.paths.push_back( Path( "C:/Program Files/StarDict/dic", true ) );
//
// if ( QDir( "C:/Program Files/StarDict/WyabdcRealPeopleTTS" ).exists() )
// c.soundDirs.push_back( SoundDir( "C:/Program Files/StarDict/WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS", "" ) );
// c.soundDirs.push_back( SoundDir( "C:/Program Files/StarDict/WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS" ) );
// else
// if ( QDir( "C:/Program Files/WyabdcRealPeopleTTS" ).exists() )
// c.soundDirs.push_back( SoundDir( "C:/Program Files/WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS", "" ) );
// c.soundDirs.push_back( SoundDir( "C:/Program Files/WyabdcRealPeopleTTS", "WyabdcRealPeopleTTS" ) );
#endif

View file

@ -50,7 +50,7 @@ struct SoundDir
SoundDir()
{}
SoundDir( QString const & path_, QString const & name_, QString iconFilename_ ):
SoundDir( QString const & path_, QString const & name_, QString iconFilename_ = "" ):
path( path_ ), name( name_ ), iconFilename( iconFilename_ )
{}

View file

@ -951,7 +951,7 @@ void SoundDirsModel::removeSoundDir( int index )
void SoundDirsModel::addNewSoundDir( QString const & path, QString const & name )
{
beginInsertRows( QModelIndex(), soundDirs.size(), soundDirs.size() );
soundDirs.push_back( Config::SoundDir( path, name, "" ) );
soundDirs.push_back( Config::SoundDir( path, name ) );
endInsertRows();
}