X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ae488b13186a4cb5d0bc5d7f23b07467d6638979..ca5d3fde114dfdb280e46995e8a425d3ec558596:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index ed6d0f196..0f075a11c 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -824,6 +824,7 @@ void DolphinMainWindow::find() void DolphinMainWindow::slotSearchLocationChanged() { +#ifdef HAVE_NEPOMUK QDockWidget* searchDock = findChild("searchDock"); if (!searchDock) { return; @@ -831,10 +832,11 @@ void DolphinMainWindow::slotSearchLocationChanged() SearchPanel* searchPanel = qobject_cast(searchDock->widget()); if (searchPanel) { - searchPanel->setSearchMode(SearchSettings::location() == QLatin1String("FromHere") - ? SearchPanel::FromCurrentDir - : SearchPanel::Everywhere); + searchPanel->setSearchLocation(SearchSettings::location() == QLatin1String("FromHere") + ? SearchPanel::FromCurrentDir + : SearchPanel::Everywhere); } +#endif } void DolphinMainWindow::updatePasteAction() @@ -1346,17 +1348,20 @@ void DolphinMainWindow::slotSearchModeChanged(bool enabled) } SearchPanel* searchPanel = qobject_cast(searchDock->widget()); - if (searchPanel) { - // Per default any search-operation triggered by the Search Panel is done - // "Everywhere". - SearchPanel::SearchMode searchMode = SearchPanel::Everywhere; - - if (enabled && (SearchSettings::location() == QLatin1String("FromHere"))) { - // Only if the search-mode is enabled it is visible for the user whether - // a searching is done "Everywhere" or "From Here" (= current directory). - searchMode = SearchPanel::FromCurrentDir; + if (!searchPanel) { + return; + } + + if (enabled) { + SearchPanel::SearchLocation searchLocation = SearchPanel::Everywhere; + const KUrl url = m_activeViewContainer->url(); + const bool isSearchUrl = (url.protocol() == QLatin1String("nepomuksearch")); + if ((SearchSettings::location() == QLatin1String("FromHere") && !isSearchUrl)) { + searchLocation = SearchPanel::FromCurrentDir; } - searchPanel->setSearchMode(searchMode); + searchPanel->setSearchLocation(searchLocation); + } else { + searchPanel->setSearchLocation(SearchPanel::Everywhere); } #else Q_UNUSED(enabled); @@ -1474,6 +1479,8 @@ void DolphinMainWindow::updateToolBarMenu() connect(menu, SIGNAL(aboutToHide()), helpMenu, SLOT(deleteLater())); helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::HelpContents))); helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::WhatsThis))); + helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::ReportBug))); + helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::SwitchApplicationLanguage))); helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::AboutApp))); helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::AboutKDE))); menu->addMenu(helpMenu); @@ -1795,6 +1802,8 @@ void DolphinMainWindow::setupDockWidgets() terminalDock->setWidget(terminalPanel); connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide())); + connect(terminalDock, SIGNAL(visibilityChanged(bool)), + terminalPanel, SLOT(dockVisibilityChanged())); QAction* terminalAction = terminalDock->toggleViewAction(); terminalAction->setShortcut(Qt::Key_F4); @@ -2260,15 +2269,15 @@ void ToolBarMenu::showEvent(QShowEvent* event) // Assure that the menu is not shown outside the screen boundaries and // that it does not overlap with the parent button. const QRect screen = QApplication::desktop()->screenGeometry(QCursor::pos()); - if (pos.x() < 0) { - pos.rx() = 0; - } else if (pos.x() + width() >= screen.width()) { - pos.rx() = screen.width() - width(); + if (pos.x() < screen.x()) { + pos.rx() = screen.x(); + } else if (pos.x() + width() > screen.x() + screen.width()) { + pos.rx() = screen.x() + screen.width() - width(); } - if (pos.y() < 0) { - pos.ry() = 0; - } else if (pos.y() + height() >= screen.height()) { + if (pos.y() < screen.y()) { + pos.ry() = screen.y(); + } else if (pos.y() + height() > screen.y() + screen.height()) { pos.ry() = button->mapToGlobal(QPoint(0, 0)).y() - height(); }