Switch to Path objects nearly everywhere

This commit is contained in:
Veronica Berglyd Olsen
2022-11-09 22:43:48 +01:00
parent cb755ba820
commit 03e173634f
36 changed files with 406 additions and 521 deletions
+3 -3
View File
@@ -23,10 +23,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
import os
import logging
import novelwriter
from pathlib import Path
from datetime import datetime
from PyQt5.QtGui import QKeySequence
@@ -190,8 +190,8 @@ class GuiProjectLoad(QDialog):
self, self.tr("Open Project"), "", filter=";;".join(extFilter)
)
if projFile:
thePath = os.path.abspath(os.path.dirname(projFile))
self.selPath.setText(thePath)
thePath = Path(projFile).absolute()
self.selPath.setText(str(thePath))
self.openPath = thePath
self.openState = self.OPEN_STATE
self.accept()