Skip to content

Commit

Permalink
iiodebugger: Fix path title button
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei-Fabian-Pop <[email protected]>
  • Loading branch information
Andrei-Fabian-Pop authored and adisuciu committed Sep 19, 2024
1 parent 4c5f094 commit 31fd3f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/debugger/src/iioexplorer/iioexplorerinstrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void IIOExplorerInstrument::connectSignalsAndSlots()
return;
}
IIOStandardItem *item = findItemByPath(iioRoot, pathList);
if(item) {
if(!item) {
qWarning(CAT_IIODEBUGGER) << "Could not find the item with path:" << item->path();
}

Expand Down
10 changes: 7 additions & 3 deletions plugins/debugger/src/iioexplorer/pathtitle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ void PathTitle::setTitle(QString title)
QStringList segmentStrings = title.split(SPLIT_CHAR, Qt::SkipEmptyParts);
QString auxPath;

for(QString segment : segmentStrings) {
QPushButton *btn = new QPushButton(segment, this);
for(int i = 0; i < segmentStrings.size(); ++i) {
QPushButton *btn = new QPushButton(segmentStrings[i], this);
StyleHelper::GrayButton(btn, "SegmentButton");
auxPath.append(segment);
auxPath.append(segmentStrings[i]);
connect(btn, &QPushButton::clicked, this, [this, auxPath]() { Q_EMIT pathSelected(auxPath); });
layout()->addWidget(btn);

if(i < segmentStrings.size() - 1) {
auxPath.append("/");
}
}
}

Expand Down

0 comments on commit 31fd3f4

Please sign in to comment.