mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Cleanup: Move stringToList to core/qthelper.cpp
The same code was used in desktop and undo commands. Let's unify. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
c495a49b1b
commit
2a97934db4
4 changed files with 9 additions and 17 deletions
|
@ -726,15 +726,6 @@ DiveField EditTags::fieldId() const
|
|||
return DiveField::TAGS;
|
||||
}
|
||||
|
||||
// String list helper
|
||||
static QStringList stringToList(const QString &s)
|
||||
{
|
||||
QStringList res = s.split(",", QString::SkipEmptyParts);
|
||||
for (QString &str: res)
|
||||
str = str.trimmed();
|
||||
return res;
|
||||
}
|
||||
|
||||
// ***** Buddies *****
|
||||
QStringList EditBuddies::data(struct dive *d) const
|
||||
{
|
||||
|
|
|
@ -1219,6 +1219,14 @@ QString get_taglist_string(struct tag_entry *tag_list)
|
|||
return ret;
|
||||
}
|
||||
|
||||
QStringList stringToList(const QString &s)
|
||||
{
|
||||
QStringList res = s.split(",", QString::SkipEmptyParts);
|
||||
for (QString &str: res)
|
||||
str = str.trimmed();
|
||||
return res;
|
||||
}
|
||||
|
||||
weight_t string_to_weight(const char *str)
|
||||
{
|
||||
const char *end;
|
||||
|
|
|
@ -29,6 +29,7 @@ QList<int> getDivesInTrip(struct dive_trip *trip);
|
|||
QString get_gas_string(struct gasmix gas);
|
||||
QString get_divepoint_gas_string(struct dive *d, const struct divedatapoint &dp);
|
||||
QString get_taglist_string(struct tag_entry *tag_list);
|
||||
QStringList stringToList(const QString &s);
|
||||
void read_hashes();
|
||||
void write_hashes();
|
||||
QString thumbnailFileName(const QString &filename);
|
||||
|
|
|
@ -631,14 +631,6 @@ void MainTab::divesEdited(int i)
|
|||
ui.multiDiveWarningMessage->show();
|
||||
}
|
||||
|
||||
static QStringList stringToList(const QString &s)
|
||||
{
|
||||
QStringList res = s.split(",", QString::SkipEmptyParts);
|
||||
for (QString &str: res)
|
||||
str = str.trimmed();
|
||||
return res;
|
||||
}
|
||||
|
||||
void MainTab::on_buddy_editingFinished()
|
||||
{
|
||||
if (editMode == IGNORE_MODE || !current_dive)
|
||||
|
|
Loading…
Reference in a new issue