mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	core: move process_import_dives() and related functions to divelog
These functions accessed the global divelog make this explicit. I'm still not happy about the situation, because these functions access global state, such as the selection. I think these should be moved up the call-chain. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									b34116e2e2
								
							
						
					
					
						commit
						176f544106
					
				
					 14 changed files with 500 additions and 494 deletions
				
			
		| 
						 | 
				
			
			@ -419,7 +419,7 @@ void MainWindow::on_actionCloudstorageopen_triggered()
 | 
			
		|||
	std::string encoded = encodeFileName(*filename);
 | 
			
		||||
	if (!parse_file(encoded.c_str(), &divelog))
 | 
			
		||||
		setCurrentFile(encoded);
 | 
			
		||||
	process_loaded_dives();
 | 
			
		||||
	divelog.process_loaded_dives();
 | 
			
		||||
	hideProgressBar();
 | 
			
		||||
	refreshDisplay();
 | 
			
		||||
	updateAutogroup();
 | 
			
		||||
| 
						 | 
				
			
			@ -1313,7 +1313,7 @@ void MainWindow::importFiles(const std::vector<std::string> &fileNames)
 | 
			
		|||
		parse_file(encoded.c_str(), &log);
 | 
			
		||||
	}
 | 
			
		||||
	QString source = fileNames.size() == 1 ? QString::fromStdString(fileNames[0]) : tr("multiple files");
 | 
			
		||||
	Command::importDives(&log, IMPORT_MERGE_ALL_TRIPS, source);
 | 
			
		||||
	Command::importDives(&log, import_flags::merge_all_trips, source);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void MainWindow::loadFiles(const std::vector<std::string> &fileNames)
 | 
			
		||||
| 
						 | 
				
			
			@ -1334,7 +1334,7 @@ void MainWindow::loadFiles(const std::vector<std::string> &fileNames)
 | 
			
		|||
	}
 | 
			
		||||
	hideProgressBar();
 | 
			
		||||
	updateRecentFiles();
 | 
			
		||||
	process_loaded_dives();
 | 
			
		||||
	divelog.process_loaded_dives();
 | 
			
		||||
 | 
			
		||||
	refreshDisplay();
 | 
			
		||||
	updateAutogroup();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue