Comment 3 for bug 1624661

Revision history for this message
Azaziah (suutari-olli) wrote :

https://gist.github.com/anonymous/10c11792c0b37ec3693bf9494017a3aa

This code fixes the issue, but I can't make it work with:
QtWidgets.QMessageBox.No/Yes.

At this point I'm getting rather frustrated with this issue and would gladly give it up for someone who's a better programmer.

\openlp\core\common\applocation.py

    @staticmethod
    def get_data_path():
        """
        Return the path OpenLP stores all its data under.
        """
        from openlp.core.lib.ui import critical_error_message_box
        from openlp.core.common import AppLocation, Settings, translate
        # Check if we have a different data location.
        if Settings().contains('advanced/data path'):
            path = Settings().value('advanced/data path')
            if not os.path.exists(path):
                critical_error_message_box(translate('OpenLP.Manager', 'Database Error'),
                                           translate('OpenLP.Manager',
                                                     'OpenLP cannot load your database.\n\nDatabase:'))
                Settings().remove('advanced/data path')
                path = AppLocation.get_directory(AppLocation.DataDir)
                check_directory_exists(path)
        else:
            path = AppLocation.get_directory(AppLocation.DataDir)
            check_directory_exists(path)
        return os.path.normpath(path)