Commit df3f50f1 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

popupmenu: Cleanup some dead code and some minor refactoring

parent f3385778
...@@ -192,14 +192,12 @@ void KonqPopupMenuPrivate::populate() ...@@ -192,14 +192,12 @@ void KonqPopupMenuPrivate::populate()
//check if url is current directory //check if url is current directory
if (lstItems.count() == 1) { if (lstItems.count() == 1) {
KFileItem firstPopupItem(lstItems.first()); const KFileItem firstPopupItem = lstItems.constFirst();
if (firstPopupItem.isLink()) { if (firstPopupItem.isLink()) {
isSymLink = true; isSymLink = true;
isSymLinkInSameDir = !firstPopupItem.linkDest().contains(QLatin1Char('/')); isSymLinkInSameDir = !firstPopupItem.linkDest().contains(QLatin1Char('/'));
} }
QUrl firstPopupURL(firstPopupItem.url().adjusted(QUrl::NormalizePathSegments)); const QUrl firstPopupURL(firstPopupItem.url().adjusted(QUrl::NormalizePathSegments));
//qCDebug(LIBKONQ_LOG) << "View path is " << url.url();
//qCDebug(LIBKONQ_LOG) << "First popup path is " << firstPopupURL.url();
currentDir = (firstPopupURL.matches(url, QUrl::StripTrailingSlash)); currentDir = (firstPopupURL.matches(url, QUrl::StripTrailingSlash));
if (firstPopupItem.isDesktopFile()) { if (firstPopupItem.isDesktopFile()) {
KDesktopFile desktopFile(firstPopupItem.localPath()); KDesktopFile desktopFile(firstPopupItem.localPath());
...@@ -218,26 +216,13 @@ void KonqPopupMenuPrivate::populate() ...@@ -218,26 +216,13 @@ void KonqPopupMenuPrivate::populate()
} }
const bool isIntoTrash = (url.scheme() == QLatin1String("trash")) && !isCurrentTrash; // trashed file, not trash:/ itself const bool isIntoTrash = (url.scheme() == QLatin1String("trash")) && !isCurrentTrash; // trashed file, not trash:/ itself
const bool bIsLink = (m_popupFlags & KonqPopupMenu::IsLink); const bool bIsLink = (m_popupFlags & KonqPopupMenu::IsLink);
//qCDebug(LIBKONQ_LOG) << "isLocal=" << isLocal << " url=" << url << " isCurrentTrash=" << isCurrentTrash << " isIntoTrash=" << isIntoTrash << " bTrashIncluded=" << bTrashIncluded;
//////////////////////////////////////////////////////////////////////////
addGroup(KonqPopupMenu::TopActions); // used e.g. for ShowMenuBar. includes a separator at the end addGroup(KonqPopupMenu::TopActions); // used e.g. for ShowMenuBar. includes a separator at the end
QAction *act; QAction *act;
QAction *actNewWindow = nullptr; QAction *actNewWindow = nullptr;
#if 0 // TODO in the desktop code itself.
if ((flags & KonqPopupMenu::ShowProperties) && isOnDesktop &&
!KAuthorized::authorizeAction("editable_desktop_icons")) {
flags &= ~KonqPopupMenu::ShowProperties; // remove flag
}
#endif
// Either 'newview' is in the actions we're given (probably in the tabhandling group) // Either 'newview' is in the actions we're given (probably in the tabhandling group)
// or we need to insert it ourselves (e.g. for the desktop). // or we need to insert it ourselves (e.g. for the desktop).
// In the first case, actNewWindow must remain 0. // In the first case, actNewWindow must remain 0.
...@@ -458,7 +443,6 @@ void KonqPopupMenuPrivate::populate() ...@@ -458,7 +443,6 @@ void KonqPopupMenuPrivate::populate()
KonqPopupMenu::~KonqPopupMenu() KonqPopupMenu::~KonqPopupMenu()
{ {
delete d; delete d;
//qCDebug(LIBKONQ_LOG) << "~KonqPopupMenu leave";
} }
void KonqPopupMenu::setNewFileMenu(KNewFileMenu *newMenu) void KonqPopupMenu::setNewFileMenu(KNewFileMenu *newMenu)
......
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