Merge remote-tracking branch 'origin/master' into frameworks

Conflicts:
	dolphin/src/dolphincontextmenu.cpp
	dolphin/src/panels/folders/treeviewcontextmenu.cpp
This commit is contained in:
Frank Reininghaus 2014-06-12 08:51:50 +02:00
commit 6bccf73e92
8 changed files with 19 additions and 18 deletions

View file

@ -430,10 +430,9 @@ QAction* DolphinContextMenu::createPasteAction()
QAction* action = 0;
const bool isDir = !m_fileInfo.isNull() && m_fileInfo.isDir();
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);
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);
action->setEnabled(!pasteData.isEmpty() && selectedItemsProperties().supportsWriting());
action->setEnabled(pasteInfo.first);
connect(action, &QAction::triggered, m_mainWindow, &DolphinMainWindow::pasteIntoFolder);
} else {
action = m_mainWindow->actionCollection()->action(KStandardAction::name(KStandardAction::Paste));

View file

@ -213,6 +213,7 @@ Name[gl]=Compacto
Name[he]=מרוכז
Name[hu]=Kompakt
Name[ia]=Compacte
Name[id]=Kompak
Name[is]=Þjappað
Name[it]=Compatta
Name[kk]=Ықшамды

View file

@ -55,6 +55,14 @@ KFileItemClipboard::~KFileItemClipboard()
void KFileItemClipboard::updateCutItems()
{
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 bool isCutSelection = (!data.isEmpty() && data.at(0) == QLatin1Char('1'));
if (isCutSelection) {

View file

@ -66,11 +66,10 @@ void TreeViewContextMenu::open()
QAction* copyAction = new QAction(KIcon("edit-copy"), i18nc("@action:inmenu", "Copy"), this);
connect(copyAction, &QAction::triggered, this, &TreeViewContextMenu::copy);
QAction* pasteAction = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste"), this);
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);
const QPair<bool, QString> pasteInfo = KonqOperations::pasteInfo(m_fileItem.url());
QAction* pasteAction = new QAction(KIcon("edit-paste"), pasteInfo.second, this);
connect(pasteAction, &QAction::triggered, this, &TreeViewContextMenu::paste);
pasteAction->setEnabled(!pasteData.isEmpty() && capabilities.supportsWriting());
pasteAction->setEnabled(pasteInfo.first);
popup->addAction(cutAction);
popup->addAction(copyAction);
@ -176,17 +175,7 @@ void TreeViewContextMenu::copy()
void TreeViewContextMenu::paste()
{
QClipboard* clipboard = QApplication::clipboard();
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);
}
KonqOperations::doPaste(m_parent, m_fileItem.url());
}
void TreeViewContextMenu::rename()

View file

@ -314,6 +314,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros
X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=manajer berkas
X-KDE-Keywords[is]=skráastjóri
X-KDE-Keywords[it]=gestore dei file
X-KDE-Keywords[kk]=file manager

View file

@ -314,6 +314,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros
X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=manajer berkas
X-KDE-Keywords[is]=skráastjóri
X-KDE-Keywords[it]=gestore dei file
X-KDE-Keywords[kk]=file manager

View file

@ -263,6 +263,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros
X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=manajer berkas
X-KDE-Keywords[is]=skráastjóri
X-KDE-Keywords[it]=gestore dei file
X-KDE-Keywords[kk]=file manager

View file

@ -312,6 +312,7 @@ X-KDE-Keywords[gl]=xestor de ficheiros
X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=manajer berkas
X-KDE-Keywords[is]=skráastjóri
X-KDE-Keywords[it]=gestore dei file
X-KDE-Keywords[kk]=file manager