mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-17 15:31:20 +00:00
Always enable the "Create New..." menu if the URL is writable
This commit works around the problem that KDirLister may not provide a "rootItem" for some kioslaves by setting up a KFileItem with the view URL and using this to find out if the URL is writable. BUG: 330001 CCBUG: 330015 REVIEW: 115405 FIXED-IN: 4.12.2
This commit is contained in:
parent
df2179ec6b
commit
900a4ba3b9
|
@ -1666,11 +1666,16 @@ void DolphinView::updateWritableState()
|
|||
const bool wasFolderWritable = m_isFolderWritable;
|
||||
m_isFolderWritable = false;
|
||||
|
||||
const KFileItem item = m_model->rootItem();
|
||||
if (!item.isNull()) {
|
||||
KFileItemListProperties capabilities(KFileItemList() << item);
|
||||
m_isFolderWritable = capabilities.supportsWriting();
|
||||
KFileItem item = m_model->rootItem();
|
||||
if (item.isNull()) {
|
||||
// Try to find out if the URL is writable even if the "root item" is
|
||||
// null, see https://bugs.kde.org/show_bug.cgi?id=330001
|
||||
item = KFileItem(KFileItem::Unknown, KFileItem::Unknown, url(), true);
|
||||
}
|
||||
|
||||
KFileItemListProperties capabilities(KFileItemList() << item);
|
||||
m_isFolderWritable = capabilities.supportsWriting();
|
||||
|
||||
if (m_isFolderWritable != wasFolderWritable) {
|
||||
emit writeStateChanged(m_isFolderWritable);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue