Forward port: The history options (line #/enabled) are now used in

the profiles.  Currently Konsole crashes with --profile=.  The dialogs
don't work know anyway... test later.

CCBUG: 120046 

svn path=/trunk/KDE/kdebase/konsole/; revision=498170
This commit is contained in:
Kurt Hindenburg
2006-01-14 20:53:57 +00:00
parent 48c95035db
commit e0801bb5d5
3 changed files with 33 additions and 1 deletions

View File

@@ -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() );

View File

@@ -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);

View File

@@ -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<QColor>() );
// -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<QColor>() );
/* 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") );