┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-10-05 16:30:03 +0000
committerPeter Penz <[email protected]>2010-10-05 16:30:03 +0000
commit828ba8902ce16819a385832b487e60eab36e54ca (patch)
tree429a18e73be3cc5b61a48a31385f021a7d29f9de /src/views/dolphinview.cpp
parent7fcab3c7839d46592dc821b12c572a7040435a38 (diff)
- Integrate the patch from Matthias Fuchs from http://reviewboard.kde.org/r/5496 to allow having leading zeros when renaming files: E.g. Using the name "A ###.jpg" results in the filenames "A 001.jpg", "A 002.jpg"... The patch could be simplified a little bit by guaranting only one connective sequence of #'s.
- Move the renaming code into the RenameDialog CCMAIL: [email protected] BUG: 226761 FIXED-IN: 4.6.0 svn path=/trunk/KDE/kdebase/apps/; revision=1182776
Diffstat (limited to 'src/views/dolphinview.cpp')
-rw-r--r--src/views/dolphinview.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index e9bee3186..79706358f 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -45,7 +45,6 @@
#include <konq_fileitemcapabilities.h>
#include <konq_operations.h>
#include <konqmimedata.h>
-#include <kstringhandler.h>
#include <ktoggleaction.h>
#include <kurl.h>
@@ -68,15 +67,6 @@
#include "zoomlevelinfo.h"
#include "dolphindetailsviewexpander.h"
-/**
- * Helper function for sorting items with qSort() in
- * DolphinView::renameSelectedItems().
- */
-bool lessThan(const KFileItem& item1, const KFileItem& item2)
-{
- return KStringHandler::naturalCompare(item1.name(), item2.name()) < 0;
-}
-
DolphinView::DolphinView(QWidget* parent,
const KUrl& url,
DolphinSortFilterProxyModel* proxyModel) :
@@ -600,7 +590,7 @@ void DolphinView::renameSelectedItems()
if (itemCount < 1) {
return;
}
-
+/*
if (itemCount > 1) {
// More than one item has been selected for renaming. Open
// a rename dialog and rename all items afterwards.
@@ -646,16 +636,21 @@ void DolphinView::renameSelectedItems()
KonqOperations::rename(this, oldUrl, newUrl);
}
}
- } else if (DolphinSettings::instance().generalSettings()->renameInline()) {
- Q_ASSERT(itemCount == 1);
+ } else*/
+
+ if ((itemCount == 1) && DolphinSettings::instance().generalSettings()->renameInline()) {
const QModelIndex dirIndex = m_viewAccessor.dirModel()->indexForItem(items.first());
const QModelIndex proxyIndex = m_viewAccessor.proxyModel()->mapFromSource(dirIndex);
m_viewAccessor.itemView()->edit(proxyIndex);
} else {
- Q_ASSERT(itemCount == 1);
+ RenameDialog* dialog = new RenameDialog(this, items);
+ dialog->setAttribute(Qt::WA_DeleteOnClose);
+ dialog->show();
+ dialog->raise();
+ dialog->activateWindow();
- QPointer<RenameDialog> dialog = new RenameDialog(this, items);
- if (dialog->exec() == QDialog::Rejected) {
+ // XXX
+ /* if (dialog->exec() == QDialog::Rejected) {
delete dialog;
return;
}
@@ -671,7 +666,7 @@ void DolphinView::renameSelectedItems()
const KUrl& oldUrl = items.first().url();
KUrl newUrl = oldUrl;
newUrl.setFileName(newName);
- KonqOperations::rename(this, oldUrl, newUrl);
+ KonqOperations::rename(this, oldUrl, newUrl);*/
}
// assure that the current index remains visible when KDirLister