Reset the service when connecting a second time and fetch posts after
connected
This commit is contained in:
parent
aaf8adf560
commit
5f07fe2ea1
1 changed files with 3 additions and 0 deletions
|
@ -106,6 +106,7 @@ DanbooruMainWindow::DanbooruMainWindow(QWidget *parent)
|
|||
// connections
|
||||
|
||||
connect(m_connectWidget, &DanbooruConnectWidget::accepted, [this]() {
|
||||
|
||||
m_service->setBoardUrl(m_connectWidget->boardUrl());
|
||||
if (!m_connectWidget->isAnonymous() && !m_connectWidget->username().isEmpty()
|
||||
&& !m_connectWidget->password().isEmpty()) {
|
||||
|
@ -116,6 +117,7 @@ DanbooruMainWindow::DanbooruMainWindow(QWidget *parent)
|
|||
|
||||
actionCollection()->action(QLatin1String("fetch"))->setEnabled(true);
|
||||
m_connectWidget->hide();
|
||||
m_service->getPostList();
|
||||
|
||||
});
|
||||
|
||||
|
@ -176,6 +178,7 @@ void DanbooruMainWindow::connectToBoard()
|
|||
}
|
||||
|
||||
m_model->clear();
|
||||
m_service->reset();
|
||||
m_connectWidget->show();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue