コード例 #1
0
ファイル: secretsmanager.cpp プロジェクト: snikolau/xpiks
 void SecretsManager::removeMasterPassword() {
      m_EncodedMasterPassword.clear();
      m_MasterPasswordHash.clear();
      emit afterMasterPasswordReset();
 }
コード例 #2
0
ファイル: commandmanager.cpp プロジェクト: Artiom-M/xpiks
void Commands::CommandManager::connectEntitiesSignalsSlots() const {
    if (m_SecretsManager != NULL && m_UploadInfoRepository != NULL) {
        QObject::connect(m_SecretsManager, SIGNAL(beforeMasterPasswordChange(QString, QString)),
                         m_UploadInfoRepository, SLOT(onBeforeMasterPasswordChanged(QString, QString)));

        QObject::connect(m_SecretsManager, SIGNAL(afterMasterPasswordReset()),
                         m_UploadInfoRepository, SLOT(onAfterMasterPasswordReset()));
    }

    if (m_ArtItemsModel != NULL && m_FilteredItemsModel != NULL) {
        QObject::connect(m_ArtItemsModel, SIGNAL(selectedArtworksRemoved(int)),
                         m_FilteredItemsModel, SLOT(onSelectedArtworksRemoved(int)));
    }

    if (m_SettingsModel != NULL && m_TelemetryService != NULL) {
        QObject::connect(m_SettingsModel, SIGNAL(userStatisticsChanged(bool)),
                         m_TelemetryService, SLOT(changeReporting(bool)));
    }

    if (m_SpellCheckerService != NULL && m_FilteredItemsModel != NULL) {
        QObject::connect(m_SpellCheckerService, SIGNAL(serviceAvailable(bool)),
                         m_FilteredItemsModel, SLOT(onSpellCheckerAvailable(bool)));
    }

    if (m_ArtworksRepository != NULL && m_ArtItemsModel != NULL) {
        QObject::connect(m_ArtworksRepository, SIGNAL(filesUnavailable()),
                         m_ArtItemsModel, SLOT(onFilesUnavailableHandler()));
    }

    if (m_ArtItemsModel != NULL && m_UndoRedoManager != NULL) {
        QObject::connect(m_UndoRedoManager, SIGNAL(undoStackEmpty()),
                         m_ArtItemsModel, SLOT(onUndoStackEmpty()));
    }

    if (m_LanguagesModel != NULL && m_KeywordsSuggestor != NULL) {
        QObject::connect(m_LanguagesModel, SIGNAL(languageChanged()),
                         m_KeywordsSuggestor, SLOT(onLanguageChanged()));
    }

    if (m_SpellCheckerService != NULL && m_ArtItemsModel != NULL) {
        QObject::connect(m_SpellCheckerService, SIGNAL(userDictUpdate(QStringList)),
                         m_ArtItemsModel, SLOT(userDictUpdateHandler(QStringList)));
        QObject::connect(m_SpellCheckerService, SIGNAL(userDictCleared()),
                         m_ArtItemsModel, SLOT(userDictClearedHandler()));
    }

    if (m_SpellCheckerService != NULL && m_CombinedArtworksModel != NULL) {
        QObject::connect(m_SpellCheckerService, SIGNAL(userDictUpdate(QStringList)),
                         m_CombinedArtworksModel, SLOT(userDictUpdateHandler(QStringList)));
        QObject::connect(m_SpellCheckerService, SIGNAL(userDictCleared()),
                         m_CombinedArtworksModel, SLOT(userDictClearedHandler()));
    }

    if (m_HelpersQmlWrapper != NULL && m_UpdateService != NULL) {
        QObject::connect(m_UpdateService, SIGNAL(updateAvailable(QString)),
                         m_HelpersQmlWrapper, SIGNAL(updateAvailable(QString)));

        QObject::connect(m_UpdateService, SIGNAL(updateDownloaded(QString)),
                         m_HelpersQmlWrapper, SLOT(updateIsDownloaded(QString)));
    }
}