mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
dolphin: different take on overlays
still the version plugin overlays are not a thing outside the view of dolphin Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
80b5e33732
commit
12b862ccf5
1 changed files with 3 additions and 14 deletions
|
@ -426,20 +426,7 @@ void KFileItemModelRolesUpdater::slotGotPreview(const KFileItem& item, const QPi
|
|||
|
||||
QHash<QByteArray, QVariant> data = rolesData(item);
|
||||
|
||||
const QStringList overlays = data["iconOverlays"].toStringList();
|
||||
// Strangely KFileItem::overlays() returns empty string-values, so
|
||||
// we need to check first whether an overlay must be drawn at all.
|
||||
// It is more efficient to do it here, as KIconLoader::drawOverlays()
|
||||
// assumes that an overlay will be drawn and has some additional
|
||||
// setup time.
|
||||
foreach (const QString& overlay, overlays) {
|
||||
if (!overlay.isEmpty()) {
|
||||
// There is at least one overlay, draw all overlays above m_pixmap
|
||||
// and cancel the check
|
||||
KIconLoader::global()->drawOverlays(overlays, scaledPixmap, KIconLoader::Desktop);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// TODO: version plugin (KVersionControlPlugin) overlays
|
||||
|
||||
data.insert("iconPixmap", scaledPixmap);
|
||||
|
||||
|
@ -912,6 +899,8 @@ QHash<QByteArray, QVariant> KFileItemModelRolesUpdater::rolesData(const KFileIte
|
|||
data.insert("type", item.mimeComment());
|
||||
}
|
||||
|
||||
data.insert("iconOverlays", item.overlays());
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue