Skip to content

有办法不创建MainWindow类实例的情况下获得完整可用功能的ArticleNetworkAccessManager类吗? #1826

Answered by 94Bo
94Bo asked this question in Q&A
Discussion options

You must be logged in to vote

整理清楚了

// disable none local dictionaries
cfg.webSites.clear();
cfg.mediawikis.clear();
cfg.dictServers.clear();

// instanciate articleNetMgr
GlobalBroadcaster::instance()->setPreference( &cfg.preferences );
vector< sptr< Dictionary::Class > > dictionaries;
Instances::Groups groupInstances;
QNetworkAccessManager dictNetMgr;
ArticleMaker articleMaker( dictionaries, groupInstances, cfg.preferences );
ArticleNetworkAccessManager articleNetMgr( &app,
                                            dictionaries,
                                            articleMaker,
                                            cfg.preferences.disallowContentFromOtherSites,
                                       …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@94Bo
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by 94Bo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants