MCPcopy Create free account
hub / github.com/c3d/tao3D / updateRecentFileActions

Method updateRecentFileActions

tao/window.cpp:3115–3142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3113
3114
3115void Window::updateRecentFileActions()
3116// ----------------------------------------------------------------------------
3117// Update the recent files menu (file names are read from settings)
3118// ----------------------------------------------------------------------------
3119{
3120 QSettings settings;
3121 QStringList files = settings.value("recentFileList").toStringList();
3122
3123 files.removeAll("");
3124 int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles);
3125
3126 for (int i = 0; i < numRecentFiles; ++i) {
3127 QString nat = QDir::toNativeSeparators(files[i]);
3128#ifdef CONFIG_MACOSX
3129 QString text = nat;
3130#else
3131 QString text = tr("&%1 %2").arg(i + 1).arg(nat);
3132#endif
3133 recentFileActs[i]->setText(text);
3134 recentFileActs[i]->setData(files[i]);
3135 recentFileActs[i]->setToolTip(files[i]);
3136 recentFileActs[i]->setVisible(true);
3137 }
3138 for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
3139 recentFileActs[j]->setVisible(false);
3140
3141 clearRecentAct->setEnabled(numRecentFiles > 0);
3142}
3143
3144
3145Window *Window::findWindow(const QString &fileName)

Callers 1

foreachFunction · 0.80

Calls 3

setVisibleMethod · 0.80
setEnabledMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected