]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Expose the new file item property pathorurl to the Dolphin UI. This is mostly useful...
authorSebastian Trueg <sebastian@trueg.de>
Tue, 11 May 2010 21:02:49 +0000 (21:02 +0000)
committerSebastian Trueg <sebastian@trueg.de>
Tue, 11 May 2010 21:02:49 +0000 (21:02 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=1125631

src/dolphinview.cpp
src/dolphinviewactionhandler.cpp
src/viewproperties.cpp
src/viewproperties.h

index 79191c52caf32d5b45553b910f9eb2247d09252f..5ad77f72618120557fb6ecf8bc78a19c4e996335 100644 (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;
         }
index 2bbdec01366c9c43e53a1f5a5966b7fea1ab7b55..ab28dca2635384730e5a85390e33e641e5a53cf7 100644 (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;
 }
 
index 3a2bb1fc15607b0bf1942f665058ac3730a65358..d78fdd4f5882b3dda1e11718adbb0b399dd1492d 100644 (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;
 }
index a8a2cc9342141b2745f512da4ba7b4a166f6799f..6963587263ae3fe8465dd7c0c754f7c1d84bb83e 100644 (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;