Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions reader/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ MainWindow::MainWindow(QStringList filePathList, DMainWindow *parent)
initBase();
initUI();

if (!filePathList.isEmpty())
foreach (const QString &filePath, m_initFilePathList) {
if (!filePathList.isEmpty()) {
for (QString &filePath : m_initFilePathList) {
QUrl url(filePath);
if (url.isLocalFile()) {
filePath = url.toLocalFile();
}

if (QFile(filePath).exists()) //过滤不存在的文件,需求中不含有提示文件不存在的文案
addFile(filePath);
}
}
}

MainWindow::MainWindow(DocSheet *sheet, DMainWindow *parent)
Expand Down
6 changes: 6 additions & 0 deletions reader/app/DBusObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
#include "Application.h"
#include "Global.h"

#include <QDBusConnection>

Check warning on line 11 in reader/app/DBusObject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDBusConnection> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QUrl>

Check warning on line 12 in reader/app/DBusObject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QUrl> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QDebug>

Check warning on line 13 in reader/app/DBusObject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDebug> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <DSysInfo>

Check warning on line 15 in reader/app/DBusObject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DSysInfo> not found. Please note: Cppcheck does not need standard library headers to get proper results.

// gesture 触控板手势
#define DBUS_SERVER "com.deepin.Reader"
Expand Down Expand Up @@ -124,6 +125,11 @@
MainWindow *mainwindow = MainWindow::m_list.count() > 0 ? MainWindow::m_list[0] : MainWindow::createWindow();
mainwindow->setProperty("loading", true);
foreach (QString filePath, filePathList) {
QUrl url(filePath);
if (url.isLocalFile()) {
filePath = url.toLocalFile();
}

if (mainwindow->property("windowClosed").toBool())
break;

Expand Down