mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 08:32:43 +00:00 
			
		
		
		
	ChanViewer: Fetch the list of boards and allow switching the board
We put the list of boards in a combo box and allow the user to switch boards that way. :^)
This commit is contained in:
		
							parent
							
								
									6311a617be
								
							
						
					
					
						commit
						7a63277115
					
				
					 6 changed files with 145 additions and 1 deletions
				
			
		|  | @ -16,11 +16,19 @@ ThreadCatalogModel::~ThreadCatalogModel() | |||
| { | ||||
| } | ||||
| 
 | ||||
| void ThreadCatalogModel::set_board(const String& board) | ||||
| { | ||||
|     if (m_board == board) | ||||
|         return; | ||||
|     m_board = board; | ||||
|     update(); | ||||
| } | ||||
| 
 | ||||
| void ThreadCatalogModel::update() | ||||
| { | ||||
|     CHttpRequest request; | ||||
|     request.set_hostname("a.4cdn.org"); | ||||
|     request.set_path("/g/catalog.json"); | ||||
|     request.set_path(String::format("/%s/catalog.json", m_board.characters())); | ||||
| 
 | ||||
|     auto* job = request.schedule(); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling