Make type variable const
This commit is contained in:
		
							parent
							
								
									2788c19c85
								
							
						
					
					
						commit
						3a021f4e49
					
				
					 1 changed files with 24 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -447,27 +447,31 @@ bool ResolveSettings(
 | 
			
		|||
	}
 | 
			
		||||
	controller->window().activate();
 | 
			
		||||
	const auto section = match->captured(1).mid(1).toLower();
 | 
			
		||||
	auto type = ::Settings::Main::Id();
 | 
			
		||||
	
 | 
			
		||||
	const auto getSectionType = [&]() -> std::optional<::Settings::Type> {
 | 
			
		||||
		if (section.isEmpty()) {
 | 
			
		||||
		controller->window().showSettings();
 | 
			
		||||
		return true;
 | 
			
		||||
			return ::Settings::Main::Id();
 | 
			
		||||
		} else if (section == qstr("language")) {
 | 
			
		||||
			ShowLanguagesBox();
 | 
			
		||||
		return true;
 | 
			
		||||
		} else if (section == qstr("devices")) {
 | 
			
		||||
			controller->session().api().authorizations().reload();
 | 
			
		||||
		type = ::Settings::Sessions::Id();
 | 
			
		||||
			return ::Settings::Sessions::Id();
 | 
			
		||||
		} else if (section == qstr("folders")) {
 | 
			
		||||
		type = ::Settings::Folders::Id();
 | 
			
		||||
			return ::Settings::Folders::Id();
 | 
			
		||||
		} else if (section == qstr("privacy")) {
 | 
			
		||||
		type = ::Settings::PrivacySecurity::Id();
 | 
			
		||||
			return ::Settings::PrivacySecurity::Id();
 | 
			
		||||
		} else if (section == qstr("themes")) {
 | 
			
		||||
		type = ::Settings::Chat::Id();
 | 
			
		||||
			return ::Settings::Chat::Id();
 | 
			
		||||
		} else if (section == qstr("change_number")) {
 | 
			
		||||
		type = ::Settings::ChangePhone::Id();
 | 
			
		||||
			return ::Settings::ChangePhone::Id();
 | 
			
		||||
		}
 | 
			
		||||
	controller->showSettings(type);
 | 
			
		||||
		return {};
 | 
			
		||||
	};
 | 
			
		||||
	
 | 
			
		||||
	if (const auto type = getSectionType()) {
 | 
			
		||||
		controller->showSettings(*type);
 | 
			
		||||
		controller->window().activate();
 | 
			
		||||
	}
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue