mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Allow returning to top level in sdb widget. (#1696)
This commit is contained in:
parent
5dc5fe1cee
commit
64d0d6b00d
@ -17,14 +17,12 @@ SdbWidget::SdbWidget(MainWindow *main, QAction *action) :
|
|||||||
path.clear();
|
path.clear();
|
||||||
|
|
||||||
connect(Core(), SIGNAL(refreshAll()), this, SLOT(reload()));
|
connect(Core(), SIGNAL(refreshAll()), this, SLOT(reload()));
|
||||||
reload(nullptr);
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SdbWidget::reload(QString _path)
|
void SdbWidget::reload(QString _path)
|
||||||
{
|
{
|
||||||
if (!_path.isNull()) {
|
path = _path;
|
||||||
path = _path;
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->lineEdit->setText(path);
|
ui->lineEdit->setText(path);
|
||||||
/* insert root sdb keyvalue pairs */
|
/* insert root sdb keyvalue pairs */
|
||||||
@ -44,7 +42,9 @@ void SdbWidget::reload(QString _path)
|
|||||||
qhelpers::adjustColumns(ui->treeWidget, 0);
|
qhelpers::adjustColumns(ui->treeWidget, 0);
|
||||||
/* namespaces */
|
/* namespaces */
|
||||||
keys = Core()->sdbList(path);
|
keys = Core()->sdbList(path);
|
||||||
keys.append("..");
|
if (!path.isEmpty()) {
|
||||||
|
keys.append("..");
|
||||||
|
}
|
||||||
for (const QString &key : keys) {
|
for (const QString &key : keys) {
|
||||||
QTreeWidgetItem *tempItem = new QTreeWidgetItem();
|
QTreeWidgetItem *tempItem = new QTreeWidgetItem();
|
||||||
tempItem->setText(0, key + "/");
|
tempItem->setText(0, key + "/");
|
||||||
|
@ -25,7 +25,7 @@ private slots:
|
|||||||
void on_lockButton_clicked();
|
void on_lockButton_clicked();
|
||||||
void on_treeWidget_itemChanged(QTreeWidgetItem *item, int column);
|
void on_treeWidget_itemChanged(QTreeWidgetItem *item, int column);
|
||||||
|
|
||||||
void reload(QString _path = nullptr);
|
void reload(QString _path = QString());
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::SdbWidget> ui;
|
std::unique_ptr<Ui::SdbWidget> ui;
|
||||||
|
Loading…
Reference in New Issue
Block a user