[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kfile
From:       David Faure <faure () kde ! org>
Date:       2007-12-04 17:12:22
Message-ID: 1196788342.916964.6722.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 744829 by dfaure:

Remove references to already-unused soon-dead KFileView
Add setCurrentItem(KFileItem) needed by kuickshow (makes sense, too :).


 M  +8 -5      kdiroperator.cpp  
 M  +13 -10    kdiroperator.h  
 M  +0 -1      kfilewidget.cpp  


--- trunk/KDE/kdelibs/kfile/kdiroperator.cpp #744828:744829
@@ -22,7 +22,6 @@
 #include "kdirmodel.h"
 #include "kdiroperatordetailview_p.h"
 #include "kdirsortfilterproxymodel.h"
-#include "kfileview.h"
 #include "kfileitem.h"
 #include "kfilemetapreview.h"
 #include "kpreviewwidgetbase.h"
@@ -1402,15 +1401,19 @@
 
 void KDirOperator::setCurrentItem(const QString& filename)
 {
-    if (d->itemView == 0) {
-        return;
-    }
-
     KFileItem item;
     if ( !filename.isNull() ) {
         item = d->dirLister->findByName(filename);
     }
+    setCurrentItem(item);
+}
 
+void KDirOperator::setCurrentItem(const KFileItem& item)
+{
+    if (d->itemView == 0) {
+        return;
+    }
+
     QItemSelectionModel *selModel = d->itemView->selectionModel();
     if (selModel) {
         selModel->clear();
--- trunk/KDE/kdelibs/kfile/kdiroperator.h #744828:744829
@@ -27,15 +27,16 @@
 #include <ktoggleaction.h>
 #include <kcompletion.h>
 #include <kdirlister.h>
-#include <kfileview.h>
 #include <kfileitem.h>
 #include <kfile.h>
+#include <kfile_export.h>
 
 class QAbstractItemView;
 class QModelIndex;
 class QProgressBar;
 
 class KAction;
+class KActionCollection;
 class KActionMenu;
 class KDirLister;
 class KPreviewWidgetBase;
@@ -208,13 +209,16 @@
     void setCurrentItem(const QString& filename);
 
     /**
-     * Sets a new KFileView to be used for showing and browsing files.
+     * Clears the current selection and attempts to set @p item
+     * as the the current item.
+     */
+    void setCurrentItem(const KFileItem& item);
+
+    /**
+     * Sets a new view to be used for showing and browsing files.
      * Note: this will read the current url() to fill the view.
      *
-     * @see KFileView
-     * @see KFileIconView
-     * @see KFileDetailView
-     * @see KCombiView
+     * @see KFileTreeView
      * @see view
      */
     virtual void setView(QAbstractItemView *view);
@@ -369,8 +373,7 @@
 
     /**
      * Sets the config object and the to be used group in KDirOperator. This
-     * will be used to store the view's configuration via
-     * KFileView::writeConfig() (and for KFileView::readConfig()).
+     * will be used to store the view's configuration.
      * If you don't set this, the views cannot save and restore their
      * configuration.
      *
@@ -502,7 +505,7 @@
 
     /**
      * Sets the options for dropping files.
-     * @see KFileView::DropOptions
+     * CURRENTLY NOT IMPLEMENTED
      */
     virtual void setDropOptions(int options);
 
@@ -523,7 +526,7 @@
      * but you can also call it directly. Reimplement this if you depend on self defined fileviews.
      * @param parent   is the QWidget to be set as parent
      * @param viewKind is the predefined view to be set, note: this can be several ones OR:ed together
-     * @returns the created KFileView
+     * @returns the created view
      * @see KFile::FileView
      * @see setView
      */
--- trunk/KDE/kdelibs/kfile/kfilewidget.cpp #744828:744829
@@ -36,7 +36,6 @@
 #include <kdiroperator.h>
 #include <kdirselectdialog.h>
 #include <kfilefiltercombo.h>
-#include <kfileview.h>
 #include <kimagefilepreview.h>
 #include <kmenu.h>
 #include <kmimetype.h>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic