void GDBOutputWidget::newStdoutLine(const QString& line,
                                    bool internal)
{
    QString s = line.toHtmlEscaped();
    if (s.startsWith("(gdb)"))
    {
        s = colorify(s, gdbColor_);
    }
    else
        s.replace('\n', "<br>");

    allCommands_.append(s);
    allCommandsRaw_.append(line);
    trimList(allCommands_, maxLines_);
    trimList(allCommandsRaw_, maxLines_);

    if (!internal)
    {
        userCommands_.append(s);
        userCommandsRaw_.append(line);
        trimList(userCommands_, maxLines_);
        trimList(userCommandsRaw_, maxLines_);
    }

    if (!internal || showInternalCommands_)
        showLine(s);
}
Exemple #2
0
void GDBOutputWidget::newStdoutLine(const QString& line,
                                    bool internal)
{
    QString s = html_escape(line);
    if (s.startsWith("(gdb)"))
    {
        s = colorify(s, "blue");
    }

    allCommands_.append(s);
    allCommandsRaw_.append(line);
    trimList(allCommands_, maxLines_);
    trimList(allCommandsRaw_, maxLines_);

    if (!internal)
    {
        userCommands_.append(s);
        userCommandsRaw_.append(line);
        trimList(userCommands_, maxLines_);
        trimList(userCommandsRaw_, maxLines_);
    }

    if (!internal || showInternalCommands_)
        showLine(s);
}
void GDBOutputWidget::slotReceivedStderr(const char* line)
{
    QString colored = colorify(QString::fromLatin1(line).toHtmlEscaped(), errorColor_);
    // Errors are shown inside user commands too.
    allCommands_.append(colored);
    trimList(allCommands_, maxLines_);
    userCommands_.append(colored);
    trimList(userCommands_, maxLines_);

    allCommandsRaw_.append(line);
    trimList(allCommandsRaw_, maxLines_);
    userCommandsRaw_.append(line);
    trimList(userCommandsRaw_, maxLines_);

    showLine(colored);
}
Exemple #4
0
void GDBOutputWidget::slotReceivedStderr(const char* line)
{
    QString colored = colorify(html_escape(line), "red");
    // Errors are shown inside user commands too.
    allCommands_.append(colored);
    trimList(allCommands_, maxLines_);
    userCommands_.append(colored);
    trimList(userCommands_, maxLines_);

    allCommandsRaw_.append(line);
    trimList(allCommandsRaw_, maxLines_);
    userCommandsRaw_.append(line);
    trimList(userCommandsRaw_, maxLines_);

    showLine(colored);
}
Exemple #5
0
void buildHistoryList()
{
	HISTORY = linkedList();
	FILE * fin = fopen(".mysh_history", "r");
	if(fin != NULL)
	{
		
		int t = totalLinesInFile(fin);
		buildList(HISTORY, t, fin, buildHistory);
		fclose(fin);
	}

	trimList();
}
Exemple #6
0
void addToHistory(char * s)
{
	History * h = (History *)calloc(1, sizeof(History));

	int l = strlen(s);
	(*h).line = (char*)calloc(l + 1, sizeof(char));
	strncpy((*h).line, s, l);

	Node * nn = buildNode_Type(h);

	trimList();

	addLast(HISTORY, nn);
}