mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Merge branch 'release/21.12'
This commit is contained in:
commit
04e3c227cb
|
@ -2134,6 +2134,8 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
|
|||
this, &DolphinMainWindow::slotWriteStateChanged);
|
||||
connect(container, &DolphinViewContainer::searchModeEnabledChanged,
|
||||
this, &DolphinMainWindow::updateSearchAction);
|
||||
connect(container, &DolphinViewContainer::captionChanged,
|
||||
this, &DolphinMainWindow::updateWindowTitle);
|
||||
|
||||
const QAction* toggleSearchAction = actionCollection()->action(QStringLiteral("toggle_search"));
|
||||
connect(toggleSearchAction, &QAction::triggered, container, &DolphinViewContainer::setSearchModeEnabled);
|
||||
|
|
|
@ -162,10 +162,17 @@ void DolphinTabWidget::openNewTab(const QUrl& primaryUrl, const QUrl& secondaryU
|
|||
this, &DolphinTabWidget::activeViewChanged);
|
||||
connect(tabPage, &DolphinTabPage::activeViewUrlChanged,
|
||||
this, &DolphinTabWidget::tabUrlChanged);
|
||||
connect(tabPage->activeViewContainer(), &DolphinViewContainer::captionChanged, this, [this, tabPage]() {
|
||||
const int tabIndex = indexOf(tabPage);
|
||||
Q_ASSERT(tabIndex >= 0);
|
||||
tabBar()->setTabText(tabIndex, tabName(tabPage));
|
||||
});
|
||||
|
||||
int newTabIndex = -1;
|
||||
if (!GeneralSettings::openNewTabAfterLastTab()) {
|
||||
newTabIndex = currentIndex() + 1;
|
||||
}
|
||||
|
||||
insertTab(newTabIndex, tabPage, QIcon() /* loaded in tabInserted */, tabName(tabPage));
|
||||
|
||||
if (focusWidget) {
|
||||
|
|
|
@ -196,6 +196,17 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
|
|||
}
|
||||
});
|
||||
|
||||
KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel();
|
||||
connect(placesModel, &KFilePlacesModel::dataChanged,
|
||||
this, &DolphinViewContainer::slotPlacesModelChanged);
|
||||
connect(placesModel, &KFilePlacesModel::rowsInserted,
|
||||
this, &DolphinViewContainer::slotPlacesModelChanged);
|
||||
connect(placesModel, &KFilePlacesModel::rowsRemoved,
|
||||
this, &DolphinViewContainer::slotPlacesModelChanged);
|
||||
|
||||
connect(this, &DolphinViewContainer::searchModeEnabledChanged,
|
||||
this, &DolphinViewContainer::captionChanged);
|
||||
|
||||
// Initialize kactivities resource instance
|
||||
|
||||
#ifdef HAVE_KACTIVITIES
|
||||
|
@ -791,6 +802,13 @@ void DolphinViewContainer::showErrorMessage(const QString& msg)
|
|||
showMessage(msg, Error);
|
||||
}
|
||||
|
||||
void DolphinViewContainer::slotPlacesModelChanged()
|
||||
{
|
||||
if (!GeneralSettings::showFullPathInTitlebar() && !isSearchModeEnabled()) {
|
||||
Q_EMIT captionChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool DolphinViewContainer::isSearchUrl(const QUrl& url) const
|
||||
{
|
||||
return url.scheme().contains(QLatin1String("search"));
|
||||
|
|
|
@ -223,6 +223,12 @@ Q_SIGNALS:
|
|||
*/
|
||||
void writeStateChanged(bool isFolderWritable);
|
||||
|
||||
/**
|
||||
* Is emitted when the Caption has been changed.
|
||||
* @see DolphinViewContainer::caption()
|
||||
*/
|
||||
void captionChanged();
|
||||
|
||||
private Q_SLOTS:
|
||||
/**
|
||||
* Updates the number of items (= number of files + number of
|
||||
|
@ -349,6 +355,12 @@ private Q_SLOTS:
|
|||
*/
|
||||
void showErrorMessage(const QString& msg);
|
||||
|
||||
/**
|
||||
* Is invoked when a KFilePlacesModel has been changed
|
||||
* @see DolphinPlacesModelSingleton::instance().placesModel()
|
||||
*/
|
||||
void slotPlacesModelChanged();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @return True if the URL protocol is a search URL (e. g. baloosearch:// or filenamesearch://).
|
||||
|
|
|
@ -124,6 +124,7 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent) :
|
|||
topLayout->addWidget(m_progressTextLabel);
|
||||
topLayout->addWidget(m_progressBar);
|
||||
|
||||
setVisible(GeneralSettings::showStatusBar());
|
||||
setExtensionsVisible(true);
|
||||
setWhatsThis(xi18nc("@info:whatsthis Statusbar", "<para>This is "
|
||||
"the <emphasis>Statusbar</emphasis>. It contains three elements "
|
||||
|
@ -245,6 +246,7 @@ int DolphinStatusBar::zoomLevel() const
|
|||
|
||||
void DolphinStatusBar::readSettings()
|
||||
{
|
||||
setVisible(GeneralSettings::showStatusBar());
|
||||
setExtensionsVisible(true);
|
||||
}
|
||||
|
||||
|
@ -321,15 +323,13 @@ void DolphinStatusBar::updateZoomSliderToolTip(int zoomLevel)
|
|||
|
||||
void DolphinStatusBar::setExtensionsVisible(bool visible)
|
||||
{
|
||||
bool showStatusBar = visible;
|
||||
bool showSpaceInfo = visible;
|
||||
bool showZoomSlider = visible;
|
||||
if (visible) {
|
||||
showStatusBar = GeneralSettings::showStatusBar();
|
||||
showSpaceInfo = GeneralSettings::showSpaceInfo();
|
||||
showZoomSlider = GeneralSettings::showZoomSlider();
|
||||
}
|
||||
setVisible(showStatusBar);
|
||||
|
||||
m_spaceInfo->setShown(showSpaceInfo);
|
||||
m_spaceInfo->setVisible(showSpaceInfo);
|
||||
m_zoomSlider->setVisible(showZoomSlider);
|
||||
|
|
Loading…
Reference in a new issue