Skip to content

Commit

Permalink
fixed missing references to site, disabled constructor that allowed that
Browse files Browse the repository at this point in the history
  • Loading branch information
benapetr committed Oct 19, 2017
1 parent 3974607 commit 11fcf6c
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 14 deletions.
7 changes: 0 additions & 7 deletions huggle/apiquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ ApiQuery::ApiQuery()
this->Type = QueryApi;
}

ApiQuery::ApiQuery(Action action)
{
this->RequestFormat = XML;
this->Type = QueryApi;
this->SetAction(action);
}

ApiQuery::ApiQuery(Action action, WikiSite *site)
{
this->RequestFormat = XML;
Expand Down
1 change: 0 additions & 1 deletion huggle/apiquery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ namespace Huggle
public:
//! Creates a new instance of this class and set the defaults
explicit ApiQuery();
explicit ApiQuery(Action action);
explicit ApiQuery(Action action, WikiSite *site);
~ApiQuery();
Action GetAction();
Expand Down
2 changes: 1 addition & 1 deletion huggle/extension_list/extension-thanks
4 changes: 2 additions & 2 deletions huggle/login.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ bool Login::RetrieveGlobalConfig()
}
this->loadingForm->ModifyIcon(this->GlobalRow, LoadingForm_Icon_Loading);
this->Update(_l("[[login-progress-global]]"));
this->qConfig = new ApiQuery(ActionQuery);
this->qConfig = new ApiQuery(ActionQuery, nullptr);
this->qConfig->OverrideWiki = hcfg->GlobalConfigurationWikiAddress;
this->qConfig->Parameters = "prop=revisions&rvprop=content&rvlimit=1&titles=" + hcfg->SystemConfig_GlobalConfigYAML;
this->qConfig->Process();
Expand Down Expand Up @@ -1413,7 +1413,7 @@ void Login::OnTimerTick()
void Login::on_pushButton_clicked()
{
this->Disable();
this->qDatabase = new ApiQuery(ActionQuery);
this->qDatabase = new ApiQuery(ActionQuery, nullptr);
this->Refreshing = true;
hcfg->SystemConfig_UsingSSL = this->ui->checkBox->isChecked();
this->timer->start(HUGGLE_TIMER);
Expand Down
2 changes: 1 addition & 1 deletion huggle/reloginform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void ReloginForm::LittleTick()
return;
}
QString token = login_->GetAttribute("token");
this->qReloginPw = new ApiQuery(ActionLogin);
this->qReloginPw = new ApiQuery(ActionLogin, nullptr);
this->qReloginPw->HiddenQuery = true;
this->qReloginPw->Parameters = "lgname=" + QUrl::toPercentEncoding(Configuration::HuggleConfiguration->SystemConfig_Username)
+ "&lgpassword=" + QUrl::toPercentEncoding(this->ui->lineEdit->text()) + "&lgtoken=" + QUrl::toPercentEncoding(token);
Expand Down
2 changes: 1 addition & 1 deletion huggle/requestprotect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void RequestProtect::Tick()

void Huggle::RequestProtect::on_pushButton_clicked()
{
this->qRFPPage = new ApiQuery(ActionQuery);
this->qRFPPage = new ApiQuery(ActionQuery, this->page->GetSite());
// if this wiki has the requests in separate section, get it, if not, we get a whole page
if (this->page->GetSite()->GetProjectConfig()->RFPP_Section == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion huggle/revertquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ bool RevertQuery::ProcessRevert()
}
this->CustomStatus = "Retrieving content of previous version";
// now we need to get the content of page
this->qRetrieve = new ApiQuery(ActionQuery);
this->qRetrieve = new ApiQuery(ActionQuery, this->GetSite());
this->qRetrieve->Parameters = "prop=revisions&revids=" + QString::number(this->SR_RevID) + "&rvprop=" +
QUrl::toPercentEncoding("ids|content");
this->qRetrieve->Process();
Expand Down

0 comments on commit 11fcf6c

Please sign in to comment.