Skip to content

Commit

Permalink
wasm: disable recent files from webassembly
Browse files Browse the repository at this point in the history
  • Loading branch information
huxingyi committed Aug 26, 2023
1 parent 8682d4d commit a2a512c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/sources/document_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ DocumentWindow::DocumentWindow()

m_fileMenu->addSeparator();

#if defined(Q_OS_WASM)
#else
for (int i = 0; i < Preferences::instance().maxRecentFiles(); ++i) {
QAction* action = new QAction(this);
action->setVisible(false);
Expand All @@ -355,6 +357,7 @@ DocumentWindow::DocumentWindow()
m_quitAction = m_fileMenu->addAction(tr("&Quit"),
this, &DocumentWindow::close,
QKeySequence::Quit);
#endif

connect(m_fileMenu, &QMenu::aboutToShow, [=]() {
m_exportAsObjAction->setEnabled(m_canvasGraphicsWidget->hasItems());
Expand Down Expand Up @@ -1424,6 +1427,8 @@ void DocumentWindow::openRecentFile()

void DocumentWindow::updateRecentFileActions()
{
#if defined(Q_OS_WASM)
#else
QStringList files = Preferences::instance().recentFileList();

for (int i = 0; i < (int)files.size() && i < (int)m_recentFileActions.size(); ++i) {
Expand All @@ -1436,6 +1441,7 @@ void DocumentWindow::updateRecentFileActions()
m_recentFileActions[j]->setVisible(false);

m_recentFileSeparatorAction->setVisible(files.size() > 0);
#endif
}

QString DocumentWindow::strippedName(const QString& fullFileName)
Expand Down

0 comments on commit a2a512c

Please sign in to comment.