本文整理汇总了C++中ProjectPtr::isGraphWorthLess方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectPtr::isGraphWorthLess方法的具体用法?C++ ProjectPtr::isGraphWorthLess怎么用?C++ ProjectPtr::isGraphWorthLess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectPtr
的用法示例。
在下文中一共展示了ProjectPtr::isGraphWorthLess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: file
AppInstancePtr
Gui::openProjectInternal(const std::string & absoluteFileName,
bool attemptToLoadAutosave)
{
QFileInfo file( QString::fromUtf8( absoluteFileName.c_str() ) );
if ( !file.exists() ) {
return AppInstancePtr();
}
QString fileUnPathed = file.fileName();
QString path = file.path() + QLatin1Char('/');
int openedProject = appPTR->isProjectAlreadyOpened(absoluteFileName);
if (openedProject != -1) {
AppInstancePtr instance = appPTR->getAppInstance(openedProject);
if (instance) {
GuiAppInstancePtr guiApp = toGuiAppInstance(instance);
if (guiApp) {
guiApp->getGui()->activateWindow();
return instance;
}
}
}
AppInstancePtr ret;
ProjectPtr project = getApp()->getProject();
///if the current graph has no value, just load the project in the same window
if ( project->isGraphWorthLess() ) {
bool ok = project->loadProject( path, fileUnPathed, false, attemptToLoadAutosave);
if (ok) {
ret = _imp->_appInstance.lock();
}
} else {
CLArgs cl;
AppInstancePtr newApp = appPTR->newAppInstance(cl, false);
bool ok = newApp->getProject()->loadProject( path, fileUnPathed, false, attemptToLoadAutosave);
if (ok) {
ret = newApp;
}
}
QSettings settings;
QStringList recentFiles = settings.value( QString::fromUtf8("recentFileList") ).toStringList();
recentFiles.removeAll( QString::fromUtf8( absoluteFileName.c_str() ) );
recentFiles.prepend( QString::fromUtf8( absoluteFileName.c_str() ) );
while (recentFiles.size() > NATRON_MAX_RECENT_FILES) {
recentFiles.removeLast();
}
settings.setValue(QString::fromUtf8("recentFileList"), recentFiles);
appPTR->updateAllRecentFileMenus();
return ret;
} // Gui::openProjectInternal