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
 | 
					    // connections
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    connect(m_connectWidget, &DanbooruConnectWidget::accepted, [this]() {
 | 
					    connect(m_connectWidget, &DanbooruConnectWidget::accepted, [this]() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        m_service->setBoardUrl(m_connectWidget->boardUrl());
 | 
					        m_service->setBoardUrl(m_connectWidget->boardUrl());
 | 
				
			||||||
        if (!m_connectWidget->isAnonymous() && !m_connectWidget->username().isEmpty()
 | 
					        if (!m_connectWidget->isAnonymous() && !m_connectWidget->username().isEmpty()
 | 
				
			||||||
            && !m_connectWidget->password().isEmpty()) {
 | 
					            && !m_connectWidget->password().isEmpty()) {
 | 
				
			||||||
| 
						 | 
					@ -116,6 +117,7 @@ DanbooruMainWindow::DanbooruMainWindow(QWidget *parent)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        actionCollection()->action(QLatin1String("fetch"))->setEnabled(true);
 | 
					        actionCollection()->action(QLatin1String("fetch"))->setEnabled(true);
 | 
				
			||||||
        m_connectWidget->hide();
 | 
					        m_connectWidget->hide();
 | 
				
			||||||
 | 
					        m_service->getPostList();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -176,6 +178,7 @@ void DanbooruMainWindow::connectToBoard()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    m_model->clear();
 | 
					    m_model->clear();
 | 
				
			||||||
 | 
					    m_service->reset();
 | 
				
			||||||
    m_connectWidget->show();
 | 
					    m_connectWidget->show();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue