X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/7fec7ff9a096d288b66fce2699c7b8bc71f6fbbb..f271d952ec990817420ac618e0161ef8db36d8bf:/src/dolphin.cpp diff --git a/src/dolphin.cpp b/src/dolphin.cpp index 2e7efec6f..ac1f067a4 100644 --- a/src/dolphin.cpp +++ b/src/dolphin.cpp @@ -143,6 +143,7 @@ void Dolphin::dropUrls(const KUrl::List& urls, /* KDE4-TODO: selectedIndex = popup.exec(QCursor::pos()); */ popup.exec(QCursor::pos()); 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) { @@ -396,7 +397,7 @@ void Dolphin::createFolder() // TODO: provide message type hint if (ok) { - statusBar->setMessage(i18n("Created folder %1.").arg(url.path()), + statusBar->setMessage(i18n("Created folder %1.",url.path()), DolphinStatusBar::OperationCompleted); DolphinCommand command(DolphinCommand::CreateFolder, KUrl::List(), url); @@ -406,11 +407,11 @@ void Dolphin::createFolder() // Creating of the folder has been failed. Check whether the creating // has been failed because a folder with the same name exists... if (KIO::NetAccess::exists(url, true, this)) { - statusBar->setMessage(i18n("A folder named %1 already exists.").arg(url.path()), + statusBar->setMessage(i18n("A folder named %1 already exists.",url.path()), DolphinStatusBar::Error); } else { - statusBar->setMessage(i18n("Creating of folder %1 failed.").arg(url.path()), + statusBar->setMessage(i18n("Creating of folder %1 failed.",url.path()), DolphinStatusBar::Error); } @@ -491,7 +492,7 @@ void Dolphin::createFile() const QString destPath(viewUrl.pathOrUrl() + "/" + KIO::encodeFileName(name)); const KUrl destUrl(destPath); if (KIO::NetAccess::exists(destUrl, false, this)) { - statusBar->setMessage(i18n("A file named %1 already exists.").arg(name), + statusBar->setMessage(i18n("A file named %1 already exists.",name), DolphinStatusBar::Error); return; } @@ -501,7 +502,7 @@ void Dolphin::createFile() KIO::CopyJob* job = KIO::copyAs(sourceUrl, destUrl); job->setDefaultPermissions(true); if (KIO::NetAccess::synchronousRun(job, this)) { - statusBar->setMessage(i18n("Created file %1.").arg(name), + statusBar->setMessage(i18n("Created file %1.",name), DolphinStatusBar::OperationCompleted); KUrl::List list; @@ -511,7 +512,7 @@ void Dolphin::createFile() } else { - statusBar->setMessage(i18n("Creating of file %1 failed.").arg(name), + statusBar->setMessage(i18n("Creating of file %1 failed.",name), DolphinStatusBar::Error); } } @@ -540,11 +541,11 @@ void Dolphin::deleteItems() QString text; if (itemCount > 1) { - text = i18n("Do you really want to delete the %1 selected items?").arg(itemCount); + text = i18n("Do you really want to delete the %1 selected items?",itemCount); } else { const KUrl& url = list.first(); - text = i18n("Do you really want to delete '%1'?").arg(url.fileName()); + text = i18n("Do you really want to delete '%1'?",url.fileName()); } const bool del = KMessageBox::warningContinueCancel(this, @@ -641,6 +642,9 @@ void Dolphin::slotRedoTextChanged(const QString& text) 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; /* KDE4-TODO: Q3DragObject* data = new KUrlDrag(m_activeView->selectedUrls(), widget()); @@ -658,7 +662,7 @@ void Dolphin::copy() void Dolphin::paste() { - /* KDE4-TODO: + /* KDE4-TODO: - see KonqOperations::doPaste QClipboard* clipboard = QApplication::clipboard(); QMimeSource* data = clipboard->data(); if (!KUrlDrag::canDecode(data)) { @@ -739,6 +743,8 @@ void Dolphin::updatePasteAction() else if (count == 1) { // Only one file is selected. Pasting is only allowed if this // 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, KFileItem::Unknown, urls.first(), @@ -1266,7 +1272,7 @@ void Dolphin::setupActions() KToggleAction* detailsView = new KToggleAction(i18n("Details"), actionCollection(), "details"); detailsView->setShortcut(Qt::CTRL | Qt::Key_2); detailsView->setIcon(KIcon("view_text")); - connect(detailsView, SIGNAL(triggered()), this, SLOT(setIconsView())); + connect(detailsView, SIGNAL(triggered()), this, SLOT(setDetailsView())); KToggleAction* previewsView = new KToggleAction(i18n("Previews"), actionCollection(), "previews"); previewsView->setShortcut(Qt::CTRL | Qt::Key_3); @@ -1418,7 +1424,7 @@ void Dolphin::setupCreateNewMenuActions() unplugActionList("create_actions"); KSortableList::ConstIterator it = m_createFileTemplates.begin(); KSortableList::ConstIterator end = m_createFileTemplates.end(); - /* KDE4-TODO: + /* KDE4-TODO: don't port this code; use KNewMenu instead while (it != end) { CreateFileEntry entry = (*it).value(); KAction* action = new KAction(entry.name);