mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	HTML: remove theme file if already exist in the export directory
as QFile:copy doesn't overwrite files by default, we must check before copying if file exist and remove it. We must be able to overwrite files here, user is already notified and choosed to replace them. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									262472c9de
								
							
						
					
					
						commit
						d363722c16
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -90,6 +90,12 @@ void DiveLogExportDialog::exportHtmlInit(const QString &filename) | |||
| 	QFile::copy(searchPath + "dive_export.html", filename); | ||||
| 	QFile::copy(searchPath + "list_lib.js", exportFiles + "list_lib.js"); | ||||
| 	QFile::copy(searchPath + "poster.png", exportFiles + "poster.png"); | ||||
| 
 | ||||
| 	// Remove theme file if already exist in the export dir
 | ||||
| 	QFile theme(exportFiles + "theme.css"); | ||||
| 	if (theme.exists()) | ||||
| 		theme.remove(); | ||||
| 
 | ||||
| 	QFile::copy(searchPath + (ui->themeSelection->currentText() == "Light" ? "light.css" : "sand.css"), | ||||
| 		    exportFiles + "theme.css"); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue