mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Merge remote-tracking branch 'origin/master' into frameworks
Conflicts: dolphin/src/dolphincontextmenu.cpp dolphin/src/panels/folders/treeviewcontextmenu.cpp
This commit is contained in:
commit
6bccf73e92
|
@ -430,10 +430,9 @@ QAction* DolphinContextMenu::createPasteAction()
|
||||||
QAction* action = 0;
|
QAction* action = 0;
|
||||||
const bool isDir = !m_fileInfo.isNull() && m_fileInfo.isDir();
|
const bool isDir = !m_fileInfo.isNull() && m_fileInfo.isDir();
|
||||||
if (isDir && (m_selectedItems.count() == 1)) {
|
if (isDir && (m_selectedItems.count() == 1)) {
|
||||||
|
const QPair<bool, QString> pasteInfo = KonqOperations::pasteInfo(m_fileInfo.url());
|
||||||
action = new QAction(QIcon::fromTheme("edit-paste"), i18nc("@action:inmenu", "Paste Into Folder"), this);
|
action = new QAction(QIcon::fromTheme("edit-paste"), i18nc("@action:inmenu", "Paste Into Folder"), this);
|
||||||
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
|
action->setEnabled(pasteInfo.first);
|
||||||
const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);
|
|
||||||
action->setEnabled(!pasteData.isEmpty() && selectedItemsProperties().supportsWriting());
|
|
||||||
connect(action, &QAction::triggered, m_mainWindow, &DolphinMainWindow::pasteIntoFolder);
|
connect(action, &QAction::triggered, m_mainWindow, &DolphinMainWindow::pasteIntoFolder);
|
||||||
} else {
|
} else {
|
||||||
action = m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::Paste));
|
action = m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::Paste));
|
||||||
|
|
|
@ -213,6 +213,7 @@ Name[gl]=Compacto
|
||||||
Name[he]=מרוכז
|
Name[he]=מרוכז
|
||||||
Name[hu]=Kompakt
|
Name[hu]=Kompakt
|
||||||
Name[ia]=Compacte
|
Name[ia]=Compacte
|
||||||
|
Name[id]=Kompak
|
||||||
Name[is]=Þjappað
|
Name[is]=Þjappað
|
||||||
Name[it]=Compatta
|
Name[it]=Compatta
|
||||||
Name[kk]=Ықшамды
|
Name[kk]=Ықшамды
|
||||||
|
|
|
@ -55,6 +55,14 @@ KFileItemClipboard::~KFileItemClipboard()
|
||||||
void KFileItemClipboard::updateCutItems()
|
void KFileItemClipboard::updateCutItems()
|
||||||
{
|
{
|
||||||
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
|
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
|
||||||
|
|
||||||
|
// mimeData can be 0 according to https://bugs.kde.org/show_bug.cgi?id=335053
|
||||||
|
if (!mimeData) {
|
||||||
|
m_cutItems.clear();
|
||||||
|
emit cutItemsChanged();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const QByteArray data = mimeData->data("application/x-kde-cutselection");
|
const QByteArray data = mimeData->data("application/x-kde-cutselection");
|
||||||
const bool isCutSelection = (!data.isEmpty() && data.at(0) == QLatin1Char('1'));
|
const bool isCutSelection = (!data.isEmpty() && data.at(0) == QLatin1Char('1'));
|
||||||
if (isCutSelection) {
|
if (isCutSelection) {
|
||||||
|
|
|
@ -66,11 +66,10 @@ void TreeViewContextMenu::open()
|
||||||
QAction* copyAction = new QAction(KIcon("edit-copy"), i18nc("@action:inmenu", "Copy"), this);
|
QAction* copyAction = new QAction(KIcon("edit-copy"), i18nc("@action:inmenu", "Copy"), this);
|
||||||
connect(copyAction, &QAction::triggered, this, &TreeViewContextMenu::copy);
|
connect(copyAction, &QAction::triggered, this, &TreeViewContextMenu::copy);
|
||||||
|
|
||||||
QAction* pasteAction = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste"), this);
|
const QPair<bool, QString> pasteInfo = KonqOperations::pasteInfo(m_fileItem.url());
|
||||||
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
|
QAction* pasteAction = new QAction(KIcon("edit-paste"), pasteInfo.second, this);
|
||||||
const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);
|
|
||||||
connect(pasteAction, &QAction::triggered, this, &TreeViewContextMenu::paste);
|
connect(pasteAction, &QAction::triggered, this, &TreeViewContextMenu::paste);
|
||||||
pasteAction->setEnabled(!pasteData.isEmpty() && capabilities.supportsWriting());
|
pasteAction->setEnabled(pasteInfo.first);
|
||||||
|
|
||||||
popup->addAction(cutAction);
|
popup->addAction(cutAction);
|
||||||
popup->addAction(copyAction);
|
popup->addAction(copyAction);
|
||||||
|
@ -176,17 +175,7 @@ void TreeViewContextMenu::copy()
|
||||||
|
|
||||||
void TreeViewContextMenu::paste()
|
void TreeViewContextMenu::paste()
|
||||||
{
|
{
|
||||||
QClipboard* clipboard = QApplication::clipboard();
|
KonqOperations::doPaste(m_parent, m_fileItem.url());
|
||||||
const QMimeData* mimeData = clipboard->mimeData();
|
|
||||||
|
|
||||||
const KUrl::List source = KUrl::List::fromMimeData(mimeData);
|
|
||||||
const KUrl& dest = m_fileItem.url();
|
|
||||||
if (KonqMimeData::decodeIsCutSelection(mimeData)) {
|
|
||||||
KonqOperations::copy(m_parent, KonqOperations::MOVE, source, dest);
|
|
||||||
clipboard->clear();
|
|
||||||
} else {
|
|
||||||
KonqOperations::copy(m_parent, KonqOperations::COPY, source, dest);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TreeViewContextMenu::rename()
|
void TreeViewContextMenu::rename()
|
||||||
|
|
|
@ -314,6 +314,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros
|
||||||
X-KDE-Keywords[he]=מנהל קבצים
|
X-KDE-Keywords[he]=מנהל קבצים
|
||||||
X-KDE-Keywords[hu]=fájlkezelő
|
X-KDE-Keywords[hu]=fájlkezelő
|
||||||
X-KDE-Keywords[ia]=gerente de file
|
X-KDE-Keywords[ia]=gerente de file
|
||||||
|
X-KDE-Keywords[id]=manajer berkas
|
||||||
X-KDE-Keywords[is]=skráastjóri
|
X-KDE-Keywords[is]=skráastjóri
|
||||||
X-KDE-Keywords[it]=gestore dei file
|
X-KDE-Keywords[it]=gestore dei file
|
||||||
X-KDE-Keywords[kk]=file manager
|
X-KDE-Keywords[kk]=file manager
|
||||||
|
|
|
@ -314,6 +314,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros
|
||||||
X-KDE-Keywords[he]=מנהל קבצים
|
X-KDE-Keywords[he]=מנהל קבצים
|
||||||
X-KDE-Keywords[hu]=fájlkezelő
|
X-KDE-Keywords[hu]=fájlkezelő
|
||||||
X-KDE-Keywords[ia]=gerente de file
|
X-KDE-Keywords[ia]=gerente de file
|
||||||
|
X-KDE-Keywords[id]=manajer berkas
|
||||||
X-KDE-Keywords[is]=skráastjóri
|
X-KDE-Keywords[is]=skráastjóri
|
||||||
X-KDE-Keywords[it]=gestore dei file
|
X-KDE-Keywords[it]=gestore dei file
|
||||||
X-KDE-Keywords[kk]=file manager
|
X-KDE-Keywords[kk]=file manager
|
||||||
|
|
|
@ -263,6 +263,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros
|
||||||
X-KDE-Keywords[he]=מנהל קבצים
|
X-KDE-Keywords[he]=מנהל קבצים
|
||||||
X-KDE-Keywords[hu]=fájlkezelő
|
X-KDE-Keywords[hu]=fájlkezelő
|
||||||
X-KDE-Keywords[ia]=gerente de file
|
X-KDE-Keywords[ia]=gerente de file
|
||||||
|
X-KDE-Keywords[id]=manajer berkas
|
||||||
X-KDE-Keywords[is]=skráastjóri
|
X-KDE-Keywords[is]=skráastjóri
|
||||||
X-KDE-Keywords[it]=gestore dei file
|
X-KDE-Keywords[it]=gestore dei file
|
||||||
X-KDE-Keywords[kk]=file manager
|
X-KDE-Keywords[kk]=file manager
|
||||||
|
|
|
@ -312,6 +312,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros
|
||||||
X-KDE-Keywords[he]=מנהל קבצים
|
X-KDE-Keywords[he]=מנהל קבצים
|
||||||
X-KDE-Keywords[hu]=fájlkezelő
|
X-KDE-Keywords[hu]=fájlkezelő
|
||||||
X-KDE-Keywords[ia]=gerente de file
|
X-KDE-Keywords[ia]=gerente de file
|
||||||
|
X-KDE-Keywords[id]=manajer berkas
|
||||||
X-KDE-Keywords[is]=skráastjóri
|
X-KDE-Keywords[is]=skráastjóri
|
||||||
X-KDE-Keywords[it]=gestore dei file
|
X-KDE-Keywords[it]=gestore dei file
|
||||||
X-KDE-Keywords[kk]=file manager
|
X-KDE-Keywords[kk]=file manager
|
||||||
|
|
Loading…
Reference in a new issue