Skip to content

Commit

Permalink
Deleting unnecessary function and joining the export_folder to in the…
Browse files Browse the repository at this point in the history
… suggestion function
  • Loading branch information
SeqLaz committed Nov 7, 2024
1 parent f163587 commit f5328f3
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions qfieldsync/gui/package_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,28 +136,20 @@ def setup_gui(self):
else:
self.show_package_page()

def get_export_folder(self) -> str:
"""Get the export folder according to the inputs in the selected"""
def get_export_filename_suggestion(self) -> str:
"""Get the suggested export filename"""
export_dirname = self.qfield_preferences.value("exportDirectoryProject")
if not export_dirname:
export_dirname = os.path.join(
self.qfield_preferences.value("exportDirectory"),
fileparts(QgsProject.instance().fileName())[1],
)
return QDir.toNativeSeparators(str(export_dirname))

def get_export_filename_suggestion(self) -> str:
export_folder = Path(self.get_export_folder())
export_folder = Path(QDir.toNativeSeparators(str(export_dirname)))
full_project_name_suggestion = export_folder.joinpath(
f"{self.project.baseName()}_qfield.qgs"
)
return str(full_project_name_suggestion)

def set_export_filename_suggested(self) -> None:
self.packagedProjectFileWidget.setFilePath(
self.get_export_filename_suggestion()
)

def show_package_page(self):
self.nextButton.setVisible(False)
self.button_box.setVisible(True)
Expand Down

0 comments on commit f5328f3

Please sign in to comment.