[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/sysadmin/inspektor/src
From: Isaac Clerencia <isaac () warp ! es>
Date: 2007-08-21 12:38:20
Message-ID: 1187699900.150949.3805.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 702887 by isaac:
Show the file name for reads instead of the fd
M +1 -0 CMakeLists.txt
M +20 -0 decoder/read.cpp
A painter/file.cpp [License: no copyright]
A painter/file.h [License: no copyright]
M +1 -0 painter/painters.h
M +2 -0 painterfactory.cpp
M +9 -7 syscalltable.cpp
--- trunk/playground/sysadmin/inspektor/src/CMakeLists.txt #702886:702887
@@ -10,6 +10,7 @@
set(painter_SRCS
painter/base.cpp
painter/text.cpp
+ painter/file.cpp
painter/filename.cpp
)
--- trunk/playground/sysadmin/inspektor/src/decoder/read.cpp #702886:702887
@@ -10,8 +10,28 @@
assert(sysCall.name() == "read");
int fd = sysCall.parameters()[0].toInt();
+ QHash<QString,QString> file;
+ file["type"] = "file";
+ file["fd"] = QString::number(fd);
if (fd != -1) {
FileOpenInfo fileInfo = FT->lookupFileInfo(sysCall.time(), fd);
kDebug() << "Reading file " << fileInfo.fileName() << endl;
+ file["name"] = fileInfo.fileName();
}
+ sysCall.parametersInfo().items.append(file);
+
+ QHash<QString,QString> buf;
+ buf["type"] = "text";
+ buf["text"] = sysCall.parameters()[1];
+ sysCall.parametersInfo().items.append(buf);
+
+ QHash<QString,QString> size;
+ size["type"] = "text";
+ size["text"] = sysCall.parameters()[2];
+ sysCall.parametersInfo().items.append(size);
+
+ QHash<QString,QString> read;
+ read["type"] = "text";
+ read["text"] = sysCall.returnValue();
+ sysCall.returnInfo().items.append(read);
}
--- trunk/playground/sysadmin/inspektor/src/painter/painters.h #702886:702887
@@ -2,5 +2,6 @@
#include "text.h"
#include "filename.h"
+#include "file.h"
#endif
--- trunk/playground/sysadmin/inspektor/src/painterfactory.cpp #702886:702887
@@ -7,6 +7,8 @@
if (!m_painters.contains(tag)) {
if (tag == "filename") {
m_painters["filename"] = new Painter::Filename();
+ } else if (tag == "file") {
+ m_painters["file"] = new Painter::File();
} else if (tag == "text") {
m_painters["text"] = new Painter::Text();
}
--- trunk/playground/sysadmin/inspektor/src/syscalltable.cpp #702886:702887
@@ -33,13 +33,15 @@
int param = ParameterLocator::instance()
->lookupParameterPosition(index, pos.x());
kDebug() << "Parameter: " << param << endl;
- PaintableItems items = index.data().value<PaintableItems>();
- QHash<QString,QString> item = items.items[param];
- QString type = item["type"];
- Painter::Base *p = PainterFactory::getPainter(type);
- if(p) {
- QString text = p->toolTip(item);
- QToolTip::showText(mapToGlobal(pos),text,this);
+ if (param != -1) {
+ PaintableItems items = index.data().value<PaintableItems>();
+ QHash<QString,QString> item = items.items[param];
+ QString type = item["type"];
+ Painter::Base *p = PainterFactory::getPainter(type);
+ if(p) {
+ QString text = p->toolTip(item);
+ QToolTip::showText(mapToGlobal(pos),text,this);
+ }
}
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic