]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Extracted the servicemenu code from KonqPopupMenu into KonqMenuActions, and used...
[dolphin.git] / src / dolphinviewcontainer.cpp
index a2902afd7e547839d74e9ef2e716aad71beded7b..65e587fb244e9b2c9ec1bf7ed3fee143d870e1ac 100644 (file)
@@ -94,11 +94,10 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
     m_dirLister->setMainWindow(this);
     m_dirLister->setDelayedMimeTypes(true);
 
-    m_dolphinModel = new DolphinModel();
+    m_dolphinModel = new DolphinModel(this);
     m_dolphinModel->setDirLister(m_dirLister);
     m_dolphinModel->setDropsAllowed(DolphinModel::DropOnDirectory);
 
-
     m_proxyModel = new DolphinSortFilterProxyModel(this);
     m_proxyModel->setSourceModel(m_dolphinModel);
 
@@ -106,7 +105,7 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
             this, SLOT(updateStatusBar()));
     connect(m_dirLister, SIGNAL(percent(int)),
             this, SLOT(updateProgress(int)));
-    connect(m_dirLister, SIGNAL(deleteItem(KFileItem*)),
+    connect(m_dirLister, SIGNAL(deleteItem(const KFileItem&)),
             this, SLOT(updateStatusBar()));
     connect(m_dirLister, SIGNAL(completed()),
             this, SLOT(updateItemCount()));
@@ -190,7 +189,7 @@ bool DolphinViewContainer::isActive() const
 void DolphinViewContainer::renameSelectedItems()
 {
     DolphinViewContainer* view = m_mainWindow->activeViewContainer();
-    const QList<KFileItem> items = m_view->selectedItems();
+    const KFileItemList items = m_view->selectedItems();
     if (items.count() > 1) {
         // More than one item has been selected for renaming. Open
         // a rename dialog and rename all items afterwards.
@@ -213,8 +212,8 @@ void DolphinViewContainer::renameSelectedItems()
             Q_ASSERT(replaceIndex >= 0);
             int index = 1;
 
-            QList<KFileItem>::const_iterator it = items.begin();
-            QList<KFileItem>::const_iterator end = items.end();
+            KFileItemList::const_iterator it = items.begin();
+            KFileItemList::const_iterator end = items.end();
             while (it != end) {
                 const KUrl& oldUrl = (*it).url();
                 QString number;
@@ -309,8 +308,8 @@ void DolphinViewContainer::updateItemCount()
     m_folderCount = 0;
 
     while (it != end) {
-        KFileItem* item = *it;
-        if (item->isDir()) {
+        const KFileItem item = *it;
+        if (item.isDir()) {
             ++m_folderCount;
         } else {
             ++m_fileCount;
@@ -374,7 +373,7 @@ QString DolphinViewContainer::defaultStatusBarText() const
 QString DolphinViewContainer::selectionStatusBarText() const
 {
     QString text;
-    const QList<KFileItem> list = m_view->selectedItems();
+    const KFileItemList list = m_view->selectedItems();
     if (list.isEmpty()) {
         // when an item is triggered, it is temporary selected but selectedItems()
         // will return an empty list
@@ -384,8 +383,8 @@ QString DolphinViewContainer::selectionStatusBarText() const
     int fileCount = 0;
     int folderCount = 0;
     KIO::filesize_t byteSize = 0;
-    QList<KFileItem>::const_iterator it = list.begin();
-    const QList<KFileItem>::const_iterator end = list.end();
+    KFileItemList::const_iterator it = list.begin();
+    const KFileItemList::const_iterator end = list.end();
     while (it != end) {
         const KFileItem& item = *it;
         if (item.isDir()) {