[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/apps
From: David Faure <faure () kde ! org>
Date: 2008-12-08 11:20:09
Message-ID: 1228735209.498424.14206.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 894264 by dfaure:
Port to KDirModel::simplifiedUrlList
M +18 -18 dolphin/src/dolphinview.cpp
M +0 -29 lib/konq/konq_operations.cpp
M +0 -12 lib/konq/konq_operations.h
--- trunk/KDE/kdebase/apps/dolphin/src/dolphinview.cpp #894263:894264
@@ -389,7 +389,7 @@
} else if (level > ZoomLevelInfo::maximumLevel()) {
level = ZoomLevelInfo::maximumLevel();
}
-
+
if (level != zoomLevel()) {
m_controller->setZoomLevel(level);
m_previewGenerator->updatePreviews();
@@ -522,7 +522,7 @@
int folderCount = 0;
int fileCount = 0;
KIO::filesize_t totalFileSize = 0;
-
+
if (hasSelection()) {
// give a summary of the status of the selected files
const KFileItemList list = selectedItems();
@@ -544,7 +544,7 @@
}
++it;
}
-
+
if (folderCount + fileCount == 1) {
// if only one item is selected, show the filename
const QString name = list.first().name();
@@ -610,7 +610,7 @@
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.
@@ -650,7 +650,7 @@
}
} else if (DolphinSettings::instance().generalSettings()->renameInline()) {
Q_ASSERT(itemCount == 1);
-
+
if (isColumnViewActive()) {
m_columnView->editItem(items.first());
} else {
@@ -660,7 +660,7 @@
}
} else {
Q_ASSERT(itemCount == 1);
-
+
RenameDialog dialog(this, items);
if (dialog.exec() == QDialog::Rejected) {
return;
@@ -737,10 +737,10 @@
m_showPreview = show;
m_previewGenerator->setPreviewShown(show);
-
+
const int oldZoomLevel = m_controller->zoomLevel();
emit showPreviewChanged();
-
+
// Enabling or disabling the preview might change the icon size of the view.
// As the view does not emit a signal when the icon size has been changed,
// the used zoom level of the controller must be adjusted manually:
@@ -842,7 +842,7 @@
m_controller->requestActivation();
}
break;
-
+
case QEvent::MouseButtonPress:
if ((watched == itemView()->viewport()) && (m_expandedViews.count() > 0)) {
// Listening to a mousebutton press event to delete expanded views is a
@@ -853,13 +853,13 @@
deleteExpandedViews();
}
break;
-
+
case QEvent::DragEnter:
if (watched == itemView()->viewport()) {
setActive(true);
}
break;
-
+
default:
break;
}
@@ -1165,11 +1165,11 @@
const Mode mode = props.viewMode();
if (m_mode != mode) {
const int oldZoomLevel = m_controller->zoomLevel();
-
+
m_mode = mode;
createView();
emit modeChanged();
-
+
updateZoomLevel(oldZoomLevel);
}
if (itemView() == 0) {
@@ -1213,10 +1213,10 @@
if (showPreview != m_showPreview) {
m_showPreview = showPreview;
m_previewGenerator->setPreviewShown(showPreview);
-
+
const int oldZoomLevel = m_controller->zoomLevel();
emit showPreviewChanged();
-
+
// Enabling or disabling the preview might change the icon size of the view.
// As the view does not emit a signal when the icon size has been changed,
// the used zoom level of the controller must be adjusted manually:
@@ -1319,7 +1319,7 @@
m_topLayout->removeWidget(view);
view->close();
-
+
disconnect(view);
m_controller->disconnect(view);
view->disconnect();
@@ -1337,7 +1337,7 @@
view->deleteLater();
}
view = 0;
-
+
m_iconsView = 0;
m_detailsView = 0;
m_columnView = 0;
@@ -1403,7 +1403,7 @@
{
KUrl::List list = selectedUrls();
if (itemsExpandable() ) {
- list = KonqOperations::simplifiedUrlList(list);
+ list = KDirModel::simplifiedUrlList(list);
}
return list;
}
--- trunk/KDE/kdebase/apps/lib/konq/konq_operations.cpp #894263:894264
@@ -243,35 +243,6 @@
return uiDelegate.askDeleteConfirmation(selectedUrls, deletionType, \
confirmationType); }
-bool lessThan( const KUrl &left, const KUrl &right )
-{
- return left.url().compare( right.url() ) < 0;
-}
-
-KUrl::List KonqOperations::simplifiedUrlList( const KUrl::List &urls )
-{
- if (!urls.count()) {
- return urls;
- }
-
- KUrl::List ret( urls );
- qSort( ret.begin(), ret.end(), lessThan );
-
- KUrl::List::iterator it = ret.begin();
- KUrl url = *it;
- ++it;
- while ( it != ret.end() ) {
- if ( url.isParentOf( *it ) ) {
- it = ret.erase( it );
- } else {
- url = *it;
- ++it;
- }
- }
-
- return ret;
-}
-
void KonqOperations::doDrop( const KFileItem & destItem, const KUrl & dest, \
QDropEvent * ev, QWidget * parent ) {
kDebug(1203) << "doDrop: dest:" << dest;
--- trunk/KDE/kdebase/apps/lib/konq/konq_operations.h #894263:894264
@@ -149,18 +149,6 @@
*/
static bool askDeleteConfirmation( const KUrl::List & selectedUrls, int method, \
ConfirmationType confirmation, QWidget* widget );
- /**
- * Remove urls from the list if an ancestor is present on the list. This can
- * be used to delete only the ancestor url and skip a potential error of a \
non-existent url.
- *
- * For example, for a list of "/home/foo/a", "/home/foo/a/a.txt", \
"/home/foo/a/a/a.txt", "/home/foo/a/b/b.txt",
- * "home/foo/b/b.txt", this method will return the list "/home/foo/a", \
"/home/foo/b/b.txt".
- *
- * @return the list @p urls without parented urls inside.
- * @since 4.2
- */
- static KUrl::List simplifiedUrlList( const KUrl::List & urls );
-
Q_SIGNALS:
void statFinished( const KFileItem & item );
void aboutToCreate(const QPoint &pos, const QList<KIO::CopyInfo> &files);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic