[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/apps
From: David Faure <faure () kde ! org>
Date: 2008-10-13 21:54:04
Message-ID: 1223934844.285793.29084.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 871109 by dfaure:
Konq popupmenu fix: we don't show the "Create new" submenu over subdirs in an \
iconview because you wouldn't see the just-created file/dir, but let's show it in the \
case of the hiearchical details view ("folders expandable" option), since you can \
indeed see the new file/dir in that case. Peter: problem solved with \
itemsExpandable().
CCMAIL: peter.penz@gmx.at
M +8 -1 dolphin/src/dolphinpart.cpp
M +7 -2 dolphin/src/dolphinview.cpp
M +6 -0 dolphin/src/dolphinview.h
M +9 -11 lib/konq/konq_popupmenu.cpp
--- trunk/KDE/kdebase/apps/dolphin/src/dolphinpart.cpp #871108:871109
@@ -107,7 +107,7 @@
this, SLOT(slotRequestUrlChange(KUrl)));
connect(m_view, SIGNAL(modeChanged()),
this, SIGNAL(viewModeChanged())); // relay signal
-
+
// Watch for changes that should result in updates to the
// status bar text.
connect(m_dirLister, SIGNAL(deleteItem(const KFileItem&)),
@@ -393,6 +393,13 @@
if (addDel)
editActions.append(actionCollection()->action("delete"));
actionGroups.insert("editactions", editActions);
+
+ // Normally KonqPopupMenu only shows the "Create new" subdir in the current \
view + // since otherwise the created file would not be visible.
+ // But in treeview mode we should allow it.
+ if (m_view->itemsExpandable())
+ popupFlags |= KParts::BrowserExtension::ShowCreateDirectory;
+
}
// TODO: We should change the signature of the slots (and signals) for being \
able
--- trunk/KDE/kdebase/apps/dolphin/src/dolphinview.cpp #871108:871109
@@ -1310,7 +1310,7 @@
}
void DolphinView::updateZoomLevel(int oldZoomLevel)
-{
+{
const int newZoomLevel = \
ZoomLevelInfo::zoomLevelForIconSize(itemView()->iconSize()); if (oldZoomLevel != \
newZoomLevel) { m_controller->setZoomLevel(newZoomLevel);
@@ -1321,10 +1321,15 @@
KUrl::List DolphinView::simplifiedSelectedUrls() const
{
KUrl::List list = selectedUrls();
- if ((m_detailsView != 0) && m_detailsView->itemsExpandable()) {
+ if (itemsExpandable() ) {
list = KonqOperations::simplifiedUrlList(list);
}
return list;
}
+bool DolphinView::itemsExpandable() const
+{
+ return (m_detailsView != 0) && m_detailsView->itemsExpandable();
+}
+
#include "dolphinview.moc"
--- trunk/KDE/kdebase/apps/dolphin/src/dolphinview.h #871108:871109
@@ -334,6 +334,12 @@
void setTabsForFilesEnabled(bool tabsForFiles);
bool isTabsForFilesEnabled() const;
+ /**
+ * Returns true if the current view allows folders to be expanded,
+ * i.e. presents a hierarchical view to the user.
+ */
+ bool itemsExpandable() const;
+
public slots:
/**
* Changes the directory to \a url. If the current directory is equal to
--- trunk/KDE/kdebase/apps/lib/konq/konq_popupmenu.cpp #871108:871109
@@ -233,7 +233,8 @@
if ( isDirectory && sWriting && !isCurrentTrash ) // A dir, and we can create \
things into it {
- if ( currentDir && m_pMenuNew ) // Current dir -> add the "new" menu
+ const bool mkdirRequested = m_itemFlags & \
KParts::BrowserExtension::ShowCreateDirectory; + if ( (currentDir || \
mkdirRequested) && m_pMenuNew ) // Current dir -> add the "new" menu {
// As requested by KNewMenu :
m_pMenuNew->slotCheckUpToDate();
@@ -242,17 +243,14 @@
q->addAction( m_pMenuNew );
q->addSeparator();
}
- else
+ else if (mkdirRequested)
{
- if (m_itemFlags & KParts::BrowserExtension::ShowCreateDirectory)
- {
- QAction *actNewDir = m_ownActions.addAction( "newdir" );
- actNewDir->setIcon( KIcon("folder-new") );
- actNewDir->setText( i18n( "Create &Folder..." ) );
- QObject::connect(actNewDir, SIGNAL(triggered()), q, \
SLOT(slotPopupNewDir()));
- q->addAction( actNewDir );
- q->addSeparator();
- }
+ KAction *actNewDir = m_ownActions.addAction( "newdir" );
+ actNewDir->setIcon( KIcon("folder-new") );
+ actNewDir->setText( i18n( "Create &Folder..." ) );
+ QObject::connect(actNewDir, SIGNAL(triggered()), q, \
SLOT(slotPopupNewDir())); + q->addAction( actNewDir );
+ q->addSeparator();
}
} else if ( isIntoTrash ) {
// Trashed item, offer restoring
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic