Skip to content

Commit

Permalink
do not add project folder if it already is defined (#144)
Browse files Browse the repository at this point in the history
fixes #124 follow up
  • Loading branch information
3nids authored May 1, 2020
1 parent ef551a8 commit d4e1445
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions qfieldsync/gui/package_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ def update_progress(self, sent, total):

def setup_gui(self):
"""Populate gui and connect signals of the push dialog"""
base_folder = self.qfield_preferences.value('exportDirectoryProject') or self.qfield_preferences.value('exportDirectory')
project_fn = QgsProject.instance().fileName()
export_folder_name = fileparts(project_fn)[1]
export_folder_path = os.path.join(base_folder, export_folder_name)
export_folder_path = self.qfield_preferences.value('exportDirectoryProject')
if not export_folder_path:
project_fn = QgsProject.instance().fileName()
export_folder_name = fileparts(project_fn)[1]
export_folder_path = os.path.join(self.qfield_preferences.value('exportDirectory'), export_folder_name)

self.manualDir.setText(export_folder_path)
self.manualDir_btn.clicked.connect(make_folder_selector(self.manualDir))
self.update_info_visibility()
Expand Down

0 comments on commit d4e1445

Please sign in to comment.