svn path=/trunk/KDE/kdebase/apps/; revision=720234
15 files changed:
DolphinMainWindow* m_mainWindow;
KFileItem m_fileInfo;
KUrl m_baseUrl;
DolphinMainWindow* m_mainWindow;
KFileItem m_fileInfo;
KUrl m_baseUrl;
- QList<KFileItem> m_selectedItems;
+ KFileItemList m_selectedItems;
KUrl::List m_selectedUrls;
int m_context;
};
KUrl::List m_selectedUrls;
int m_context;
};
-void DolphinMainWindow::changeSelection(const QList<KFileItem>& selection)
+void DolphinMainWindow::changeSelection(const KFileItemList& selection)
{
activeViewContainer()->view()->changeSelection(selection);
}
{
activeViewContainer()->view()->changeSelection(selection);
}
-void DolphinMainWindow::slotSelectionChanged(const QList<KFileItem>& selection)
+void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
addDockWidget(Qt::RightDockWidgetArea, infoDock);
connect(this, SIGNAL(urlChanged(KUrl)),
infoWidget, SLOT(setUrl(KUrl)));
addDockWidget(Qt::RightDockWidgetArea, infoDock);
connect(this, SIGNAL(urlChanged(KUrl)),
infoWidget, SLOT(setUrl(KUrl)));
- connect(this, SIGNAL(selectionChanged(QList<KFileItem>)),
- infoWidget, SLOT(setSelection(QList<KFileItem>)));
+ connect(this, SIGNAL(selectionChanged(KFileItemList)),
+ infoWidget, SLOT(setSelection(KFileItemList)));
connect(this, SIGNAL(requestItemInfo(KFileItem)),
infoWidget, SLOT(requestDelayedItemInfo(KFileItem)));
connect(this, SIGNAL(requestItemInfo(KFileItem)),
infoWidget, SLOT(requestDelayedItemInfo(KFileItem)));
treeWidget, SLOT(setUrl(KUrl)));
connect(treeWidget, SIGNAL(changeUrl(KUrl)),
this, SLOT(changeUrl(KUrl)));
treeWidget, SLOT(setUrl(KUrl)));
connect(treeWidget, SIGNAL(changeUrl(KUrl)),
this, SLOT(changeUrl(KUrl)));
- connect(treeWidget, SIGNAL(changeSelection(QList<KFileItem>)),
- this, SLOT(changeSelection(QList<KFileItem>)));
+ connect(treeWidget, SIGNAL(changeSelection(KFileItemList)),
+ this, SLOT(changeSelection(KFileItemList)));
connect(treeWidget, SIGNAL(urlsDropped(KUrl::List, KUrl)),
this, SLOT(dropUrls(KUrl::List, KUrl)));
connect(treeWidget, SIGNAL(urlsDropped(KUrl::List, KUrl)),
this, SLOT(dropUrls(KUrl::List, KUrl)));
void DolphinMainWindow::updateEditActions()
{
void DolphinMainWindow::updateEditActions()
{
- const QList<KFileItem> list = m_activeViewContainer->view()->selectedItems();
+ const KFileItemList list = m_activeViewContainer->view()->selectedItems();
if (list.isEmpty()) {
stateChanged("has_no_selection");
} else {
if (list.isEmpty()) {
stateChanged("has_no_selection");
} else {
bool enableMoveToTrash = true;
bool enableMoveToTrash = true;
- 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 KUrl& url = (*it).url();
// only enable the 'Move to Trash' action for local files
while (it != end) {
const KUrl& url = (*it).url();
// only enable the 'Move to Trash' action for local files
this, SLOT(slotSortOrderChanged(Qt::SortOrder)));
connect(view, SIGNAL(additionalInfoChanged(KFileItemDelegate::InformationList)),
this, SLOT(slotAdditionalInfoChanged(KFileItemDelegate::InformationList)));
this, SLOT(slotSortOrderChanged(Qt::SortOrder)));
connect(view, SIGNAL(additionalInfoChanged(KFileItemDelegate::InformationList)),
this, SLOT(slotAdditionalInfoChanged(KFileItemDelegate::InformationList)));
- connect(view, SIGNAL(selectionChanged(QList<KFileItem>)),
- this, SLOT(slotSelectionChanged(QList<KFileItem>)));
+ connect(view, SIGNAL(selectionChanged(KFileItemList)),
+ this, SLOT(slotSelectionChanged(KFileItemList)));
connect(view, SIGNAL(requestItemInfo(KFileItem)),
this, SLOT(slotRequestItemInfo(KFileItem)));
connect(view, SIGNAL(activated()),
connect(view, SIGNAL(requestItemInfo(KFileItem)),
this, SLOT(slotRequestItemInfo(KFileItem)));
connect(view, SIGNAL(activated()),
* Inform all affected dolphin components that a selection change is
* requested.
*/
* Inform all affected dolphin components that a selection change is
* requested.
*/
- void changeSelection(const QList<KFileItem>& selection);
+ void changeSelection(const KFileItemList& selection);
/** Stores all settings and quits Dolphin. */
void quit();
/** Stores all settings and quits Dolphin. */
void quit();
* Is sent if the selection of the currently active view has
* been changed.
*/
* Is sent if the selection of the currently active view has
* been changed.
*/
- void selectionChanged(const QList<KFileItem>& selection);
+ void selectionChanged(const KFileItemList& selection);
/**
* Is sent if the url of the currently active view has
/**
* Is sent if the url of the currently active view has
* Updates the state of the 'Edit' menu actions and emits
* the signal selectionChanged().
*/
* Updates the state of the 'Edit' menu actions and emits
* the signal selectionChanged().
*/
- void slotSelectionChanged(const QList<KFileItem>& selection);
+ void slotSelectionChanged(const KFileItemList& selection);
/** Emits the signal requestItemInfo(). */
void slotRequestItemInfo(const KFileItem&);
/** Emits the signal requestItemInfo(). */
void slotRequestItemInfo(const KFileItem&);
this, SLOT(slotItemTriggered(KFileItem)));
connect(m_view, SIGNAL(requestContextMenu(KFileItem, const KUrl&)),
this, SLOT(slotOpenContextMenu(KFileItem, const KUrl&)));
this, SLOT(slotItemTriggered(KFileItem)));
connect(m_view, SIGNAL(requestContextMenu(KFileItem, const KUrl&)),
this, SLOT(slotOpenContextMenu(KFileItem, const KUrl&)));
- connect(m_view, SIGNAL(selectionChanged(QList<KFileItem>)),
- m_extension, SIGNAL(selectionInfo(QList<KFileItem>)));
+ connect(m_view, SIGNAL(selectionChanged(KFileItemList)),
+ m_extension, SIGNAL(selectionInfo(KFileItemList)));
connect(m_view, SIGNAL(requestItemInfo(KFileItem)),
this, SLOT(slotRequestItemInfo(KFileItem)));
connect(m_view, SIGNAL(requestItemInfo(KFileItem)),
this, SLOT(slotRequestItemInfo(KFileItem)));
itemView()->selectionModel()->clear();
}
itemView()->selectionModel()->clear();
}
-QList<KFileItem> DolphinView::selectedItems() const
+KFileItemList DolphinView::selectedItems() const
{
const QAbstractItemView* view = itemView();
{
const QAbstractItemView* view = itemView();
Q_ASSERT((view != 0) && (view->selectionModel() != 0));
const QItemSelection selection = m_proxyModel->mapSelectionToSource(view->selectionModel()->selection());
Q_ASSERT((view != 0) && (view->selectionModel() != 0));
const QItemSelection selection = m_proxyModel->mapSelectionToSource(view->selectionModel()->selection());
- QList<KFileItem> itemList;
+ KFileItemList itemList;
const QModelIndexList indexList = selection.indexes();
foreach (QModelIndex index, indexList) {
const QModelIndexList indexList = selection.indexes();
foreach (QModelIndex index, indexList) {
KUrl::List DolphinView::selectedUrls() const
{
KUrl::List urls;
KUrl::List DolphinView::selectedUrls() const
{
KUrl::List urls;
- const QList<KFileItem> list = selectedItems();
- for ( QList<KFileItem>::const_iterator it = list.begin(), end = list.end();
- it != end; ++it ) {
- urls.append((*it).url());
+ const KFileItemList list = selectedItems();
+ foreach (KFileItem item, list) {
+ urls.append(item.url());
-void DolphinView::changeSelection(const QList<KFileItem>& selection)
+void DolphinView::changeSelection(const KFileItemList& selection)
{
clearSelection();
if (selection.isEmpty()) {
{
clearSelection();
if (selection.isEmpty()) {
* selected.
* @see DolphinView::selectedUrls()
*/
* selected.
* @see DolphinView::selectedUrls()
*/
- QList<KFileItem> selectedItems() const;
+ KFileItemList selectedItems() const;
/**
* Returns a list of URLs for all selected items. An empty list
/**
* Returns a list of URLs for all selected items. An empty list
* will actually get selected. The view will e.g. not select items which
* are not in the currently displayed folder.
*/
* will actually get selected. The view will e.g. not select items which
* are not in the currently displayed folder.
*/
- void changeSelection(const QList<KFileItem>& selection);
+ void changeSelection(const KFileItemList& selection);
/**
* Is emitted whenever the selection has been changed.
*/
/**
* Is emitted whenever the selection has been changed.
*/
- void selectionChanged(const QList<KFileItem>& selection);
+ void selectionChanged(const KFileItemList& selection);
/**
* Is emitted if a context menu is requested for the item \a item,
/**
* Is emitted if a context menu is requested for the item \a item,
void DolphinViewContainer::renameSelectedItems()
{
DolphinViewContainer* view = m_mainWindow->activeViewContainer();
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.
if (items.count() > 1) {
// More than one item has been selected for renaming. Open
// a rename dialog and rename all items afterwards.
Q_ASSERT(replaceIndex >= 0);
int index = 1;
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;
while (it != end) {
const KUrl& oldUrl = (*it).url();
QString number;
QString DolphinViewContainer::selectionStatusBarText() const
{
QString text;
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
if (list.isEmpty()) {
// when an item is triggered, it is temporary selected but selectedItems()
// will return an empty list
int fileCount = 0;
int folderCount = 0;
KIO::filesize_t byteSize = 0;
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()) {
while (it != end) {
const KFileItem& item = *it;
if (item.isDir()) {
-void InfoSidebarPage::setSelection(const QList<KFileItem>& selection)
+void InfoSidebarPage::setSelection(const KFileItemList& selection)
{
SidebarPage::setSelection(selection);
if (selection.size() == 1) {
{
SidebarPage::setSelection(selection);
if (selection.size() == 1) {
- const QList<KFileItem>& selectedItems = selection();
+ const KFileItemList& selectedItems = selection();
KUrl file;
if (selectedItems.isEmpty()) {
KUrl file;
if (selectedItems.isEmpty()) {
- const QList<KFileItem>& selectedItems = selection();
+ const KFileItemList& selectedItems = selection();
if (selectedItems.size() <= 1) {
KFileItem fileItem(S_IFDIR, KFileItem::Unknown, m_shownUrl);
fileItem.refresh();
if (selectedItems.size() <= 1) {
KFileItem fileItem(S_IFDIR, KFileItem::Unknown, m_shownUrl);
fileItem.refresh();
virtual void setUrl(const KUrl& url);
/** @see SidebarPage::setSelection() */
virtual void setUrl(const KUrl& url);
/** @see SidebarPage::setSelection() */
- virtual void setSelection(const QList<KFileItem>& selection);
+ virtual void setSelection(const KFileItemList& selection);
/**
* Does a delayed request of information for the item \a item.
/**
* Does a delayed request of information for the item \a item.
#include <QtGui/QLabel>
#include <QtGui/QBoxLayout>
#include <QtGui/QLabel>
#include <QtGui/QBoxLayout>
-RenameDialog::RenameDialog(const QList<KFileItem>& items) :
+RenameDialog::RenameDialog(const KFileItemList& items) :
KDialog(),
m_renameOneItem(false)
{
KDialog(),
m_renameOneItem(false)
{
- explicit RenameDialog(const QList<KFileItem>& items);
+ explicit RenameDialog(const KFileItemList& items);
virtual ~RenameDialog();
/**
virtual ~RenameDialog();
/**
-const QList<KFileItem>& SidebarPage::selection() const
+const KFileItemList& SidebarPage::selection() const
{
return m_currentSelection;
}
{
return m_currentSelection;
}
-void SidebarPage::setSelection(const QList<KFileItem>& selection)
+void SidebarPage::setSelection(const KFileItemList& selection)
{
m_currentSelection = selection;
}
{
m_currentSelection = selection;
}
const KUrl& url() const;
/** Returns the current selected items of the active Dolphin view. */
const KUrl& url() const;
/** Returns the current selected items of the active Dolphin view. */
- const QList<KFileItem>& selection() const;
+ const KFileItemList& selection() const;
* This is invoked to inform the sidebar that the user has selected a new
* set of items.
*/
* This is invoked to inform the sidebar that the user has selected a new
* set of items.
*/
- virtual void setSelection(const QList<KFileItem>& selection);
+ virtual void setSelection(const KFileItemList& selection);
* e.g. the current folder. The new selection will be reported via the
* setSelection slot.
*/
* e.g. the current folder. The new selection will be reported via the
* setSelection slot.
*/
- void changeSelection(const QList<KFileItem>& selection);
+ void changeSelection(const KFileItemList& selection);
/**
* This signal is emitted whenever a drop action on this widget needs the
/**
* This signal is emitted whenever a drop action on this widget needs the
- QList<KFileItem> m_currentSelection;
+ KFileItemList m_currentSelection;
};
#endif // _SIDEBARPAGE_H_
};
#endif // _SIDEBARPAGE_H_
void TreeViewContextMenu::rename()
{
void TreeViewContextMenu::rename()
{
item.append(m_fileInfo);
RenameDialog dialog(item);
if (dialog.exec() == QDialog::Accepted) {
item.append(m_fileInfo);
RenameDialog dialog(item);
if (dialog.exec() == QDialog::Accepted) {
const QModelIndex dolphinModelIndex = m_proxyModel->mapToSource(index);
KFileItem item = m_dolphinModel->itemForIndex(dolphinModelIndex);
const QModelIndex dolphinModelIndex = m_proxyModel->mapToSource(index);
KFileItem item = m_dolphinModel->itemForIndex(dolphinModelIndex);
- emit changeSelection(QList<KFileItem>());
+ emit changeSelection(KFileItemList());
TreeViewContextMenu contextMenu(this, item);
contextMenu.open();
}
TreeViewContextMenu contextMenu(this, item);
contextMenu.open();
}