[pitivi] medialibrary: fix import after choosing file from Recents
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] medialibrary: fix import after choosing file from Recents
- Date: Sun, 16 Jul 2017 19:55:32 +0000 (UTC)
commit b23c67923487a13fba3c8a8b6c395b487b6e13af
Author: Rodolfo Ribeiro Gomes <rodolforg gmail com>
Date: Sun Jul 16 15:16:34 2017 -0300
medialibrary: fix import after choosing file from Recents
If someone import a media using special panel 'Recents' (files) from file chooser dialog, it cannot
import again due to exception raised by None value stored in last-import-folder
Differential Revision: https://phabricator.freedesktop.org/D1783
pitivi/medialibrary.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index b2983b9..51f9d46 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -971,6 +971,9 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
self.debug("response: %r", response)
if response == Gtk.ResponseType.OK:
lastfolder = dialogbox.get_current_folder()
+ # get_current_folder() is None if file was chosen from 'Recents'
+ if not lastfolder:
+ lastfolder = GLib.path_get_dirname(dialogbox.get_filename())
self.app.settings.lastImportFolder = lastfolder
dialogbox.props.extra_widget.saveValues()
filenames = dialogbox.get_uris()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]