Commit c87466d9 authored by Simon Depiets's avatar Simon Depiets
Browse files

No need to check comments if there is none

parent b1e37cc7
......@@ -643,9 +643,11 @@ QVariant ProjectModel::data(const QModelIndex& index, const int role) const
const int fuzzy = node->fuzzyAsPerRole();
const int untranslated = node->metaData.untranslated;
QString comment(QStringLiteral(""));
int existingItem = Project::instance()->commentsFiles().indexOf(Project::instance()->relativePath(item.localPath()));
if (existingItem != -1 && Project::instance()->commentsTexts().count() > existingItem) {
comment = Project::instance()->commentsTexts().at(existingItem);
if (Project::instance()->commentsFiles().count() > 0 && Project::instance()->commentsTexts().count() > 0) {
int existingItem = Project::instance()->commentsFiles().indexOf(Project::instance()->relativePath(item.localPath()));
if (existingItem != -1 && Project::instance()->commentsTexts().count() > existingItem) {
comment = Project::instance()->commentsTexts().at(existingItem);
}
}
switch (role) {
......
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