mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Custom icon support for Sound dir dictionaries - default to no custom icon
This commit is contained in:
parent
1b04dbf3e9
commit
c6cbaa64cd
10
config.cc
10
config.cc
|
@ -309,7 +309,7 @@ Class load() throw( exError )
|
||||||
c.paths.push_back( Path( "/usr/share/dictd", true ) );
|
c.paths.push_back( Path( "/usr/share/dictd", true ) );
|
||||||
|
|
||||||
if ( QDir( "/usr/share/WyabdcRealPeopleTTS" ).exists() )
|
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() )
|
if ( QDir( "/usr/share/myspell/dicts" ).exists() )
|
||||||
c.hunspell.dictionariesPath = "/usr/share/myspell/dicts";
|
c.hunspell.dictionariesPath = "/usr/share/myspell/dicts";
|
||||||
|
@ -329,10 +329,10 @@ Class load() throw( exError )
|
||||||
c.paths.push_back( Path( pathToProgramFiles + "\\StarDict\\dic", true ) );
|
c.paths.push_back( Path( pathToProgramFiles + "\\StarDict\\dic", true ) );
|
||||||
|
|
||||||
if ( QDir( pathToProgramFiles + "\\StarDict\\WyabdcRealPeopleTTS" ).exists() )
|
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
|
else
|
||||||
if ( QDir( pathToProgramFiles + "\\WyabdcRealPeopleTTS" ).exists() )
|
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.
|
// #### "C:/Program Files" is bad! will not work for German Windows etc.
|
||||||
// #### should be replaced to system path
|
// #### 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 ) );
|
// c.paths.push_back( Path( "C:/Program Files/StarDict/dic", true ) );
|
||||||
//
|
//
|
||||||
// if ( QDir( "C:/Program Files/StarDict/WyabdcRealPeopleTTS" ).exists() )
|
// 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
|
// else
|
||||||
// if ( QDir( "C:/Program Files/WyabdcRealPeopleTTS" ).exists() )
|
// 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
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ struct SoundDir
|
||||||
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_ )
|
path( path_ ), name( name_ ), iconFilename( iconFilename_ )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
@ -951,7 +951,7 @@ void SoundDirsModel::removeSoundDir( int index )
|
||||||
void SoundDirsModel::addNewSoundDir( QString const & path, QString const & name )
|
void SoundDirsModel::addNewSoundDir( QString const & path, QString const & name )
|
||||||
{
|
{
|
||||||
beginInsertRows( QModelIndex(), soundDirs.size(), soundDirs.size() );
|
beginInsertRows( QModelIndex(), soundDirs.size(), soundDirs.size() );
|
||||||
soundDirs.push_back( Config::SoundDir( path, name, "" ) );
|
soundDirs.push_back( Config::SoundDir( path, name ) );
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue