mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 08:21:22 +00:00
Expose the new file item property pathorurl to the Dolphin UI. This is mostly useful for search results to see the actual local path of the result.
svn path=/trunk/KDE/kdebase/apps/; revision=1125631
This commit is contained in:
parent
7e74c6f23b
commit
6a096cca2d
|
@ -980,6 +980,7 @@ void DolphinView::updateAdditionalInfoActions(KActionCollection* collection)
|
|||
QAction* showOwnerInfo = collection->action("show_owner_info");
|
||||
QAction* showGroupInfo = collection->action("show_group_info");
|
||||
QAction* showMimeInfo = collection->action("show_mime_info");
|
||||
QAction* showPathOrUrlInfo = collection->action("show_path_or_url_info");
|
||||
|
||||
showSizeInfo->setChecked(false);
|
||||
showDateInfo->setChecked(false);
|
||||
|
@ -987,6 +988,7 @@ void DolphinView::updateAdditionalInfoActions(KActionCollection* collection)
|
|||
showOwnerInfo->setChecked(false);
|
||||
showGroupInfo->setChecked(false);
|
||||
showMimeInfo->setChecked(false);
|
||||
showPathOrUrlInfo->setChecked(false);
|
||||
|
||||
showSizeInfo->setEnabled(enable);
|
||||
showDateInfo->setEnabled(enable);
|
||||
|
@ -994,6 +996,7 @@ void DolphinView::updateAdditionalInfoActions(KActionCollection* collection)
|
|||
showOwnerInfo->setEnabled(enable);
|
||||
showGroupInfo->setEnabled(enable);
|
||||
showMimeInfo->setEnabled(enable);
|
||||
showPathOrUrlInfo->setEnabled(enable);
|
||||
|
||||
foreach (KFileItemDelegate::Information info, m_viewAccessor.itemDelegate()->showInformation()) {
|
||||
switch (info) {
|
||||
|
@ -1015,6 +1018,9 @@ void DolphinView::updateAdditionalInfoActions(KActionCollection* collection)
|
|||
case KFileItemDelegate::FriendlyMimeType:
|
||||
showMimeInfo->setChecked(true);
|
||||
break;
|
||||
case KFileItemDelegate::LocalPathOrUrl:
|
||||
showPathOrUrlInfo->setChecked(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -249,6 +249,11 @@ QActionGroup* DolphinViewActionHandler::createAdditionalInformationActionGroup()
|
|||
showMimeInfo->setData(KFileItemDelegate::FriendlyMimeType);
|
||||
showMimeInfo->setActionGroup(additionalInfoGroup);
|
||||
|
||||
KToggleAction* showPathOrUrlInfo = m_actionCollection->add<KToggleAction>("show_path_or_url_info");
|
||||
showPathOrUrlInfo->setText(i18nc("@action:inmenu Additional information", "Path"));
|
||||
showPathOrUrlInfo->setData(KFileItemDelegate::LocalPathOrUrl);
|
||||
showPathOrUrlInfo->setActionGroup(additionalInfoGroup);
|
||||
|
||||
return additionalInfoGroup;
|
||||
}
|
||||
|
||||
|
|
|
@ -212,6 +212,9 @@ void ViewProperties::setAdditionalInfo(KFileItemDelegate::InformationList list)
|
|||
case KFileItemDelegate::FriendlyMimeType:
|
||||
info = info | TypeInfo;
|
||||
break;
|
||||
case KFileItemDelegate::LocalPathOrUrl:
|
||||
info = info | PathOrUrlInfo;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -247,6 +250,9 @@ KFileItemDelegate::InformationList ViewProperties::additionalInfo() const
|
|||
if (info & TypeInfo) {
|
||||
list.append(KFileItemDelegate::FriendlyMimeType);
|
||||
}
|
||||
if (info & PathOrUrlInfo) {
|
||||
list.append(KFileItemDelegate::LocalPathOrUrl);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
* the value is dependent from another property (in this case the view-mode).
|
||||
*/
|
||||
void setAdditionalInfo(KFileItemDelegate::InformationList info);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the additional information for the current set view-mode.
|
||||
* Note that the additional-info property is the only property where
|
||||
|
@ -162,7 +162,8 @@ private:
|
|||
PermissionsInfo = 4,
|
||||
OwnerInfo = 8,
|
||||
GroupInfo = 16,
|
||||
TypeInfo = 32
|
||||
TypeInfo = 32,
|
||||
PathOrUrlInfo = 64
|
||||
};
|
||||
|
||||
bool m_changedProps;
|
||||
|
|
Loading…
Reference in a new issue