Verified Commit fff36538 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳
Browse files

bring back tabsReadOnly

parent 1c45a41d
...@@ -32,8 +32,11 @@ TabsModel::TabsModel(QObject *parent) : QAbstractListModel(parent) { ...@@ -32,8 +32,11 @@ TabsModel::TabsModel(QObject *parent) : QAbstractListModel(parent) {
qDebug() << "Current tab changed to" << m_currentTab; qDebug() << "Current tab changed to" << m_currentTab;
}); });
// The fallback tab must not be saved, it would overwrite our actual data.
m_tabsReadOnly = true;
// Make sure model always contains at least one tab // Make sure model always contains at least one tab
createEmptyTab(); createEmptyTab();
m_tabsReadOnly = false;
} }
QHash<int, QByteArray> TabsModel::roleNames() const QHash<int, QByteArray> TabsModel::roleNames() const
...@@ -196,7 +199,7 @@ bool TabsModel::loadTabs() ...@@ -196,7 +199,7 @@ bool TabsModel::loadTabs()
bool TabsModel::saveTabs() const bool TabsModel::saveTabs() const
{ {
// only save if not in private mode // only save if not in private mode
if (!m_privateMode) { if (!m_privateMode && !m_tabsReadOnly) {
QString outputDir = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) QString outputDir = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)
+ QStringLiteral("/angelfish/"); + QStringLiteral("/angelfish/");
......
...@@ -88,6 +88,7 @@ private: ...@@ -88,6 +88,7 @@ private:
int m_currentTab = 0; int m_currentTab = 0;
QVector<TabState> m_tabs {}; QVector<TabState> m_tabs {};
bool m_privateMode = false; bool m_privateMode = false;
bool m_tabsReadOnly = false;
signals: signals:
void currentTabChanged(); void currentTabChanged();
......
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