Exemplo n.º 1
0
    bool ArtworkMetadata::initialize(const QString &title,
                                     const QString &description, const QStringList &rawKeywords, bool overwrite) {
        LOG_INTEGRATION_TESTS << title << description << rawKeywords << overwrite;

        bool anythingModified = false;

        if (overwrite || (m_KeywordsModel.isTitleEmpty() && !title.trimmed().isEmpty())) {
            anythingModified = true;
            m_KeywordsModel.setTitle(title);
        }

        if (overwrite || (m_KeywordsModel.isDescriptionEmpty() && !description.trimmed().isEmpty())) {
            anythingModified = true;
            m_KeywordsModel.setDescription(description);
        }

        if (overwrite) {
            anythingModified = true;
            m_KeywordsModel.setKeywords(rawKeywords);
        } else if (!rawKeywords.isEmpty()) {
            int appendedCount = m_KeywordsModel.appendKeywords(rawKeywords);
            anythingModified = anythingModified || (appendedCount > 0);
        }

        setIsModifiedFlag(false);
        setIsInitializedFlag(true);

        return anythingModified;
    }
Exemplo n.º 2
0
    bool PluginWrapper::initializePlugin() {
        LOG_INFO << getPrettyName() << getVersionString();

        bool result = false;
        m_PluginEnvironment.initialize();

        try {
            result = m_PluginInterface->initialize(m_PluginEnvironment);
            setIsInitializedFlag(true);
        }
        catch(...) {
            LOG_WARNING << "Exception while initializing plugin";
        }

        return result;
    }
Exemplo n.º 3
0
    bool PluginWrapper::finalizePlugin() {
        LOG_INFO << getPrettyName() << getVersionString();
        if (!getIsInitializedFlag()) { return true; }

        bool result = false;

        try {
            m_PluginInterface->finalize();
            setIsInitializedFlag(false);
            result = true;
        }
        catch (...) {
            LOG_WARNING << "Exception on finalization";
        }

        return result;
    }