Skip to content

Commit

Permalink
chore: remove the dependence of pandoc
Browse files Browse the repository at this point in the history
Log:
  • Loading branch information
Decodetalkers authored and deepin-bot[bot] committed Jan 15, 2024
1 parent bb4f92c commit 89190e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
31 changes: 2 additions & 29 deletions dde-license-dialog/src/content.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Content::Content(QWidget *parent)
m_cancelBtn->setFixedSize(90, 36);
m_acceptBtn->setFixedSize(90, 36);

m_source->setTextFormat(Qt::RichText);
m_source->setTextFormat(Qt::MarkdownText);
m_source->setWordWrap(true);
m_source->setOpenExternalLinks(true);
// 左右边距20
Expand Down Expand Up @@ -179,35 +179,8 @@ void Content::setSource(const QString &source)
{
if (source.isEmpty())
return;
// pandoc将md转换成html
static QMap<QString, QString> 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).arg(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)) {
qDebug() << file.errorString();
return;
}
sourceMap.insert(source, file.readAll());
file.close();
}

m_source->setText(sourceMap[source]);
m_source->setText(source);

updateWindowHeight();
}
Expand Down
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${dist:Depends},
x11-xserver-utils,
dbus-user-session,
dde-session-shell,
pandoc
Provides: lightdm-greeter
Recommends: onboard
Conflicts: dde-workspace,
Expand Down

0 comments on commit 89190e0

Please sign in to comment.