equal
deleted
inserted
replaced
22 |
22 |
23 MemSpyKernelObjectTypeModel::MemSpyKernelObjectTypeModel(EngineWrapper &engine, QObject *parent) : |
23 MemSpyKernelObjectTypeModel::MemSpyKernelObjectTypeModel(EngineWrapper &engine, QObject *parent) : |
24 QAbstractListModel(parent), |
24 QAbstractListModel(parent), |
25 mObjectTypes(engine.getKernelObjectTypes()) |
25 mObjectTypes(engine.getKernelObjectTypes()) |
26 { |
26 { |
|
27 mKernelObjectNames << "Threads" << "Processes" << "Chunks" << "Libraries" << |
|
28 "Semaphores" << "Mutexes" << "Timers" << "Servers" << "Sessions" << "Logical Devices" << |
|
29 "Physical Devices" << "Logical Channels" << "Change Notifiers" << "Undertakers" << |
|
30 "Message Queues" << "Property Refs." << "Conditional Vars."; |
27 } |
31 } |
28 |
32 |
29 MemSpyKernelObjectTypeModel::~MemSpyKernelObjectTypeModel() |
33 MemSpyKernelObjectTypeModel::~MemSpyKernelObjectTypeModel() |
30 { |
34 { |
31 qDeleteAll(mObjectTypes); |
35 qDeleteAll(mObjectTypes); |
39 |
43 |
40 QVariant MemSpyKernelObjectTypeModel::data(const QModelIndex &index, int role) const |
44 QVariant MemSpyKernelObjectTypeModel::data(const QModelIndex &index, int role) const |
41 { |
45 { |
42 if (role == Qt::DisplayRole) { |
46 if (role == Qt::DisplayRole) { |
43 QStringList lines; |
47 QStringList lines; |
44 lines << mObjectTypes.at(index.row())->name(); |
48 lines << mKernelObjectNames.at(index.row()); |
45 lines << QString("%1, %2"). |
49 lines << QString("%1, %2"). |
46 arg(tr("%n item(s)", "", mObjectTypes.at(index.row())->count())). |
50 arg(tr("%n item(s)", "", mObjectTypes.at(index.row())->count())). |
47 arg(formatSize(mObjectTypes.at(index.row())->size())); |
51 arg(formatSize(mObjectTypes.at(index.row())->size())); |
48 |
52 |
49 return lines; |
53 return lines; |
68 QString("%1M").arg(qBound<double>(1, sizeInM, 999.9), 0, 'f', 1); |
72 QString("%1M").arg(qBound<double>(1, sizeInM, 999.9), 0, 'f', 1); |
69 } |
73 } |
70 |
74 |
71 void MemSpyKernelObjectTypeView::initialize(const QVariantMap& params) |
75 void MemSpyKernelObjectTypeView::initialize(const QVariantMap& params) |
72 { |
76 { |
|
77 setTitle(tr("Kernel Objects")); |
|
78 |
73 MemSpyView::initialize(params); |
79 MemSpyView::initialize(params); |
74 |
|
75 setTitle(tr("Kernel Objects")); |
|
76 |
80 |
77 mListView.setModel(new MemSpyKernelObjectTypeModel(mEngine, this)); |
81 mListView.setModel(new MemSpyKernelObjectTypeModel(mEngine, this)); |
78 |
82 |
79 connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex))); |
83 connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex))); |
80 } |
84 } |