Commit 0690d4db authored by Maik Qualmann's avatar Maik Qualmann

better performance to add items to the completer

BUGS: 421646
FIXED-IN: 7.0.0
parent bd71890f
......@@ -741,4 +741,5 @@ BUGFIXES:
705 ==> 421559 - HEIC: Failed to open the data source: Too many open files (errno = 24).
706 ==> 421464 - XPkeywords not being updated.
707 ==> 421521 - Wrong EXIF photograph properties shown when there is no EXIF data at all.
708 ==>
708 ==> 421646 - Impossible to add new tag.
709 ==>
......@@ -161,6 +161,7 @@ TagEditDlg::TagEditDlg(QWidget* const parent, TAlbum* const album, bool create)
if (d->create)
{
QStringList tagPaths;
AlbumList tList = AlbumManager::instance()->allTAlbums();
for (AlbumList::const_iterator it = tList.constBegin() ; it != tList.constEnd() ; ++it)
......@@ -169,9 +170,11 @@ TagEditDlg::TagEditDlg(QWidget* const parent, TAlbum* const album, bool create)
if (tag && !tag->isInternalTag())
{
d->titleEdit->completerModel()->addItem(tag->tagPath());
tagPaths << tag->tagPath();
}
}
d->titleEdit->completerModel()->addItems(tagPaths);
}
else
{
......
......@@ -151,6 +151,12 @@ void ModelCompleter::addItem(const QString& item)
d->stringModel->sort(0);
}
void ModelCompleter::addItems(const QStringList& items)
{
d->stringModel->setStringList(items);
d->stringModel->sort(0);
}
QStringList ModelCompleter::items() const
{
return d->stringModel->stringList();
......
......@@ -60,6 +60,7 @@ public:
QAbstractItemModel* itemModel() const;
void addItem(const QString& item);
void addItems(const QStringList& items);
QStringList items() const;
Q_SIGNALS:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment