mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 01:10:04 +00:00 
			
		
		
		
	Move mbgl cache to application local data storage
This commit is contained in:
		
							parent
							
								
									5489552ff3
								
							
						
					
					
						commit
						e075e88c7f
					
				
					 2 changed files with 19 additions and 2 deletions
				
			
		|  | @ -14,6 +14,7 @@ | |||
| #include <QFileDialog> | ||||
| #include <QMessageBox> | ||||
| #include <QSplitter> | ||||
| #include <QStandardPaths> | ||||
| #include <QToolButton> | ||||
| 
 | ||||
| #include <boost/log/trivial.hpp> | ||||
|  | @ -41,7 +42,23 @@ public: | |||
|        elevationButtonsChanged_ {false}, | ||||
|        resizeElevationButtons_ {false} | ||||
|    { | ||||
|       settings_.setCacheDatabasePath("/tmp/mbgl-cache.db"); | ||||
|       std::string appDataPath { | ||||
|          QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) | ||||
|             .toStdString()}; | ||||
|       std::string cacheDbPath {appDataPath + "/mbgl-cache.db"}; | ||||
| 
 | ||||
|       if (!std::filesystem::exists(appDataPath)) | ||||
|       { | ||||
|          if (!std::filesystem::create_directories(appDataPath)) | ||||
|          { | ||||
|             BOOST_LOG_TRIVIAL(error) | ||||
|                << logPrefix_ | ||||
|                << "Unable to create application local data directory: \"" | ||||
|                << appDataPath << "\""; | ||||
|          } | ||||
|       } | ||||
| 
 | ||||
|       settings_.setCacheDatabasePath(QString {cacheDbPath.c_str()}); | ||||
|       settings_.setCacheDatabaseMaximumSize(20 * 1024 * 1024); | ||||
|    } | ||||
|    ~MainWindowImpl() = default; | ||||
|  |  | |||
|  | @ -102,7 +102,7 @@ | |||
| <context> | ||||
|     <name>scwx::qt::main::MainWindow</name> | ||||
|     <message> | ||||
|         <location filename="../source/scwx/qt/main/main_window.cpp" line="262"/> | ||||
|         <location filename="../source/scwx/qt/main/main_window.cpp" line="279"/> | ||||
|         <source>Unrecognized NEXRAD Product:</source> | ||||
|         <translation type="unfinished"></translation> | ||||
|     </message> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat