mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-28 03:44:07 +00:00
Custom icons for morphology dictionaries
This commit is contained in:
parent
5e2727ce71
commit
afb4b66e15
22
hunspell.cc
22
hunspell.cc
|
@ -19,6 +19,7 @@
|
||||||
#include <hunspell/hunspell.hxx>
|
#include <hunspell/hunspell.hxx>
|
||||||
#include "dprintf.hh"
|
#include "dprintf.hh"
|
||||||
#include "fsencoding.hh"
|
#include "fsencoding.hh"
|
||||||
|
#include <QFileInfo>
|
||||||
|
|
||||||
namespace HunspellMorpho {
|
namespace HunspellMorpho {
|
||||||
|
|
||||||
|
@ -70,9 +71,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void loadIcon() throw()
|
virtual void loadIcon() throw();
|
||||||
{ dictionaryIcon = dictionaryNativeIcon = QIcon(":/icons/icon32_hunspell.png");
|
|
||||||
dictionaryIconLoaded = true; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -109,6 +108,23 @@ bool containsWhitespace( wstring const & str )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HunspellDictionary::loadIcon() throw()
|
||||||
|
{
|
||||||
|
QString fileName =
|
||||||
|
QDir::fromNativeSeparators( FsEncoding::decode( getDictionaryFilenames()[ 0 ].c_str() ) );
|
||||||
|
|
||||||
|
// Remove the extension
|
||||||
|
fileName.chop( 3 );
|
||||||
|
|
||||||
|
if( !loadIconFromFile( fileName ) )
|
||||||
|
{
|
||||||
|
// Load failed -- use default icons
|
||||||
|
dictionaryNativeIcon = dictionaryIcon = QIcon(":/icons/icon32_hunspell.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
dictionaryIconLoaded = true;
|
||||||
|
}
|
||||||
|
|
||||||
/// HunspellDictionary::getArticle()
|
/// HunspellDictionary::getArticle()
|
||||||
|
|
||||||
class HunspellArticleRequest;
|
class HunspellArticleRequest;
|
||||||
|
|
Loading…
Reference in a new issue