summaryrefslogtreecommitdiff
path: root/core/apps
authorllornkcor <llornkcor>2005-02-06 02:25:25 (UTC)
committer llornkcor <llornkcor>2005-02-06 02:25:25 (UTC)
commitc3892e6c1a4ca15383a7da48f6d72b1d7d26f43d (patch) (side-by-side diff)
treef4d401a3479c04923e11da27ef976bd21df4d12c /core/apps
parent57d3426a26a2695be0d5358c99be3db9a90da806 (diff)
downloadopie-c3892e6c1a4ca15383a7da48f6d72b1d7d26f43d.zip
opie-c3892e6c1a4ca15383a7da48f6d72b1d7d26f43d.tar.gz
opie-c3892e6c1a4ca15383a7da48f6d72b1d7d26f43d.tar.bz2
adding shell history into command combo off by default
Diffstat (limited to 'core/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp43
1 files changed, 14 insertions, 29 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index 5cfd644..8b4202d 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -290,4 +290,3 @@ void Konsole::initCommandList()
- if (cfg.readEntry("ShellHistory","TRUE") == "TRUE")
- {
+ if (cfg.readEntry("ShellHistory","TRUE") == "FALSE") {
QString histfilename = QString(getenv("HOME")) + "/.bash_history";
@@ -297,4 +296,3 @@ void Konsole::initCommandList()
// QFile histfile(QString(getenv("HOME")) + "/.bash_history");
- if (histfile.open( IO_ReadOnly ))
- {
+ if (histfile.open( IO_ReadOnly )) {
QString line;
@@ -304,6 +302,4 @@ void Konsole::initCommandList()
int lineno = 0;
- while(!histfile.atEnd())
- {
- if (histfile.readLine(line, 200) < 0)
- {
+ while(!histfile.atEnd()) {
+ if (histfile.readLine(line, 200) < 0) {
break;
@@ -313,6 +309,4 @@ void Konsole::initCommandList()
- for(i=0; i<items.count(); i++)
- {
- if (line == items.at(i)->line)
- {
+ for(i=0; i<items.count(); i++) {
+ if (line == items.at(i)->line) {
// weight recent commands & repeated commands more
@@ -323,4 +317,3 @@ void Konsole::initCommandList()
}
- if (i >= items.count())
- {
+ if (i >= items.count()) {
items.append(new HistoryItem(lineno, line));
@@ -330,11 +323,8 @@ void Konsole::initCommandList()
int n = items.count();
- if (n > 40)
- {
+ if (n > 40) {
n = 40;
}
- for(int i=0; i<n; i++)
- {
+ for(int i=0; i<n; i++) {
// should insert start of command, but keep whole thing
- if (items.at(items.count()-i-1)->line.length() < 30)
- {
+ if (items.at(items.count()-i-1)->line.length() < 30) {
commonCombo->insertItem(items.at(items.count()-i-1)->line);
@@ -345,13 +335,8 @@ void Konsole::initCommandList()
}
- if (cfg.readEntry("Commands Set","FALSE") == "FALSE")
- {
- for (int i = 0; commonCmds[i] != NULL; i++)
- {
+ if (cfg.readEntry("Commands Set","FALSE") == "FALSE") {
+ for (int i = 0; commonCmds[i] != NULL; i++) {
commonCombo->insertItem(commonCmds[i]);
}
- }
- else
- {
- for (int i = 0; i < 100; i++)
- {
+ } else {
+ for (int i = 0; i < 100; i++) {
if (!(cfg.readEntry( QString::number(i),"")).isEmpty())