- fix focus issue in column-view

- minor interface corrections

svn path=/trunk/KDE/kdebase/apps/; revision=1017162
This commit is contained in:
Peter Penz 2009-08-29 19:35:59 +00:00
parent 60d28ca5c9
commit 625cfd2743
4 changed files with 12 additions and 13 deletions

View file

@ -65,13 +65,13 @@ public:
* of the shown directory, it does not trigger a loading of the model.
*/
void setChildUrl(const KUrl& url);
const KUrl& childUrl() const;
KUrl childUrl() const;
/** Sets the directory URL that is shown inside the column widget. */
void setUrl(const KUrl& url);
/** Returns the directory URL that is shown inside the column widget. */
const KUrl& url() const;
KUrl url() const;
/**
* Updates the background color dependent from the activation state
@ -149,7 +149,7 @@ inline void DolphinColumnView::setChildUrl(const KUrl& url)
m_childUrl = url;
}
inline const KUrl& DolphinColumnView::childUrl() const
inline KUrl DolphinColumnView::childUrl() const
{
return m_childUrl;
}
@ -162,7 +162,7 @@ inline void DolphinColumnView::setUrl(const KUrl& url)
}
}
inline const KUrl& DolphinColumnView::url() const
inline KUrl DolphinColumnView::url() const
{
return m_url;
}

View file

@ -48,8 +48,8 @@ DolphinColumnViewContainer::DolphinColumnViewContainer(QWidget* parent,
setFrameShape(QFrame::NoFrame);
setLayoutDirection(Qt::LeftToRight);
connect(this, SIGNAL(viewportEntered()),
controller, SLOT(emitViewportEntered()));
//connect(this, SIGNAL(viewportEntered()),
// controller, SLOT(emitViewportEntered()));
connect(controller, SIGNAL(activationChanged(bool)),
this, SLOT(updateColumnsBackground(bool)));
@ -83,12 +83,12 @@ QAbstractItemView* DolphinColumnViewContainer::activeColumn() const
return m_columns[m_index];
}
bool DolphinColumnViewContainer::showColumn(const KUrl& url)
void DolphinColumnViewContainer::showColumn(const KUrl& url)
{
if (!rootUrl().isParentOf(url)) {
removeAllColumns();
m_columns[0]->setUrl(url);
return false;
return;
}
int columnIndex = 0;
@ -97,7 +97,7 @@ bool DolphinColumnViewContainer::showColumn(const KUrl& url)
// the column represents already the requested URL, hence activate it
requestActivation(column);
layoutColumns();
return false;
return;
} else if (!column->url().isParentOf(url)) {
// the column is no parent of the requested URL, hence
// just delete all remaining columns
@ -168,8 +168,6 @@ bool DolphinColumnViewContainer::showColumn(const KUrl& url)
m_index = columnIndex;
m_columns[m_index]->setActive(true);
assureVisibleActiveColumn();
return true;
}
void DolphinColumnViewContainer::mousePressEvent(QMouseEvent* event)

View file

@ -56,7 +56,7 @@ public:
* Shows the column which represents the URL \a url. If the column
* is already shown, it gets activated, otherwise it will be created.
*/
bool showColumn(const KUrl& url);
void showColumn(const KUrl& url);
signals:
/**

View file

@ -1302,7 +1302,7 @@ void DolphinView::createView()
Q_ASSERT(view != 0);
view->installEventFilter(this);
view->viewport()->installEventFilter(this);
setFocusProxy(view);
/* TODO: enable folder expanding again later
@ -1357,6 +1357,7 @@ void DolphinView::createView()
connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(emitContentsMoved()));
setFocusProxy(m_viewAccessor.layoutTarget());
m_topLayout->insertWidget(1, m_viewAccessor.layoutTarget());
}