Skip to content

Commit

Permalink
fixed remote model refresh for Google drive - #82
Browse files Browse the repository at this point in the history
  • Loading branch information
kapitainsky committed Mar 10, 2020
1 parent 1c2a433 commit 5afd8f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/remote_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,9 +1024,18 @@ RemoteWidget::RemoteWidget(IconCache *iconCache, const QString &remote,

QModelIndex index = ui.tree->selectionModel()->selectedRows().front();
QModelIndex top = index;

// get top parent
while (!model->isTopLevel(top)) {
top = top.parent();
}

int i = 0;
// clear top folder's rows
while (model->removeRow(0, top)) {
++i;
}

ui.tree->selectionModel()->clear();
ui.tree->selectionModel()->select(top, QItemSelectionModel::Select |
QItemSelectionModel::Rows);
Expand Down

0 comments on commit 5afd8f1

Please sign in to comment.