Commit 730a5936 authored by Méven Car's avatar Méven Car
Browse files

Add UDS_ACCESS to UDSEntry for roots of network: recentdocuments and recentlyused:/

This allows KFileItem to mark those folders not writable and disable pasteInto actions.
parent ca0f9764
......@@ -270,7 +270,7 @@ void NetworkSlave::feedEntryAsNetwork( KIO::UDSEntry* entry )
entry->fastInsert( KIO::UDSEntry::UDS_DISPLAY_NAME, i18n("Network"));
// entry->fastInsert( KIO::UDSEntry::UDS_ICON_NAME, NetworkIconName );
entry->fastInsert( KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String(Mimetypes::NetworkMimetype) );
entry->fastInsert( KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR );
}
void NetworkSlave::feedEntryAsDevice( KIO::UDSEntry* entry, const Mollet::NetDevice& deviceData )
......@@ -279,9 +279,9 @@ void NetworkSlave::feedEntryAsDevice( KIO::UDSEntry* entry, const Mollet::NetDev
entry->fastInsert( KIO::UDSEntry::UDS_NAME, deviceData.hostAddress() );
entry->fastInsert( KIO::UDSEntry::UDS_DISPLAY_NAME, deviceData.name() );
entry->fastInsert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR );
entry->fastInsert( KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR );
// entry->fastInsert( KIO::UDSEntry::UDS_ICON_NAME, NetDevice::iconName(deviceData.type()) );
entry->fastInsert( KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String(Mimetypes::DeviceMimetype[deviceData.type()]) );
}
void NetworkSlave::feedEntryAsService( KIO::UDSEntry* entry, const Mollet::NetService& serviceData )
......
......@@ -148,13 +148,14 @@ void RecentDocuments::stat(const QUrl& url)
//
QString dirName = i18n("Recent Documents");
KIO::UDSEntry uds;
uds.reserve(6);
uds.reserve(7);
uds.fastInsert(KIO::UDSEntry::UDS_NAME, dirName);
uds.fastInsert(KIO::UDSEntry::UDS_DISPLAY_NAME, dirName);
uds.fastInsert(KIO::UDSEntry::UDS_DISPLAY_TYPE, dirName);
uds.fastInsert(KIO::UDSEntry::UDS_ICON_NAME, QString::fromLatin1("document-open-recent"));
uds.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
uds.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1("inode/directory"));
uds.fastInsert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR);
statEntry(uds);
finished();
......
......@@ -222,13 +222,14 @@ void RecentlyUsed::listDir(const QUrl &url)
KIO::UDSEntry RecentlyUsed::udsEntryForRoot(const QString &dirName, const QString &iconName)
{
KIO::UDSEntry uds;
uds.reserve(6);
uds.reserve(7);
uds.fastInsert(KIO::UDSEntry::UDS_NAME, dirName);
uds.fastInsert(KIO::UDSEntry::UDS_DISPLAY_NAME, dirName);
uds.fastInsert(KIO::UDSEntry::UDS_DISPLAY_TYPE, dirName);
uds.fastInsert(KIO::UDSEntry::UDS_ICON_NAME, iconName);
uds.fastInsert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR);
uds.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("inode/directory"));
uds.fastInsert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR);
return uds;
}
......
Markdown is supported
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