X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/38c34eeca315c7be58e65d4d3fb72aaf7b866719..64f38f89a63c7afe5fbd5181f9de65c4b3be48b7:/src/dolphintabpage.h diff --git a/src/dolphintabpage.h b/src/dolphintabpage.h index 1c8ae094b..1e79fb5db 100644 --- a/src/dolphintabpage.h +++ b/src/dolphintabpage.h @@ -1,6 +1,6 @@ /* * SPDX-FileCopyrightText: 2014 Emmanuel Pescosta - * SPDX-FileCopyrightText: 2020 Felix Ernst + * SPDX-FileCopyrightText: 2020 Felix Ernst * * SPDX-License-Identifier: GPL-2.0-or-later */ @@ -66,6 +66,12 @@ public: */ DolphinViewContainer *activeViewContainer() const; + /** + * @return DolphinViewContainer of the inactive view + * if split view is enabled, or nullptr otherwise. + */ + DolphinViewContainer *inactiveViewContainer() const; + /** * Returns the selected items. The list is empty if no item has been * selected. @@ -132,6 +138,20 @@ public: */ void setActive(bool active); + void switchActiveView(); + + /** + * Overwrites the automatically generated label of this tab with @p label. + * This @p label will be kept until it is overwritten by calling this method again. + * Calling this with an empty string will restore the automatic labelling. + */ + void setCustomLabel(const QString &label); + + /** + * @see setCustomLabel. + */ + QString customLabel() const; + Q_SIGNALS: void activeViewChanged(DolphinViewContainer *viewContainer); void activeViewUrlChanged(const QUrl &url); @@ -164,8 +184,6 @@ private Q_SLOTS: */ void slotViewUrlRedirection(const QUrl &oldUrl, const QUrl &newUrl); - void switchActiveView(); - private: /** * Creates a new view container and does the default initialization. @@ -195,6 +213,8 @@ private: bool m_primaryViewActive; bool m_splitViewEnabled; bool m_active; + /** @see setCustomLabel(). */ + QString m_customLabel; }; class DolphinTabPageSplitterHandle : public QSplitterHandle