mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn struct dive string data into std::string
Much easier memory management! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2b3d2f1020
commit
3cb04d230b
34 changed files with 208 additions and 313 deletions
|
@ -28,13 +28,13 @@ void CompletionModelBase::divesChanged(const QVector<dive *> &, DiveField field)
|
|||
updateModel();
|
||||
}
|
||||
|
||||
static QStringList getCSVList(char *dive::*item)
|
||||
static QStringList getCSVList(const std::string dive::*item)
|
||||
{
|
||||
QSet<QString> set;
|
||||
struct dive *dive;
|
||||
int i = 0;
|
||||
for_each_dive (i, dive) {
|
||||
QString str(dive->*item);
|
||||
QString str = QString::fromStdString(dive->*item);
|
||||
for (const QString &value: str.split(",", SKIP_EMPTY))
|
||||
set.insert(value.trimmed());
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ QStringList SuitCompletionModel::getStrings()
|
|||
struct dive *dive;
|
||||
int i = 0;
|
||||
for_each_dive (i, dive) {
|
||||
QString suit(dive->suit);
|
||||
QString suit = QString::fromStdString(dive->suit);
|
||||
if (!list.contains(suit))
|
||||
list.append(suit);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue