Commit 6c8de22b authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Add sharedWithMeDate to property tab

CCBUG: 385388
parent 70a42997
Pipeline #236066 passed with stage
in 38 seconds
......@@ -17,7 +17,8 @@ enum GDriveUDSEntryExtras {
Owners,
Version,
LastModifyingUser,
Description
Description,
SharedWithMeDate
};
#endif // GDRIVEUDSENTRY_H
......@@ -58,6 +58,15 @@ void GDrivePropertiesPlugin::showEntryDetails(const KIO::UDSEntry &entry)
const QString lastViewedByMe = m_item.timeString(KFileItem::AccessTime);
m_ui.lastViewedByMeValue->setText(lastViewedByMe);
if (entry.contains(GDriveUDSEntryExtras::SharedWithMeDate)) {
m_ui.sharedWithMeValue->setText(entry.stringValue(GDriveUDSEntryExtras::SharedWithMeDate));
m_ui.sharedWithMeLabel->show();
m_ui.sharedWithMeValue->show();
} else {
m_ui.sharedWithMeLabel->hide();
m_ui.sharedWithMeValue->hide();
}
const QString version = entry.stringValue(GDriveUDSEntryExtras::Version);
m_ui.versionValue->setText(version);
......
......@@ -131,10 +131,10 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lastModifiedByLabel">
<item row="6" column="0">
<widget class="QLabel" name="lastViewedByMeLabel">
<property name="text">
<string>Last modified by:</string>
<string>Last viewed by me:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -144,20 +144,20 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="lastModifiedByValue">
<item row="6" column="1">
<widget class="QLabel" name="lastViewedByMeValue">
<property name="text">
<string notr="true">lastModifiedByValue</string>
<string notr="true">lastViewedByMeValue</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lastViewedByMeLabel">
<item row="8" column="0">
<widget class="QLabel" name="versionLabel">
<property name="text">
<string>Last viewed by me:</string>
<string>Version:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -167,20 +167,20 @@
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="lastViewedByMeValue">
<item row="8" column="1">
<widget class="QLabel" name="versionValue">
<property name="text">
<string notr="true">lastViewedByMeValue</string>
<string notr="true">versionValue</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="versionLabel">
<item row="9" column="0">
<widget class="QLabel" name="md5Label">
<property name="text">
<string>Version:</string>
<string>MD5 checksum:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -190,20 +190,20 @@
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="versionValue">
<item row="9" column="1">
<widget class="QLabel" name="md5Value">
<property name="text">
<string notr="true">versionValue</string>
<string notr="true">md5Value</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="md5Label">
<item row="5" column="0">
<widget class="QLabel" name="lastModifiedByLabel">
<property name="text">
<string>MD5 checksum:</string>
<string>Last modified by:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -213,16 +213,30 @@
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="md5Value">
<item row="5" column="1">
<widget class="QLabel" name="lastModifiedByValue">
<property name="text">
<string notr="true">md5Value</string>
<string notr="true">lastModifiedByValue</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="sharedWithMeLabel">
<property name="text">
<string>Shared with me:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="sharedWithMeValue">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
......
......@@ -229,6 +229,9 @@ KIO::UDSEntry KIOGDrive::fileToUDSEntry(const FilePtr &origFile, const QString &
entry.fastInsert(GDriveUDSEntryExtras::Md5, file->md5Checksum());
entry.fastInsert(GDriveUDSEntryExtras::LastModifyingUser, file->lastModifyingUserName());
entry.fastInsert(GDriveUDSEntryExtras::Owners, file->ownerNames().join(QStringLiteral(", ")));
if (file->sharedWithMeDate().isValid()) {
entry.fastInsert(GDriveUDSEntryExtras::SharedWithMeDate, QLocale::system().toString(file->sharedWithMeDate(), QLocale::LongFormat));
}
return entry;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment