parts/outputviews/appoutputwidget.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
#include "appoutputwidget.h"
00016
00017
#include <qregexp.h>
00018
00019
#include <klocale.h>
00020
#include <kdebug.h>
00021
#include <kstatusbar.h>
00022
#include <kapplication.h>
00023
#include <kconfig.h>
00024
00025
#include "appoutputviewpart.h"
00026
#include "kdevpartcontroller.h"
00027
#include "kdevmainwindow.h"
00028
00029 AppOutputWidget::AppOutputWidget(
AppOutputViewPart* part)
00030 :
ProcessWidget(0, "app output widget")
00031 , m_part(part)
00032 {
00033 connect(
this, SIGNAL(executed(
QListBoxItem*)), SLOT(
slotRowSelected(
QListBoxItem*)));
00034
KConfig *config = kapp->config();
00035 config->
setGroup(
"General Options");
00036 setFont(config->
readFontEntry(
"Application Font"));
00037 }
00038
00039
00040 AppOutputWidget::~AppOutputWidget()
00041 {}
00042
00043
00044 void AppOutputWidget::childFinished(
bool normal,
int status)
00045 {
00046 ProcessWidget::childFinished(normal, status);
00047 }
00048
00049
00050 void AppOutputWidget::slotRowSelected(
QListBoxItem* row)
00051 {
00052
static QRegExp assertMatch(
"ASSERT: \\\"([^\\\"]+)\\\" in ([^\\( ]+) \\(([\\d]+)\\)");
00053
static QRegExp lineInfoMatch(
"\\[([^:]+):([\\d]+)\\]");
00054
if (row) {
00055
if (assertMatch.exactMatch(row->text())) {
00056
m_part->
partController()->
editDocument(assertMatch.cap(2), assertMatch.cap(3).toInt() - 1);
00057
m_part->
mainWindow()->
statusBar()->message(i18n(
"Assertion failed: %1").arg(assertMatch.cap(1)), 10000);
00058
m_part->
mainWindow()->
lowerView(
this);
00059
00060 }
else if (lineInfoMatch.search(row->text()) != -1) {
00061
m_part->
partController()->
editDocument(lineInfoMatch.cap(1), lineInfoMatch.cap(2).toInt() - 1);
00062
m_part->
mainWindow()->
statusBar()->message(row->text(), 10000);
00063
m_part->
mainWindow()->
lowerView(
this);
00064 }
00065 }
00066 }
00067
00068
#include "appoutputwidget.moc"
This file is part of the documentation for KDevelop Version 3.0.4.