diff --git a/.vscode/settings.json b/.vscode/settings.json index c745c20b..7aadee2f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,79 @@ { - "cmake.sourceDirectory": "${workspaceFolder}" + "cmake.sourceDirectory": "${workspaceFolder}", + "files.associations": { + "typeinfo": "cpp", + "__bit_reference": "cpp", + "__config": "cpp", + "__debug": "cpp", + "__errc": "cpp", + "__functional_base": "cpp", + "__hash_table": "cpp", + "__locale": "cpp", + "__mutex_base": "cpp", + "__node_handle": "cpp", + "__nullptr": "cpp", + "__split_buffer": "cpp", + "__string": "cpp", + "__threading_support": "cpp", + "__tree": "cpp", + "__tuple": "cpp", + "algorithm": "cpp", + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "chrono": "cpp", + "cmath": "cpp", + "compare": "cpp", + "complex": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "exception": "cpp", + "functional": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "ios": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "iterator": "cpp", + "limits": "cpp", + "list": "cpp", + "locale": "cpp", + "map": "cpp", + "memory": "cpp", + "mutex": "cpp", + "new": "cpp", + "numeric": "cpp", + "optional": "cpp", + "ostream": "cpp", + "queue": "cpp", + "random": "cpp", + "ratio": "cpp", + "set": "cpp", + "sstream": "cpp", + "stack": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "utility": "cpp", + "variant": "cpp", + "vector": "cpp" + } } \ No newline at end of file diff --git a/src/widgets/HexWidget.cpp b/src/widgets/HexWidget.cpp index 1ac1061b..f1dce2c5 100644 --- a/src/widgets/HexWidget.cpp +++ b/src/widgets/HexWidget.cpp @@ -136,7 +136,6 @@ HexWidget::HexWidget(QWidget *parent) &HexWidget::onActionDeleteCommentTriggered); addAction(actionDeleteComment); - // Flag Option - Rohan // Add flag option actionFlag = new QAction(tr("Add Flag"), this); actionFlag->setShortcutContext(Qt::ShortcutContext::WidgetWithChildrenShortcut); @@ -1180,12 +1179,14 @@ void HexWidget::contextMenuEvent(QContextMenuEvent *event) } QString flag = Core()->flagAt(cursor.address); + RzFlagItem *flagItem = rz_flag_get_i(Core()->core()->flags, cursor.address); - if (flag.isNull() || flag.isEmpty()) { + if (flagItem == 0x0 || flag.isNull() || flag.isEmpty()) { actionDeleteFlag->setVisible(false); actionFlag->setText(tr("Add Flag")); } else { actionDeleteFlag->setVisible(true); + actionFlag->setText(tr("Edit Flag")); } if (!ioModesController.canWrite()) { @@ -1261,6 +1262,7 @@ void HexWidget::onActionAddCommentTriggered() CommentsDialog::addOrEditComment(addr, this); } +// slog for add flag action void HexWidget::onActionAddFlagTriggered() { uint64_t addr = cursor.address;