m_nameFilter(),
m_url(),
m_dolphinView(dolphinView),
- m_itemView(0)
+ m_itemView(0),
+ m_versionControlActions()
{
}
{
if (m_url != url) {
m_url = url;
+ emit cancelPreviews();
emit urlChanged(url);
}
}
+void DolphinController::redirectToUrl(const KUrl& url)
+{
+ m_url = url;
+}
+
void DolphinController::setItemView(QAbstractItemView* view)
{
if (m_itemView != 0) {
}
}
+void DolphinController::setVersionControlActions(QList<QAction*> actions)
+{
+ m_versionControlActions = actions;
+}
+
+QList<QAction*> DolphinController::versionControlActions(const KFileItemList& items)
+{
+ emit requestVersionControlActions(items);
+ // All view implementations are connected with the signal requestVersionControlActions()
+ // (see ViewExtensionFactory) and will invoke DolphinController::setVersionControlActions(),
+ // so that the context dependent actions can be returned.
+ return m_versionControlActions;
+}
+
void DolphinController::handleKeyPressEvent(QKeyEvent* event)
{
Q_ASSERT(m_itemView != 0);
|| (event->key() == Qt::Key_Enter))
&& !selModel->selectedIndexes().isEmpty();
if (trigger) {
+ QModelIndexList dirQueue;
const QModelIndexList indexList = selModel->selectedIndexes();
foreach (const QModelIndex& index, indexList) {
- emit itemTriggered(itemForIndex(index));
+ // Trigger non-directories immediately.
+ if (!itemForIndex(index).isDir()) {
+ emit itemTriggered(itemForIndex(index));
+ } else {
+ // Keep storing the directory indexes for trigger later.
+ dirQueue << index;
+ }
+ }
+ // Trigger directories - Tabs if multiple, else normal.
+ if (!dirQueue.isEmpty()) {
+ if (dirQueue.length() == 1) {
+ // For single directory selection, open normally.
+ emit itemTriggered(itemForIndex(dirQueue[0]));
+ } else {
+ foreach(const QModelIndex& dir, dirQueue) {
+ // Since its a valid directory - open a tab.
+ emit tabRequested(itemForIndex(dir).url());
+ }
+ }
}
}
}