Changeset View
Changeset View
Standalone View
Standalone View
src/panels/places/placesitem.cpp
1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com> * | 2 | * Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com> * | ||
3 | * Copyright (C) 2018 by Elvis Angelaccio <elvis.angelaccio@kde.org> * | ||||
3 | * * | 4 | * * | ||
4 | * Based on KFilePlacesItem from kdelibs: * | 5 | * Based on KFilePlacesItem from kdelibs: * | ||
5 | * Copyright (C) 2007 Kevin Ottens <ervin@kde.org> * | 6 | * Copyright (C) 2007 Kevin Ottens <ervin@kde.org> * | ||
6 | * * | 7 | * * | ||
7 | * This program is free software; you can redistribute it and/or modify * | 8 | * This program is free software; you can redistribute it and/or modify * | ||
8 | * it under the terms of the GNU General Public License as published by * | 9 | * it under the terms of the GNU General Public License as published by * | ||
9 | * the Free Software Foundation; either version 2 of the License, or * | 10 | * the Free Software Foundation; either version 2 of the License, or * | ||
10 | * (at your option) any later version. * | 11 | * (at your option) any later version. * | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 75 | { | |||
75 | setDataValue("udi", udi); | 76 | setDataValue("udi", udi); | ||
76 | } | 77 | } | ||
77 | 78 | | |||
78 | QString PlacesItem::udi() const | 79 | QString PlacesItem::udi() const | ||
79 | { | 80 | { | ||
80 | return dataValue("udi").toString(); | 81 | return dataValue("udi").toString(); | ||
81 | } | 82 | } | ||
82 | 83 | | |||
84 | void PlacesItem::setApplicationName(const QString &applicationName) | ||||
85 | { | ||||
86 | setDataValue("applicationName", applicationName); | ||||
87 | } | ||||
88 | | ||||
89 | QString PlacesItem::applicationName() const | ||||
90 | { | ||||
91 | return dataValue("applicationName").toString(); | ||||
92 | } | ||||
93 | | ||||
83 | void PlacesItem::setHidden(bool hidden) | 94 | void PlacesItem::setHidden(bool hidden) | ||
84 | { | 95 | { | ||
85 | setDataValue("isHidden", hidden); | 96 | setDataValue("isHidden", hidden); | ||
86 | } | 97 | } | ||
87 | 98 | | |||
88 | bool PlacesItem::isHidden() const | 99 | bool PlacesItem::isHidden() const | ||
89 | { | 100 | { | ||
90 | return dataValue("isHidden").toBool(); | 101 | return dataValue("isHidden").toBool(); | ||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Line(s) | 247 | } else if (role == "text") { | |||
242 | // (see PlacesItemModel::createSystemBookmarks()). | 253 | // (see PlacesItemModel::createSystemBookmarks()). | ||
243 | if (text() != i18ndc("kio5", "KFile System Bookmarks", m_bookmark.text().toUtf8().data())) { | 254 | if (text() != i18ndc("kio5", "KFile System Bookmarks", m_bookmark.text().toUtf8().data())) { | ||
244 | m_bookmark.setFullText(text()); | 255 | m_bookmark.setFullText(text()); | ||
245 | } | 256 | } | ||
246 | } else if (role == "url") { | 257 | } else if (role == "url") { | ||
247 | m_bookmark.setUrl(url()); | 258 | m_bookmark.setUrl(url()); | ||
248 | } else if (role == "udi") { | 259 | } else if (role == "udi") { | ||
249 | m_bookmark.setMetaDataItem(QStringLiteral("UDI"), udi()); | 260 | m_bookmark.setMetaDataItem(QStringLiteral("UDI"), udi()); | ||
261 | } else if (role == "applicationName") { | ||||
262 | m_bookmark.setMetaDataItem(QStringLiteral("OnlyInApp"), applicationName()); | ||||
250 | } else if (role == "isSystemItem") { | 263 | } else if (role == "isSystemItem") { | ||
251 | m_bookmark.setMetaDataItem(QStringLiteral("isSystemItem"), isSystemItem() ? QStringLiteral("true") : QStringLiteral("false")); | 264 | m_bookmark.setMetaDataItem(QStringLiteral("isSystemItem"), isSystemItem() ? QStringLiteral("true") : QStringLiteral("false")); | ||
252 | } else if (role == "isHidden") { | 265 | } else if (role == "isHidden") { | ||
253 | m_bookmark.setMetaDataItem(QStringLiteral("IsHidden"), isHidden() ? QStringLiteral("true") : QStringLiteral("false")); | 266 | m_bookmark.setMetaDataItem(QStringLiteral("IsHidden"), isHidden() ? QStringLiteral("true") : QStringLiteral("false")); | ||
254 | } | 267 | } | ||
255 | } | 268 | } | ||
256 | 269 | | |||
257 | QString PlacesItem::generateNewId() | 270 | QString PlacesItem::generateNewId() | ||
Show All 14 Lines |