mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-28 07:54:06 +00:00
commit
1bd13a2630
|
@ -35,8 +35,7 @@ class Writer
|
|||
size_t scratchPadOffset, scratchPadSize;
|
||||
|
||||
public:
|
||||
|
||||
Writer( File::Class & );
|
||||
explicit Writer( File::Class & );
|
||||
|
||||
/// Starts new block. Returns its address.
|
||||
uint32_t startNewBlock();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
class WordListItemDelegate : public QStyledItemDelegate
|
||||
{
|
||||
public:
|
||||
WordListItemDelegate( QAbstractItemDelegate * delegate );
|
||||
explicit WordListItemDelegate( QAbstractItemDelegate * delegate );
|
||||
virtual void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
|
||||
|
||||
private:
|
||||
|
|
|
@ -71,7 +71,7 @@ struct ArticleDom
|
|||
|
||||
/// Does the parse at construction. Refer to the 'root' member variable
|
||||
/// afterwards.
|
||||
ArticleDom( wstring const &, string const & dictName = string(),
|
||||
explicit ArticleDom( wstring const &, string const & dictName = string(),
|
||||
wstring const & headword_ = wstring() );
|
||||
|
||||
/// Root of DOM's tree
|
||||
|
@ -128,7 +128,7 @@ public:
|
|||
DEF_EX( exUnknownCodePage, "The .dsl file specified an unknown code page", Ex )
|
||||
DEF_EX( exEncodingError, "Encoding error", Ex ) // Should never happen really
|
||||
|
||||
DslScanner( string const & fileName ) ;
|
||||
explicit DslScanner( string const & fileName ) ;
|
||||
~DslScanner() noexcept;
|
||||
|
||||
/// Returns the detected encoding of this file.
|
||||
|
|
2
ex.hh
2
ex.hh
|
@ -30,7 +30,7 @@ virtual ~exName() noexcept {} };
|
|||
class exName: public exParent { \
|
||||
std::string value; \
|
||||
public: \
|
||||
exName( std::string const & value_ ): value( std::string( exDescription ) + " " + value_ ) {} \
|
||||
explicit exName( std::string const & value_ ): value( std::string( exDescription ) + " " + value_ ) {} \
|
||||
virtual const char * what() const noexcept { return value.c_str(); } \
|
||||
virtual ~exName() noexcept {} };
|
||||
|
||||
|
|
|
@ -208,12 +208,12 @@ void FavoritesPaneWidget::onSelectionChanged( QItemSelection const & selection )
|
|||
return;
|
||||
|
||||
itemSelectionChanged = true;
|
||||
// emitFavoritesItemRequested( selection.indexes().front() );
|
||||
emitFavoritesItemRequested( selection.indexes().front() );
|
||||
}
|
||||
|
||||
void FavoritesPaneWidget::onItemClicked( QModelIndex const & idx )
|
||||
{
|
||||
// if ( !itemSelectionChanged && m_favoritesTree->selectionModel()->selectedIndexes().size() == 1 )
|
||||
if ( !itemSelectionChanged && m_favoritesTree->selectionModel()->selectedIndexes().size() == 1 )
|
||||
{
|
||||
emitFavoritesItemRequested( idx );
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ class TreeItem
|
|||
public:
|
||||
enum Type { Word, Folder, Root };
|
||||
|
||||
TreeItem( const QVariant &data, TreeItem *parent = 0, Type type_ = Word );
|
||||
explicit TreeItem( const QVariant &data, TreeItem *parent = 0, Type type_ = Word );
|
||||
~TreeItem();
|
||||
|
||||
void appendChild( TreeItem * child );
|
||||
|
|
|
@ -392,7 +392,7 @@ bool DecoderContext::normalizeAudio( AVFrame * frame, vector<uint8_t > & samples
|
|||
auto dst_freq = 44100;
|
||||
auto dst_channels = codecContext_->channels;
|
||||
int out_count = (int64_t) frame->nb_samples * dst_freq / frame->sample_rate + 256;
|
||||
int out_size = av_samples_get_buffer_size( NULL, dst_channels, out_count, AV_SAMPLE_FMT_S16, 0 );
|
||||
int out_size = av_samples_get_buffer_size( NULL, dst_channels, out_count, AV_SAMPLE_FMT_S16, 1 );
|
||||
samples.resize( out_size );
|
||||
uint8_t * data[ 2 ] = { 0 };
|
||||
data[ 0 ] = &samples.front();
|
||||
|
@ -409,7 +409,7 @@ bool DecoderContext::normalizeAudio( AVFrame * frame, vector<uint8_t > & samples
|
|||
// qDebug( "out_count:%d, out_nb_samples:%d, frame->nb_samples:%d \n", out_count, out_nb_samples, frame->nb_samples );
|
||||
}
|
||||
|
||||
int actual_size = av_samples_get_buffer_size( NULL, dst_channels, out_nb_samples, AV_SAMPLE_FMT_S16, 0 );
|
||||
int actual_size = av_samples_get_buffer_size( NULL, dst_channels, out_nb_samples, AV_SAMPLE_FMT_S16, 1 );
|
||||
samples.resize(actual_size);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
|
||||
/// Loads history from its file. If load fails, the result would be an empty
|
||||
/// history. The size parameter is same as in other constructor.
|
||||
History( Load, unsigned size = 20, unsigned maxItemLength = DEFAULT_MAX_HISTORY_ITEM_LENGTH );
|
||||
explicit History( Load, unsigned size = 20, unsigned maxItemLength = DEFAULT_MAX_HISTORY_ITEM_LENGTH );
|
||||
|
||||
/// Adds new item. The item is always added at the beginning of the list.
|
||||
/// If there was such an item already somewhere on the list, it gets removed
|
||||
|
|
|
@ -202,14 +202,14 @@ void HistoryPaneWidget::onSelectionChanged( QItemSelection const & selection )
|
|||
return;
|
||||
|
||||
itemSelectionChanged = true;
|
||||
// emitHistoryItemRequested( selection.front().topLeft() );
|
||||
emitHistoryItemRequested( selection.front().topLeft() );
|
||||
}
|
||||
|
||||
void HistoryPaneWidget::onItemClicked( QModelIndex const & idx )
|
||||
{
|
||||
// qDebug() << "clicked";
|
||||
|
||||
// if ( !itemSelectionChanged )
|
||||
if ( !itemSelectionChanged )
|
||||
{
|
||||
emitHistoryItemRequested( idx );
|
||||
}
|
||||
|
|
|
@ -79,8 +79,6 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data )
|
|||
|
||||
case ZipFile::Deflated:
|
||||
{
|
||||
GD_DPRINTF( "Deflated" );
|
||||
|
||||
// Now do the deflation
|
||||
|
||||
QByteArray compressedData = zip.read( header.compressedSize );
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
<message>
|
||||
<location filename="../article_maker.cc" line="236"/>
|
||||
<source><h3 align="center">Welcome to <b>GoldenDict</b>!</h3><p>To start working with the program, first visit <b>Edit|Dictionaries</b> to add some directory paths where to search for the dictionary files, set up various Wikipedia sites or other sources, adjust dictionary order or create dictionary groups.<p>And then you're ready to look up your words! You can do that in this window by using a pane to the left, or you can <a href="Working with popup">look up words from other active applications</a>. <p>To customize program, check out the available preferences at <b>Edit|Preferences</b>. All settings there have tooltips, be sure to read them if you are in doubt about anything.<p>Should you need further help, have any questions, suggestions or just wonder what the others think, you are welcome at the program's <a href="http://goldendict.org/forum/">forum</a>.<p>Check program's <a href="http://goldendict.org/">website</a> for the updates. <p>(c) 2008-2013 Konstantin Isakov. Licensed under GPLv3 or later.</source>
|
||||
<translation><h3 align="center">欢迎使用 <b>GoldenDict</b> 词典程序!</h3><p style="text-indent:2em">使用时请首先打开<b>编辑 | 词典</b>菜单以添加并扫描含有词典文件的目录,添加维基百科网站查询或其它资源,调整词典排序或创建新的词典群组。<p style="text-indent:2em">这些设置都完成以后,就可以开始使用了。你可以使用左侧的查询面板,或者<a href="使用屏幕取词功能">直接从其它程序中抓词查询</a>。<p style="text-indent:2em">如需要改变设置,可以在<b>编辑 | 首选项</b>菜单中查看一下可用的系统设置。所有的设置都有鼠标指针提示信息,如果有不明之处,请仔细阅读提示信息。<p style="text-indent:2em">如果你需要更多帮助,有任何疑问、建议,或者仅仅想了解其他人的想法,欢迎访问此程序的<a href="http://goldendict.org/forum/">官方论坛</a>。<p style="text-indent:2em">访问此程序的<a href="http://goldendict.org/">官方网站</a>以获取更新。<p style="text-indent:2em">(c) 2008-2013 Konstantin Isakov. 授权基于 GPLv3 或更高版本。</translation>
|
||||
<translation><h3 align="center">欢迎使用 <b>GoldenDict</b> 词典程序!</h3><p style="text-indent:2em">使用时请首先打开<b>编辑 | 词典</b>菜单以添加并扫描含有词典文件的目录,添加维基百科网站查询或其它资源,调整词典排序或创建新的词典群组。这些设置都完成以后,就可以开始使用了。你可以使用左侧的查询面板,或者<a href="使用屏幕取词功能">直接从其它程序中抓词查询</a>。<p style="text-indent:2em">如需要改变设置,可以在<b>编辑 | 首选项</b>菜单中查看一下可用的系统设置。所有的设置都有鼠标指针提示信息,如果有不明之处,请仔细阅读提示信息。如果你需要更多帮助,有任何疑问、建议,或者仅仅想了解其他人的想法,欢迎访问此程序的<a href="http://goldendict.org/forum/">官方论坛</a>。访问此程序的<a href="http://goldendict.org/">官方网站</a>以获取更新。<p style="text-indent:2em">(c) 2008-2013 Konstantin Isakov. 授权基于 GPLv3 或更高版本。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../article_maker.cc" line="360"/>
|
||||
|
|
Loading…
Reference in a new issue