コード例 #1
0
ファイル: Configuration.cpp プロジェクト: elfmz/far2l
void TConfiguration::Default()
{
  TGuard Guard(FCriticalSection);

  FDisablePasswordStoring = false;
  FForceBanners = false;
  FDisableAcceptingHostKeys = false;

  std::unique_ptr<TRegistryStorage> AdminStorage(new TRegistryStorage(GetRegistryStorageKey(), HKEY_LOCAL_MACHINE));
  try__finally
  {
    if (AdminStorage->OpenRootKey(false))
    {
      LoadAdmin(AdminStorage.get());
      AdminStorage->CloseSubKey();
    }
  }
  __finally
  {
//    delete AdminStorage;
  };

  SetRandomSeedFile(FDefaultRandomSeedFile);
  SetPuttyRegistryStorageKey(OriginalPuttyRegistryStorageKey);
  FConfirmOverwriting = true;
  FConfirmResume = true;
  FAutoReadDirectoryAfterOp = true;
  FSessionReopenAuto = 5000;
  FSessionReopenBackground = 2000;
  FSessionReopenTimeout = 0;
  FSessionReopenAutoStall = 60000;
  FTunnelLocalPortNumberLow = 50000;
  FTunnelLocalPortNumberHigh = 50099;
  FCacheDirectoryChangesMaxSize = 100;
  FShowFtpWelcomeMessage = false;
  FExternalIpAddress.Clear();
  FTryFtpWhenSshFails = true;
  SetCollectUsage(FDefaultCollectUsage);
  FSessionReopenAutoMaximumNumberOfRetries = CONST_DEFAULT_NUMBER_OF_RETRIES;
  FDefaultCollectUsage = false;

  FLogging = false;
  FPermanentLogging = false;
  FLogFileName = GetDefaultLogFileName();
  FPermanentLogFileName = FLogFileName;
  FLogFileAppend = true;
  FLogSensitive = false;
  FPermanentLogSensitive = FLogSensitive;
  FLogWindowLines = 100;
  FLogProtocol = 0;
  FPermanentLogProtocol = FLogProtocol;
  UpdateActualLogProtocol();
  FLogActions = false;
  FPermanentLogActions = false;
  FActionsLogFileName = "%TEMP%" WGOOD_SLASH "&S.xml";
  FPermanentActionsLogFileName = FActionsLogFileName;
  FProgramIniPathWrittable = -1;

  Changed();
}
コード例 #2
0
ファイル: Configuration.cpp プロジェクト: elfmz/far2l
THierarchicalStorage * TConfiguration::CreateStorage(bool & SessionList)
{
  THierarchicalStorage * Result = nullptr;
  if (GetStorage() == stRegistry)
  {
    Result = new TRegistryStorage(GetRegistryStorageKey());
  }
  else
  {
    ThrowNotImplemented(3005);
    DebugAssert(false);
  }

  if ((FOptionsStorage.get() != nullptr) && (FOptionsStorage->GetCount() > 0))
  {
    if (!SessionList)
    {
//      Result = new TOptionsStorage(FOptionsStorage.get(), ConfigurationSubKey, Result);
    }
    else
    {
      // cannot reuse session list storage for configuration as for it we need
      // the option-override storage above
    }
  }
  else
  {
    // All the above stores can be reused for configuration,
    // if no options-overrides are set
    SessionList = false;
  }

  return Result;
}
コード例 #3
0
ファイル: Configuration.cpp プロジェクト: elfmz/far2l
void TConfiguration::CleanupRegistry(const UnicodeString & CleanupSubKey)
{
  std::unique_ptr<TRegistryStorage> Registry(new TRegistryStorage(GetRegistryStorageKey()));
  try__finally
  {
    Registry->RecursiveDeleteSubKey(CleanupSubKey);
  }
  __finally
  {
//    delete Registry;
  };
}
コード例 #4
0
//---------------------------------------------------------------------------
THierarchicalStorage * TConfiguration::CreateStorage(bool /*SessionList*/)
{
  if (GetStorage() == stRegistry)
  {
    return new TRegistryStorage(GetRegistryStorageKey());
  }
#if defined(__BORLANDC__)
  else if (GetStorage() == stNul)
  {
    return new TIniFileStorage(L"nul");
  }
#endif
  else
  {
    Classes::Error(SNotImplemented, 3005);
  }
  assert(false);
  return nullptr;
}