const KFileItem item = itemForIndex(index);
if (index.isValid() && (index.column() == KDirModel::Name)) {
- if (openTab && item.isDir()) {
+ if (openTab && (item.isDir() || m_dolphinView->isTabsForFilesEnabled())) {
emit tabRequested(item.url());
} else {
emit itemTriggered(item);
m_dirLister,
m_dolphinModel,
m_proxyModel);
+ m_view->setTabsForFilesEnabled(true);
setWidget(m_view);
setXMLFile("dolphinpart.rc");
// TODO: Check issue N176832 for the missing QAIV signal; task 177399 - maybe this code
// should be moved into DolphinPart::slotItemTriggered()
KFileItem item(S_IFDIR, (mode_t)-1, url);
- Q_ASSERT(item.mimeTypePtr()->is("inode/directory")); // the signal 'tabRequested' is only emitted for dirs
KParts::OpenUrlArguments args;
args.setMimeType(item.mimetype());
emit m_extension->createNewWindow(url, args);
m_showPreview(false),
m_loadingDirectory(false),
m_storedCategorizedSorting(false),
+ m_tabsForFiles(false),
m_isContextMenuOpen(false),
m_mode(DolphinView::IconsView),
m_topLayout(0),
return ret;
}
+void DolphinView::setTabsForFilesEnabled(bool tabsForFiles)
+{
+ m_tabsForFiles = tabsForFiles;
+}
+
+bool DolphinView::isTabsForFilesEnabled() const
+{
+ return m_tabsForFiles;
+}
+
void DolphinView::emitContentsMoved()
{
// only emit the contents moved signal if:
*/
QPair<bool, QString> pasteInfo() const;
+ /**
+ * If \a tabsForFiles is true, the signal tabRequested() will also
+ * emitted also for files. Per default tabs for files is disabled
+ * and hence the signal tabRequested() will only be emitted for
+ * directories.
+ */
+ void setTabsForFilesEnabled(bool tabsForFiles);
+ bool isTabsForFilesEnabled() const;
+
public slots:
/**
* Changes the directory to \a url. If the current directory is equal to
}
private:
- bool m_active;
- bool m_showPreview;
- bool m_loadingDirectory;
- bool m_storedCategorizedSorting;
- bool m_isContextMenuOpen; // TODO: workaround for Qt-issue xxxxxx
+ bool m_active : 1;
+ bool m_showPreview : 1;
+ bool m_loadingDirectory : 1;
+ bool m_storedCategorizedSorting : 1;
+ bool m_tabsForFiles : 1;
+ bool m_isContextMenuOpen : 1; // TODO: workaround for Qt-issue xxxxxx
+
Mode m_mode;
DolphinMainWindow* m_mainWindow;