mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
Some suggestions in comments to avoid porting code when we can share existing ported code instead.
svn path=/trunk/playground/utils/dolphin/; revision=607265
This commit is contained in:
parent
7fbae44527
commit
47fa21aff1
|
@ -143,6 +143,7 @@ void Dolphin::dropUrls(const KUrl::List& urls,
|
||||||
/* KDE4-TODO: selectedIndex = popup.exec(QCursor::pos()); */
|
/* KDE4-TODO: selectedIndex = popup.exec(QCursor::pos()); */
|
||||||
popup.exec(QCursor::pos());
|
popup.exec(QCursor::pos());
|
||||||
selectedIndex = 0; // KD4-TODO: use QAction instead of switch below
|
selectedIndex = 0; // KD4-TODO: use QAction instead of switch below
|
||||||
|
// See libkonq/konq_operations.cc: KonqOperations::doDropFileCopy() (and doDrop, the main method)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedIndex < 0) {
|
if (selectedIndex < 0) {
|
||||||
|
@ -641,6 +642,9 @@ void Dolphin::slotRedoTextChanged(const QString& text)
|
||||||
|
|
||||||
void Dolphin::cut()
|
void Dolphin::cut()
|
||||||
{
|
{
|
||||||
|
// TODO: this boolean doesn't work between instances of dolphin or with konqueror or with other
|
||||||
|
// apps. The "application/x-kde-cutselection" mimetype should be used instead, see KonqMimeData
|
||||||
|
// in libkonq
|
||||||
m_clipboardContainsCutData = true;
|
m_clipboardContainsCutData = true;
|
||||||
/* KDE4-TODO: Q3DragObject* data = new KUrlDrag(m_activeView->selectedUrls(),
|
/* KDE4-TODO: Q3DragObject* data = new KUrlDrag(m_activeView->selectedUrls(),
|
||||||
widget());
|
widget());
|
||||||
|
@ -658,7 +662,7 @@ void Dolphin::copy()
|
||||||
|
|
||||||
void Dolphin::paste()
|
void Dolphin::paste()
|
||||||
{
|
{
|
||||||
/* KDE4-TODO:
|
/* KDE4-TODO: - see KonqOperations::doPaste
|
||||||
QClipboard* clipboard = QApplication::clipboard();
|
QClipboard* clipboard = QApplication::clipboard();
|
||||||
QMimeSource* data = clipboard->data();
|
QMimeSource* data = clipboard->data();
|
||||||
if (!KUrlDrag::canDecode(data)) {
|
if (!KUrlDrag::canDecode(data)) {
|
||||||
|
@ -739,6 +743,8 @@ void Dolphin::updatePasteAction()
|
||||||
else if (count == 1) {
|
else if (count == 1) {
|
||||||
// Only one file is selected. Pasting is only allowed if this
|
// Only one file is selected. Pasting is only allowed if this
|
||||||
// file is a directory.
|
// file is a directory.
|
||||||
|
// TODO: this doesn't work with remote protocols; instead we need a
|
||||||
|
// m_activeView->selectedFileItems() to get the real KFileItems
|
||||||
const KFileItem fileItem(S_IFDIR,
|
const KFileItem fileItem(S_IFDIR,
|
||||||
KFileItem::Unknown,
|
KFileItem::Unknown,
|
||||||
urls.first(),
|
urls.first(),
|
||||||
|
@ -1418,7 +1424,7 @@ void Dolphin::setupCreateNewMenuActions()
|
||||||
unplugActionList("create_actions");
|
unplugActionList("create_actions");
|
||||||
KSortableList<CreateFileEntry, QString>::ConstIterator it = m_createFileTemplates.begin();
|
KSortableList<CreateFileEntry, QString>::ConstIterator it = m_createFileTemplates.begin();
|
||||||
KSortableList<CreateFileEntry, QString>::ConstIterator end = m_createFileTemplates.end();
|
KSortableList<CreateFileEntry, QString>::ConstIterator end = m_createFileTemplates.end();
|
||||||
/* KDE4-TODO:
|
/* KDE4-TODO: don't port this code; use KNewMenu instead
|
||||||
while (it != end) {
|
while (it != end) {
|
||||||
CreateFileEntry entry = (*it).value();
|
CreateFileEntry entry = (*it).value();
|
||||||
KAction* action = new KAction(entry.name);
|
KAction* action = new KAction(entry.name);
|
||||||
|
|
|
@ -37,6 +37,8 @@ DolphinCommand::DolphinCommand() :
|
||||||
// Instead of expressing this implementation detail to the interface by adding a
|
// Instead of expressing this implementation detail to the interface by adding a
|
||||||
// Type::Undefined just Type::Copy is used to assure that all members have
|
// Type::Undefined just Type::Copy is used to assure that all members have
|
||||||
// a defined state.
|
// a defined state.
|
||||||
|
//
|
||||||
|
// KDE4TODO: QList doesn't require a default constructor iirc - so remove this
|
||||||
}
|
}
|
||||||
|
|
||||||
DolphinCommand::DolphinCommand(Type type,
|
DolphinCommand::DolphinCommand(Type type,
|
||||||
|
@ -106,6 +108,8 @@ void UndoManager::endMacro()
|
||||||
m_recordMacro = false;
|
m_recordMacro = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KDE4 TODO: consider switching to KCommandHistory (kdeui) for the command history, and to
|
||||||
|
// KonqCommandRecorder etc. from libkonq/konq_undo.*
|
||||||
void UndoManager::undo()
|
void UndoManager::undo()
|
||||||
{
|
{
|
||||||
if (m_recordMacro) {
|
if (m_recordMacro) {
|
||||||
|
|
|
@ -80,7 +80,7 @@ private:
|
||||||
*
|
*
|
||||||
* @author Peter Penz <peter.penz@gmx.at>
|
* @author Peter Penz <peter.penz@gmx.at>
|
||||||
*/
|
*/
|
||||||
class UndoManager : public QObject
|
class UndoManager : public QObject // TODO switch to KonqUndoManager (multi-process, async, more robust on complex operations, no redo though)
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user