Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update models only once on init #3530

Merged
merged 2 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/windows/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2677,6 +2677,7 @@ def __init__(self, mode=None):
self.files_model = FilesModel()
self.filesTreeView = FilesTreeView(self.files_model)
self.filesListView = FilesListView(self.files_model)
self.files_model.update_model()
self.tabFiles.layout().insertWidget(-1, self.filesTreeView)
self.tabFiles.layout().insertWidget(-1, self.filesListView)
if s.get("file_view") == "details":
Expand All @@ -2693,6 +2694,7 @@ def __init__(self, mode=None):
self.transition_model = TransitionsModel()
self.transitionsTreeView = TransitionsTreeView(self.transition_model)
self.transitionsListView = TransitionsListView(self.transition_model)
self.transition_model.update_model()
self.tabTransitions.layout().insertWidget(-1, self.transitionsTreeView)
self.tabTransitions.layout().insertWidget(-1, self.transitionsListView)
if s.get("transitions_view") == "details":
Expand All @@ -2709,6 +2711,7 @@ def __init__(self, mode=None):
self.effects_model = EffectsModel()
self.effectsTreeView = EffectsTreeView(self.effects_model)
self.effectsListView = EffectsListView(self.effects_model)
self.effects_model.update_model()
self.tabEffects.layout().insertWidget(-1, self.effectsTreeView)
self.tabEffects.layout().insertWidget(-1, self.effectsListView)
if s.get("effects_view") == "details":
Expand All @@ -2722,8 +2725,9 @@ def __init__(self, mode=None):
self.effectsView.setFocus()

# Setup emojis view
self.emoji_model = EmojisModel()
self.emojiListView = EmojisListView(self.emoji_model)
self.emojis_model = EmojisModel()
self.emojis_model.update_model()
self.emojiListView = EmojisListView(self.emojis_model)
self.tabEmojis.layout().addWidget(self.emojiListView)

# Set up status bar
Expand Down
3 changes: 0 additions & 3 deletions src/windows/views/effects_listview.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ def __init__(self, model):
self.setTextElideMode(Qt.ElideRight)
self.setStyleSheet('QListView::item { padding-top: 2px; }')

# Load initial effects model data
self.effects_model.update_model()

# setup filter events
app = get_app()
app.window.effectsFilter.textChanged.connect(self.filter_changed)
2 changes: 0 additions & 2 deletions src/windows/views/effects_treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,4 @@ def __init__(self, model):
self.setStyleSheet('QTreeView::item { padding-top: 2px; }')
self.effects_model.ModelRefreshed.connect(self.refresh_columns)

# Load initial effects model data
self.effects_model.update_model()
self.refresh_columns()
3 changes: 0 additions & 3 deletions src/windows/views/emojis_listview.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ def __init__(self, model):
s = get_settings()
default_type = s.get('emoji_group_filter') or 'smileys-emotion'

# Load initial emoji model data
self.emojis_model.update_model()

# setup filter events
self.win.emojisFilter.textChanged.connect(self.filter_changed)

Expand Down
3 changes: 0 additions & 3 deletions src/windows/views/files_listview.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ def __init__(self, model, *args):

self.files_model.ModelRefreshed.connect(self.refresh_view)

# Load initial files model data
self.files_model.update_model()

# setup filter events
app = get_app()
app.window.filesFilter.textChanged.connect(self.filter_changed)
Expand Down
3 changes: 0 additions & 3 deletions src/windows/views/files_treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,5 @@ def __init__(self, model, *args):

self.files_model.ModelRefreshed.connect(self.refresh_view)

# Load initial files model data
self.files_model.update_model()

# setup filter events
# self.files_model.model.itemChanged.connect(self.value_updated)
3 changes: 0 additions & 3 deletions src/windows/views/transitions_listview.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ def __init__(self, model):
self.setTextElideMode(Qt.ElideRight)
self.setStyleSheet('QListView::item { padding-top: 2px; }')

# Load initial transition model data
self.transition_model.update_model()

# setup filter events
app = get_app()
app.window.transitionsFilter.textChanged.connect(self.filter_changed)
Expand Down
2 changes: 0 additions & 2 deletions src/windows/views/transitions_treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,4 @@ def __init__(self, model):
self.setStyleSheet('QTreeView::item { padding-top: 2px; }')
self.transition_model.ModelRefreshed.connect(self.refresh_columns)

# Load initial transition model data
self.transition_model.update_model()
self.refresh_columns()