Commit 21dde44d authored by Aurélien Gâteau's avatar Aurélien Gâteau
Browse files

Always show context menu.

svn path=/trunk/KDE/kdegraphics/gwenview/; revision=956910
parent 4cfa4798
......@@ -226,12 +226,12 @@ void StartPage::showEvent(QShowEvent* event) {
void StartPage::showRecentFoldersViewContextMenu(const QPoint& pos) {
QAbstractItemView* view = qobject_cast<QAbstractItemView*>(sender());
KUrl url;
QModelIndex index = view->indexAt(pos);
if (!index.isValid()) {
return;
if (index.isValid()) {
QVariant data = index.data(KFilePlacesModel::UrlRole);
url = data.toUrl();
}
QVariant data = index.data(KFilePlacesModel::UrlRole);
KUrl url = data.toUrl();
// Create menu
QMenu menu(this);
......@@ -241,6 +241,13 @@ void StartPage::showRecentFoldersViewContextMenu(const QPoint& pos) {
menu.addSeparator();
QAction* clearAction = menu.addAction(KIcon("edit-delete-all"), i18n("Forget All"));
if (!index.isValid()) {
if (addToPlacesAction) {
addToPlacesAction->setEnabled(false);
}
removeAction->setEnabled(false);
}
// Handle menu
QAction* action = menu.exec(view->mapToGlobal(pos));
if (!action) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment