diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 498aeb79a4f212919e1599f05e9ee00257c7da9a..decc2811df431347e31e4aa9144f9ce55623c2b1 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -963,8 +963,9 @@ void UBDocumentController::importFile() if (group) { QString defaultPath = UBSettings::settings()->lastImportFilePath->get().toString(); - QString filePath = QFileDialog::getOpenFileName(mParentWidget, tr("Open Supported File"), - defaultPath, docManager->importFileFilter()); + if(defaultPath.isDetached()) + defaultPath = UBSettings::settings()->userDocumentDirectory(); + QString filePath = QFileDialog::getOpenFileName(mParentWidget, tr("Open Supported File"), defaultPath, docManager->importFileFilter()); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); QApplication::processEvents(); diff --git a/src/pdf/XPDFRenderer.cpp b/src/pdf/XPDFRenderer.cpp index 82d7077a685822146813689a0c1919d3c7944e96..f60406755b862bffe98adb47c54c360eaf5c398c 100644 --- a/src/pdf/XPDFRenderer.cpp +++ b/src/pdf/XPDFRenderer.cpp @@ -49,7 +49,7 @@ XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile) globalParams->setupBaseFonts(QFile::encodeName(UBPlatformUtils::applicationResourcesDirectory() + "/" + "fonts").data()); } - mDocument = new PDFDoc(new GString(filename.toUtf8().data()), 0, 0, 0); // the filename GString is deleted on PDFDoc desctruction + mDocument = new PDFDoc(new GString(filename.toLocal8Bit()), 0, 0, 0); // the filename GString is deleted on PDFDoc desctruction sInstancesCount.ref(); }