mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 07:30:04 +00:00 
			
		
		
		
	Need to wait for application initialization before reading placefiles, and emit placefile enabled when adding an enabled URL
This commit is contained in:
		
							parent
							
								
									6f14745a59
								
							
						
					
					
						commit
						e7da934db1
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		|  | @ -1,5 +1,6 @@ | ||||||
| #include <scwx/qt/manager/placefile_manager.hpp> | #include <scwx/qt/manager/placefile_manager.hpp> | ||||||
| #include <scwx/qt/manager/resource_manager.hpp> | #include <scwx/qt/manager/resource_manager.hpp> | ||||||
|  | #include <scwx/qt/main/application.hpp> | ||||||
| #include <scwx/qt/util/json.hpp> | #include <scwx/qt/util/json.hpp> | ||||||
| #include <scwx/qt/util/network.hpp> | #include <scwx/qt/util/network.hpp> | ||||||
| #include <scwx/gr/placefile.hpp> | #include <scwx/gr/placefile.hpp> | ||||||
|  | @ -131,8 +132,10 @@ PlacefileManager::PlacefileManager() : p(std::make_unique<Impl>(this)) | ||||||
|    boost::asio::post(p->threadPool_, |    boost::asio::post(p->threadPool_, | ||||||
|                      [this]() |                      [this]() | ||||||
|                      { |                      { | ||||||
|                         // Read placefile settings on startup
 |  | ||||||
|                         p->InitializePlacefileSettings(); |                         p->InitializePlacefileSettings(); | ||||||
|  | 
 | ||||||
|  |                         // Read placefile settings on startup
 | ||||||
|  |                         main::Application::WaitForInitialization(); | ||||||
|                         p->ReadPlacefileSettings(); |                         p->ReadPlacefileSettings(); | ||||||
|                      }); |                      }); | ||||||
| } | } | ||||||
|  | @ -397,6 +400,11 @@ void PlacefileManager::AddUrl(const std::string& urlString, | ||||||
| 
 | 
 | ||||||
|    lock.unlock(); |    lock.unlock(); | ||||||
| 
 | 
 | ||||||
|  |    if (enabled) | ||||||
|  |    { | ||||||
|  |       Q_EMIT PlacefileEnabled(normalizedUrl, record->enabled_); | ||||||
|  |    } | ||||||
|  | 
 | ||||||
|    Q_EMIT PlacefileUpdated(normalizedUrl); |    Q_EMIT PlacefileUpdated(normalizedUrl); | ||||||
| 
 | 
 | ||||||
|    // Queue a placefile update
 |    // Queue a placefile update
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat