From 8d7da7a61c6bbd7f003d28c2eb14ead20e550c07 Mon Sep 17 00:00:00 2001 From: Antonis Tsiapaliokas Date: Thu, 16 Apr 2015 12:54:59 +0300 Subject: [PATCH] Image Wallpaper: Don't show duplicates after removing some of the wallpapers REVIEW: 123273 --- wallpapers/image/backgroundlistmodel.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/wallpapers/image/backgroundlistmodel.cpp b/wallpapers/image/backgroundlistmodel.cpp index 9aaf514a8..e4d622178 100644 --- a/wallpapers/image/backgroundlistmodel.cpp +++ b/wallpapers/image/backgroundlistmodel.cpp @@ -240,9 +240,16 @@ QModelIndex BackgroundListModel::indexOf(const QString &path) const if (!prefixempty) { prefixempty = ps[0].isEmpty(); } -// if ((!m_packages[i].contentsPrefixPaths().isEmpty()) || -// (path == m_packages[i].filePath("preferred"))) { - if ((path == m_packages[i].filePath("preferred"))) { + + + //For local files (user wallpapers) path == m_packages[i].filePath("preferred") + //E.X. path = "/home/kde/next.png" + //m_packages[i].filePath("preferred") = "/home/kde/next.png" + // + //But for the system wallpapers this is not the case. path != m_packages[i].filePath("preferred") + //E.X. path = /usr/share/wallpapers/Next/" + //m_packages[i].filePath("preferred") = "/usr/share/wallpapers/Next/contents/images/1920x1080.png" + if ((path == m_packages[i].filePath("preferred")) || m_packages[i].filePath("preferred").contains(path)) { qDebug() << "WP TRUE" << (!m_packages[i].contentsPrefixPaths().isEmpty()) << (path == m_packages[i].filePath("preferred")); return index(i, 0); }