-
Notifications
You must be signed in to change notification settings - Fork 136
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
Saving projects doesn't add .vcp extension, loading project doesn't work without .vcp extension #375
Comments
For the loading part, it seems like it uses the file extension to distinguish between file types (
One quick workaround would be to assume that an extension-less file is a diff --git a/vidcutter/videocutter.py b/vidcutter/videocutter.py
index 98e5553..7082f7c 100644
--- a/vidcutter/videocutter.py
+++ b/vidcutter/videocutter.py
@@ -832,7 +832,7 @@ class VideoCutter(QWidget):
self.lastFolder = QFileInfo(project_file).absolutePath()
file = QFile(project_file)
info = QFileInfo(file)
- project_type = info.suffix()
+ project_type = info.suffix() or 'vcp'
if not file.open(QFile.ReadOnly | QFile.Text):
QMessageBox.critical(self.parent, 'Open project file',
'Cannot read project file {0}:\n\n{1}'.format(project_file, file.errorString())) However, this wouldn't work if the file name contains a "." (as then Possibly better: diff --git a/vidcutter/videocutter.py b/vidcutter/videocutter.py
index 98e5553..237f927 100644
--- a/vidcutter/videocutter.py
+++ b/vidcutter/videocutter.py
@@ -833,6 +833,9 @@ class VideoCutter(QWidget):
file = QFile(project_file)
info = QFileInfo(file)
project_type = info.suffix()
+ if project_type not in self.project_files:
+ # Assume .vcp file if the file extension is missing or invalid
+ project_type = 'vcp'
if not file.open(QFile.ReadOnly | QFile.Text):
QMessageBox.critical(self.parent, 'Open project file',
'Cannot read project file {0}:\n\n{1}'.format(project_file, file.errorString())) |
For the saving part, seems like it should work with the filter alone, but it doesn't work for me (Flatpak/Linux). A naive solution (which most likely has sandboxing restrictions) would be to just append the extension if it's missing: diff --git a/vidcutter/videocutter.py b/vidcutter/videocutter.py
index 98e5553..46b13ba 100644
--- a/vidcutter/videocutter.py
+++ b/vidcutter/videocutter.py
@@ -934,6 +937,9 @@ class VideoCutter(QWidget):
filter=self.projectFilters(True),
initialFilter='VidCutter Project (*.vcp)',
options=self.getFileDialogOptions())
+ if ptype == 'VidCutter Project (*.vcp)' and not project_save.endswith('.vcp'):
+ # Add extension, will probably not work with sandboxing
+ project_save += '.vcp'
if project_save is not None and len(project_save.strip()):
file = QFile(project_save)
if not file.open(QFile.WriteOnly | QFile.Text): According to this SO thread you might need to use |
When saving projects, the ".vcp" extension isn't added automatically.
When loading projects, selecting a file without a ".vcp" extension does nothing.
Steps to reproduce:
Expected result:
Actual result:
VidCutter version: 6.0.5.1 Flatpak
The text was updated successfully, but these errors were encountered: