mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
fix : add default groupid to the globalinstance
This commit is contained in:
parent
1284846d27
commit
df2bb387e2
|
@ -170,14 +170,9 @@ QNetworkReply * ArticleNetworkAccessManager::getArticleReply( QNetworkRequest co
|
|||
if( !path.isEmpty() )
|
||||
{
|
||||
url.setPath( "" );
|
||||
QByteArray referer = req.rawHeader( "Referer" );
|
||||
QUrl refererUrl = QUrl::fromEncoded( referer );
|
||||
|
||||
Utils::Url::addQueryItem( url, "word", path.mid( 1 ) );
|
||||
if( Utils::Url::hasQueryItem( refererUrl, "group" ) )
|
||||
{
|
||||
Utils::Url::addQueryItem( url, "group", Utils::Url::queryItemValue( refererUrl, "group" ) );
|
||||
}
|
||||
Utils::Url::addQueryItem( url, "group", QString::number(GlobalBroadcaster::instance()->currentGroupId ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -318,7 +313,7 @@ sptr< Dictionary::DataRequest > ArticleNetworkAccessManager::getResource(
|
|||
|
||||
bool ignoreDiacritics = Utils::Url::queryItemValue( url, "ignore_diacritics" ) == "1";
|
||||
|
||||
if ( phrase.isValid() ) // Require group and phrase to be passed
|
||||
if ( groupIsValid && phrase.isValid() ) // Require group and phrase to be passed
|
||||
return articleMaker.makeDefinitionFor( phrase, group, contexts, mutedDicts, QStringList(), ignoreDiacritics );
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ public:
|
|||
void addWhitelist(QString host);
|
||||
bool existedInWhitelist(QString host);
|
||||
static GlobalBroadcaster * instance();
|
||||
unsigned currentGroupId;
|
||||
|
||||
signals:
|
||||
void dictionaryChanges( ActiveDictIds ad );
|
||||
|
|
|
@ -572,6 +572,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
igrp->checkMutedDictionaries( &grp->mutedDictionaries );
|
||||
dictionaryBar.setMutedDictionaries( grp ? &grp->mutedDictionaries : 0 );
|
||||
}
|
||||
GlobalBroadcaster::instance()->currentGroupId = cfg.lastMainGroupId;
|
||||
|
||||
showDictBarNamesTriggered(); // Make update its state according to initial
|
||||
// setting
|
||||
|
@ -2323,6 +2324,10 @@ void MainWindow::currentGroupChanged( int )
|
|||
dictionaryBar.setMutedDictionaries( 0 );
|
||||
}
|
||||
|
||||
if(igrp){
|
||||
GlobalBroadcaster::instance()->currentGroupId = cfg.lastMainGroupId;
|
||||
}
|
||||
|
||||
updateDictionaryBar();
|
||||
|
||||
// Update word search results
|
||||
|
|
Loading…
Reference in a new issue