diff --git a/konsole/konsole.cpp b/konsole/konsole.cpp index 806165174..71adeafce 100644 --- a/konsole/konsole.cpp +++ b/konsole/konsole.cpp @@ -1467,8 +1467,14 @@ void Konsole::saveProperties(KConfig* config) { config->writeEntry(key, sessions.current()->isMonitorSilence()); key = QString("MasterMode%1").arg(counter); config->writeEntry(key, sessions.current()->isMasterMode()); - key = QString("TabColor%1").arg(counter); + //key = QString("TabColor%1").arg(counter); //config->writeEntry(key, tabwidget->tabColor((sessions.current())->widget())); +/* Test this when dialogs work again + key = QString("History%1").arg(counter); + config->writeEntry(key, sessions.current()->history().getSize()); + key = QString("HistoryEnabled%1").arg(counter); + config->writeEntry(key, sessions.current()->history().isOn()); +*/ QString cwd=sessions.current()->getCwd(); if (cwd.isEmpty()) @@ -3127,6 +3133,19 @@ void Konsole::initTabColor(QColor color) ; //tabwidget->setTabColor( se->widget(), color ); } +void Konsole::initHistory(int lines, bool enable) +{ +return; + // If no History#= is given in the profile, use the history + // parameter saved in konsolerc. + if ( lines < 0 ) lines = m_histSize; + + if ( enable ) + se->setHistory( HistoryTypeBuffer( lines ) ); + else + se->setHistory( HistoryTypeNone() ); +} + void Konsole::slotToggleMasterMode() { setMasterMode( masterMode->isChecked() ); diff --git a/konsole/konsole.h b/konsole/konsole.h index 9c18d1f41..b1bbbd479 100644 --- a/konsole/konsole.h +++ b/konsole/konsole.h @@ -87,6 +87,7 @@ public: void initMonitorSilence(bool on); void initMasterMode(bool on); void initTabColor(QColor color); + void initHistory(int lines, bool enable); void newSession(const QString &program, const QStringList &args, const QString &term, const QString &icon, const QString &title, const QString &cwd); void setSchema(const QString & path); void setEncoding(int); diff --git a/konsole/main.cpp b/konsole/main.cpp index a0b3fcc41..6447e80d6 100644 --- a/konsole/main.cpp +++ b/konsole/main.cpp @@ -519,6 +519,9 @@ extern "C" int KDE_EXPORT kdemain(int argc, char* argv[]) //FIXME: Verify this code when KDE4 supports tab colors... kvh QVariant v_tabColor = sessionconfig->readEntry("TabColor0"); m->initTabColor( v_tabColor.value() ); + // -1 will be changed to the default history in konsolerc +// m->initHistory(sessionconfig->readNumEntry("History0", -1), +// sessionconfig->readBoolEntry("HistoryEnabled0", true)); counter++; @@ -566,6 +569,15 @@ extern "C" int KDE_EXPORT kdemain(int argc, char* argv[]) //FIXME: Verify this code when KDE4 supports tab colors... kvh // QVariant v_tabColor = sessionconfig->readEntry(key)); // m->initTabColor( v_tabColor.value() ); + +/* Test this when the dialogs work again...kvh + // -1 will be changed to the default history in konsolerc + key = QString("History%1").arg(counter); + QString key2 = QString("HistoryEnabled%1").arg(counter); + m->initHistory(sessionconfig->readNumEntry(key, -1), + sessionconfig->readBoolEntry(key2, true)); +*/ + counter++; } m->setDefaultSession( sessionconfig->readEntry("DefaultSession","shell.desktop") );