StelObjectMgr.cpp   StelObjectMgr.cpp 
/* /*
* Stellarium * Stellarium
* Copyright (C) 2007 Fabien Chereau * Copyright (C) 2007 Fabien Chereau
* Copyright (C) 2016 Marcos Cardinot
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 242 skipping to change at line 243
{ {
QList<StelObjectP> result; QList<StelObjectP> result;
for (QList<StelObjectP>::iterator iter=lastSelectedObjects.begin();i ter!=lastSelectedObjects.end();++iter) for (QList<StelObjectP>::iterator iter=lastSelectedObjects.begin();i ter!=lastSelectedObjects.end();++iter)
{ {
if ((*iter)->getType()==type) if ((*iter)->getType()==type)
result.push_back(*iter); result.push_back(*iter);
} }
return result; return result;
} }
/************************************************************************* /**************************************************************************
Find and return the list of at most maxNbItem objects auto-completing ***************
passed object I18 name Find and return the list of at most maxNbItem objects auto-completing pass
*************************************************************************/ ed object name
QStringList StelObjectMgr::listMatchingObjectsI18n(const QString& objPrefix ***************************************************************************
, unsigned int maxNbItem, bool useStartOfWords) const ****************/
QStringList StelObjectMgr::listMatchingObjects(const QString& objPrefix, un
signed int maxNbItem, bool useStartOfWords, bool inEnglish) const
{ {
QStringList result; QStringList result;
if (maxNbItem <= 0)
// For all StelObjectmodules..
foreach (const StelObjectModule* m, objectsModule)
{ {
// Get matching object for this module return result;
QStringList matchingObj = m->listMatchingObjectsI18n(objPref
ix, maxNbItem, useStartOfWords);
result += matchingObj;
maxNbItem-=matchingObj.size();
} }
result.sort();
return result;
}
/*************************************************************************
Find and return the list of at most maxNbItem objects auto-completing
passed object English name
*************************************************************************/
QStringList StelObjectMgr::listMatchingObjects(const QString& objPrefix, un
signed int maxNbItem, bool useStartOfWords) const
{
QStringList result;
// For all StelObjectmodules.. // For all StelObjectmodules..
foreach (const StelObjectModule* m, objectsModule) foreach (const StelObjectModule* m, objectsModule)
{ {
// Get matching object for this module // Get matching object for this module
QStringList matchingObj = m->listMatchingObjects(objPrefix, maxNbItem, useStartOfWords); QStringList matchingObj = m->listMatchingObjects(objPrefix, maxNbItem, useStartOfWords, inEnglish);
result += matchingObj; result += matchingObj;
maxNbItem-=matchingObj.size(); maxNbItem-=matchingObj.size();
} }
result.sort(); result.sort();
return result; return result;
} }
QStringList StelObjectMgr::listAllModuleObjects(const QString &moduleId, bo ol inEnglish) const QStringList StelObjectMgr::listAllModuleObjects(const QString &moduleId, bo ol inEnglish) const
{ {
skipping to change at line 380 skipping to change at line 363
result["NebulaMgr:27"] = "Protoplanetary Nebulae"; result["NebulaMgr:27"] = "Protoplanetary Nebulae";
result["NebulaMgr:100"] = "Messier Catalogue"; result["NebulaMgr:100"] = "Messier Catalogue";
result["NebulaMgr:101"] = "Caldwell Catalogue"; result["NebulaMgr:101"] = "Caldwell Catalogue";
result["NebulaMgr:102"] = "Barnard Catalogue"; result["NebulaMgr:102"] = "Barnard Catalogue";
result["NebulaMgr:103"] = "Sharpless Catalogue"; result["NebulaMgr:103"] = "Sharpless Catalogue";
result["NebulaMgr:104"] = "Van den Bergh Catalogue"; result["NebulaMgr:104"] = "Van den Bergh Catalogue";
result["NebulaMgr:105"] = "The Catalogue of Rodgers, Campbell, and Whiteoak"; result["NebulaMgr:105"] = "The Catalogue of Rodgers, Campbell, and Whiteoak";
result["NebulaMgr:106"] = "Collinder Catalogue"; result["NebulaMgr:106"] = "Collinder Catalogue";
result["NebulaMgr:107"] = "Melotte Catalogue"; result["NebulaMgr:107"] = "Melotte Catalogue";
result["NebulaMgr:150"] = "Dwarf galaxies"; result["NebulaMgr:150"] = "Dwarf galaxies";
result["NebulaMgr:151"] = "Herschel 400 Catalogue";
} }
// Interesting stars // Interesting stars
if (m->objectName()=="StarMgr") if (m->objectName()=="StarMgr")
{ {
result["StarMgr:0"] = "Interesting double stars"; result["StarMgr:0"] = "Interesting double stars";
result["StarMgr:1"] = "Interesting variable stars"; result["StarMgr:1"] = "Interesting variable stars";
} }
} }
return result; return result;
} }
 End of changes. 7 change blocks. 
28 lines changed or deleted 13 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/