Exemple #1
0
int getFilenameForCommand(cpCommand command, char* const outFilename, const size_t len)
{
	char commandfile[10] = {0};

	sprintf(commandfile, "/%03d.ir", command);
	
	if((readlink("/proc/self/exe", outFilename, len - 11)) == -1)
	{
		perror("readlink");
		return IR_FAILURE;
	}

	removeFileName(outFilename);
	strcat(outFilename, commandfile);

	return IR_SUCCESS;
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RiuRecentFileActionProvider::slotOpenRecentFile()
{
    QAction* action = qobject_cast<QAction *>(sender());
    if (action)
    {
        QString filename = action->data().toString();
        bool loadingSucceded = RiaApplication::instance()->openFile(filename);

        if (loadingSucceded)
        {
            addFileName(filename);
        }
        else
        {
            QMessageBox::warning(NULL, "File open", "Failed to import file located at\n" + filename);

            removeFileName(filename);
        }
    }
}