diff --git a/dde-license-dialog/src/content.cpp b/dde-license-dialog/src/content.cpp index ee25f56e..c289cb46 100644 --- a/dde-license-dialog/src/content.cpp +++ b/dde-license-dialog/src/content.cpp @@ -6,24 +6,17 @@ #include #include -#include #include #include #include #include -#include #include #include #include -#include -#include -#include #include -#include #include #include -#include #include #include #include @@ -177,36 +170,20 @@ int Content::calWidgetWidth() void Content::setSource(const QString &source) { - if (source.isEmpty()) + if (source.isEmpty() || !QFile::exists(source)) return; - // pandoc将md转换成html - static QMap sourceMap; - if (sourceMap[source].isEmpty()) { - QProcess process; - QString para; - QString tempPath = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation).first(); - tempPath.append("/license_temp.html"); - if (QFile::exists(tempPath)) - QFile::remove(tempPath); - para = QString("pandoc %1 --output %2").arg(source, tempPath); - QStringList args; - args << "-c"; - args << para; - process.start("sh", args); - process.waitForFinished(); - process.waitForReadyRead(); - QFile file(tempPath); - if (!file.open(QIODevice::Text | QIODevice::ReadOnly)) { - qWarning() << "Set source error: " << file.errorString(); - return; - } - sourceMap.insert(source, file.readAll()); - file.close(); + QFile file(source); + if (!file.open(QIODevice::Text | QIODevice::ReadOnly)) { + qWarning() << "Set source error: " << file.errorString(); + return; } - m_source->setText(sourceMap[source]); + QTextDocument doc; + doc.setMarkdown(file.readAll()); + file.close(); + m_source->setText(doc.toHtml()); updateWindowHeight(); } diff --git a/dde-license-dialog/src/mainwindow.h b/dde-license-dialog/src/mainwindow.h index 21e17ccc..1c458553 100644 --- a/dde-license-dialog/src/mainwindow.h +++ b/dde-license-dialog/src/mainwindow.h @@ -38,7 +38,7 @@ class MainWindow : public DAbstractDialog QString m_enTitle; DIconButton *btnclose; - const int windowFixedWidth = 500; + const int windowFixedWidth = 520; }; #endif // MAINWINDOW_H diff --git a/debian/control b/debian/control index 626cc95e..32299cda 100644 --- a/debian/control +++ b/debian/control @@ -30,8 +30,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${dist:Depends}, startdde (>=5.8.15), x11-xserver-utils, dbus-user-session, - dde-session-shell, - pandoc, + dde-session-shell Provides: lightdm-greeter Recommends: onboard Conflicts: dde-workspace,