mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	replace deprecated qSort() with std::sort()
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
This commit is contained in:
		
							parent
							
								
									d19cfec457
								
							
						
					
					
						commit
						e3d43b5696
					
				
					 6 changed files with 10 additions and 8 deletions
				
			
		| 
						 | 
					@ -184,8 +184,10 @@ void fill_computer_list()
 | 
				
			||||||
		descriptorLookup[QString(vendor) + QString(product)] = descriptor;
 | 
							descriptorLookup[QString(vendor) + QString(product)] = descriptor;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	dc_iterator_free(iterator);
 | 
						dc_iterator_free(iterator);
 | 
				
			||||||
	Q_FOREACH (QString vendor, vendorList)
 | 
						Q_FOREACH (QString vendor, vendorList) {
 | 
				
			||||||
		qSort(productList[vendor]);
 | 
							auto &l = productList[vendor];
 | 
				
			||||||
 | 
							std::sort(l.begin(), l.end());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
 | 
					#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
 | 
				
			||||||
	/* currently suppress the Uemis Zurich on Q_OS_ANDROID and Q_OS_IOS,
 | 
						/* currently suppress the Uemis Zurich on Q_OS_ANDROID and Q_OS_IOS,
 | 
				
			||||||
| 
						 | 
					@ -212,7 +214,7 @@ void fill_computer_list()
 | 
				
			||||||
	descriptorLookup["UemisZurich"] = (dc_descriptor_t *)mydescriptor;
 | 
						descriptorLookup["UemisZurich"] = (dc_descriptor_t *)mydescriptor;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	qSort(vendorList);
 | 
						std::sort(vendorList.begin(), vendorList.end());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define NUMTRANSPORTS 7
 | 
					#define NUMTRANSPORTS 7
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -394,7 +394,7 @@ void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsedOrdered)
 | 
				
			||||||
	Q_FOREACH(const QString& gas, gasUsed.keys()) {
 | 
						Q_FOREACH(const QString& gas, gasUsed.keys()) {
 | 
				
			||||||
		gasUsedOrdered.append(qMakePair(gas, gasUsed[gas]));
 | 
							gasUsedOrdered.append(qMakePair(gas, gasUsed[gas]));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	qSort(gasUsedOrdered.begin(), gasUsedOrdered.end(), lessThan);
 | 
						std::sort(gasUsedOrdered.begin(), gasUsedOrdered.end(), lessThan);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString getUserAgent()
 | 
					QString getUserAgent()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -402,7 +402,7 @@ void DiveListView::selectDives(const QList<int> &newDiveSelection)
 | 
				
			||||||
	// select the dives, highest index first - this way the oldest of the dives
 | 
						// select the dives, highest index first - this way the oldest of the dives
 | 
				
			||||||
	// becomes the selected_dive that we scroll to
 | 
						// becomes the selected_dive that we scroll to
 | 
				
			||||||
	QList<int> sortedSelection = newDiveSelection;
 | 
						QList<int> sortedSelection = newDiveSelection;
 | 
				
			||||||
	qSort(sortedSelection.begin(), sortedSelection.end());
 | 
						std::sort(sortedSelection.begin(), sortedSelection.end());
 | 
				
			||||||
	newSelection = firstInList = sortedSelection.first();
 | 
						newSelection = firstInList = sortedSelection.first();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (!sortedSelection.isEmpty())
 | 
						while (!sortedSelection.isEmpty())
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,7 +97,7 @@ bool abstractpreferenceswidget_lessthan(AbstractPreferencesWidget *p1, AbstractP
 | 
				
			||||||
void PreferencesDialog::addPreferencePage(AbstractPreferencesWidget *page)
 | 
					void PreferencesDialog::addPreferencePage(AbstractPreferencesWidget *page)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	pages.push_back(page);
 | 
						pages.push_back(page);
 | 
				
			||||||
	qSort(pages.begin(), pages.end(), abstractpreferenceswidget_lessthan);
 | 
						std::sort(pages.begin(), pages.end(), abstractpreferenceswidget_lessthan);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PreferencesDialog::refreshPages()
 | 
					void PreferencesDialog::refreshPages()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -56,7 +56,7 @@ void PrintOptions::setupTemplates()
 | 
				
			||||||
	// temp. store the template from options, as addItem() updates it via:
 | 
						// temp. store the template from options, as addItem() updates it via:
 | 
				
			||||||
	// on_printTemplate_currentIndexChanged()
 | 
						// on_printTemplate_currentIndexChanged()
 | 
				
			||||||
	QString storedTemplate = printOptions->p_template;
 | 
						QString storedTemplate = printOptions->p_template;
 | 
				
			||||||
	qSort(currList);
 | 
						currList.sort();
 | 
				
			||||||
	int current_index = 0;
 | 
						int current_index = 0;
 | 
				
			||||||
	ui.printTemplate->clear();
 | 
						ui.printTemplate->clear();
 | 
				
			||||||
	Q_FOREACH(const QString& theme, currList) {
 | 
						Q_FOREACH(const QString& theme, currList) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,7 +77,7 @@ QVariant LocationInformationModel::data(const QModelIndex &index, int role) cons
 | 
				
			||||||
void LocationInformationModel::update()
 | 
					void LocationInformationModel::update()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	beginResetModel();
 | 
						beginResetModel();
 | 
				
			||||||
	qSort(dive_site_table.dive_sites, dive_site_table.dive_sites + dive_site_table.nr, dive_site_less_than);
 | 
						std::sort(dive_site_table.dive_sites, dive_site_table.dive_sites + dive_site_table.nr, dive_site_less_than);
 | 
				
			||||||
	locationNames.clear();
 | 
						locationNames.clear();
 | 
				
			||||||
	for (int i = 0; i < dive_site_table.nr; i++)
 | 
						for (int i = 0; i < dive_site_table.nr; i++)
 | 
				
			||||||
		locationNames << QString(dive_site_table.dive_sites[i]->name);
 | 
							locationNames << QString(dive_site_table.dive_sites[i]->name);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue