• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Stellarium / stellarium / 15133198421

20 May 2025 08:51AM UTC coverage: 11.932%. First build
15133198421

Pull #4179

github

gzotti
Fix broken formatting
Pull Request #4179: Multiple label options for Skycultures

22 of 1587 new or added lines in 36 files covered. (1.39%)

14635 of 122658 relevant lines covered (11.93%)

18651.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/core/StelObjectModule.cpp
1
/*
2
 * Stellarium
3
 * Copyright (C) 2006 Fabien Chereau
4
 * Copyright (C) 2016 Marcos Cardinot
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA  02110-1335, USA.
19
 */
20

21
#include "StelObjectModule.hpp"
22

23
StelObjectModule::StelObjectModule()
×
24
 : StelModule()
×
25
{
26
}
×
27

28
StelObjectModule::~StelObjectModule()
×
29
{
30
}
×
31

32
bool StelObjectModule::matchObjectName(const QString& objName, const QString& objPrefix, bool useStartOfWords) const
×
33
{
34
        if (useStartOfWords)
×
35
                return objName.startsWith(objPrefix, Qt::CaseInsensitive);
×
36
        else
37
                return objName.contains(objPrefix, Qt::CaseInsensitive);
×
38
}
39

NEW
40
QList<StelObjectP> StelObjectModule::searchAround(const Vec3d& v, double limitFov, const StelCore* core) const
×
41
{
NEW
42
        return QList<StelObjectP>();
×
43
}
44

45
QStringList StelObjectModule::listMatchingObjects(const QString &objPrefix, int maxNbItem, bool useStartOfWords) const
×
46
{
47
        QStringList result;
×
48
        if (maxNbItem <= 0)
×
49
                return result;
×
50

51
        QStringList names;
×
52
        names << listAllObjects(false) << listAllObjects(true);
×
NEW
53
        names.removeDuplicates();
×
54
        QString fullMatch = "";
×
55
        for (const auto& name : std::as_const(names))
×
56
        {
57
                if (!matchObjectName(name, objPrefix, useStartOfWords))
×
58
                        continue;
×
59

60
                if (name==objPrefix)
×
61
                        fullMatch = name;
×
62
                else
63
                        result.append(name);
×
64
                if (result.size() >= maxNbItem)
×
65
                        break;
×
66
        }
67

68
        result.sort();
×
69
        if (!fullMatch.isEmpty())
×
70
                result.prepend(fullMatch);
×
71
        return result;
×
72
}
×
73

74
QStringList StelObjectModule::listAllObjectsByType(const QString &objType, bool inEnglish) const
×
75
{
76
        Q_UNUSED(objType)
77
        Q_UNUSED(inEnglish)
78
        return QStringList();
×
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc