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:
Sebastian Trueg 2010-05-11 21:02:49 +00:00
parent 7e74c6f23b
commit 6a096cca2d
4 changed files with 20 additions and 2 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;