X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8d189f44c4d1bf3bea71da43fef59cb772a348bc..817f3952e2bed820ea3b50dfdfe91ccb99dcb748:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e14cb1c2d..75d0a059f 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -278,6 +278,8 @@ void DolphinMainWindow::openNewTab(const KUrl& url) viewTab.primaryView->view()->reload(); m_viewTab.append(viewTab); + + actionCollection()->action("close_tab")->setEnabled(true); } void DolphinMainWindow::toggleActiveView() @@ -637,7 +639,6 @@ void DolphinMainWindow::quickView() QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.plasma", "/Previewer", "", "openFile"); foreach (const KUrl& url, urls) { - QList args; msg.setArguments(QList() << url.prettyUrl()); QDBusConnection::sessionBus().send(msg); } @@ -701,7 +702,7 @@ void DolphinMainWindow::closeTab(int index) if (index == m_tabIndex) { // The tab that should be closed is the active tab. Activate the // previous tab before closing the tab. - setActiveTab((index > 0) ? index - 1 : 1); + m_tabBar->setCurrentIndex((index > 0) ? index - 1 : 1); } // delete tab @@ -724,6 +725,7 @@ void DolphinMainWindow::closeTab(int index) // closing the last tab is not possible if (m_viewTab.count() == 1) { m_tabBar->removeTab(0); + actionCollection()->action("close_tab")->setEnabled(false); } else { m_tabBar->blockSignals(false); } @@ -772,6 +774,11 @@ void DolphinMainWindow::handlePlacesClick(const KUrl& url, Qt::MouseButtons butt } } +void DolphinMainWindow::slotTestCanDecode(const QDragMoveEvent* event, bool& canDecode) +{ + canDecode = KUrl::List::canDecode(event->mimeData()); +} + void DolphinMainWindow::init() { DolphinSettings& settings = DolphinSettings::instance(); @@ -816,6 +823,8 @@ void DolphinMainWindow::init() this, SLOT(openTabContextMenu(int, const QPoint&))); connect(m_tabBar, SIGNAL(newTabRequest()), this, SLOT(openNewTab())); + connect(m_tabBar, SIGNAL(testCanDecode(const QDragMoveEvent*, bool&)), + this, SLOT(slotTestCanDecode(const QDragMoveEvent*, bool&))); m_tabBar->blockSignals(true); // signals get unblocked after at least 2 tabs are open QWidget* centralWidget = new QWidget(this); @@ -846,6 +855,9 @@ void DolphinMainWindow::init() } updateViewActions(); + QAction* showFilterBarAction = actionCollection()->action("show_filter_bar"); + showFilterBarAction->setChecked(generalSettings->filterBar()); + if (firstRun) { // assure a proper default size if Dolphin runs the first time resize(750, 500); @@ -913,6 +925,7 @@ void DolphinMainWindow::setupActions() QAction* closeTab = new QAction(KIcon("tab-close"), i18nc("@action:inmenu File", "Close Tab"), this); closeTab->setShortcut(Qt::CTRL | Qt::Key_W); + closeTab->setEnabled(false); connect(closeTab, SIGNAL(triggered()), this, SLOT(closeTab())); actionCollection()->addAction("close_tab", closeTab);