~ubuntu-branches/debian/experimental/stellarium/experimental

« back to all changes in this revision

Viewing changes to src/core/modules/ConstellationMgr.cpp

  • Committer: Package Import Robot
  • Author(s): Tomasz Buchert
  • Date: 2013-04-23 18:31:29 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20130423183129-u1bus3c87vywlmku
Tags: 0.12.1-1
* Imported Upstream version 0.12.1
* Installing icons provided by upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1150
1150
        return result;
1151
1151
}
1152
1152
 
 
1153
QStringList ConstellationMgr::listMatchingObjects(const QString& objPrefix, int maxNbItem) const
 
1154
{
 
1155
        QStringList result;
 
1156
        if (maxNbItem==0) return result;
 
1157
 
 
1158
        QString objw = objPrefix.toUpper();
 
1159
 
 
1160
        vector < Constellation * >::const_iterator iter;
 
1161
        for (iter = asterisms.begin(); iter != asterisms.end(); ++iter)
 
1162
        {
 
1163
                QString constw = (*iter)->getEnglishName().mid(0, objw.size()).toUpper();
 
1164
                if (constw==objw)
 
1165
                {
 
1166
                        result << (*iter)->getEnglishName();
 
1167
                        if (result.size()==maxNbItem)
 
1168
                                return result;
 
1169
                }
 
1170
        }
 
1171
        return result;
 
1172
}
 
1173
 
1153
1174
QStringList ConstellationMgr::listAllObjects(bool inEnglish) const
1154
1175
{
1155
1176
        QStringList result;