Ticket #1531: FileZilla_actions_int_to_enum_rev2413.patch

File FileZilla_actions_int_to_enum_rev2413.patch, 3.9 KB (added by paolozambotti, 12 years ago)

some more actions int to enum changes

  • src/interface/optionspage_fileexists.cpp

     
    88{
    99    bool failure = false;
    1010
    11     const int dlAction = m_pOptions->GetOptionVal(OPTION_FILEEXISTS_DOWNLOAD);
     11    const enum CFileExistsNotification::OverwriteAction dlAction = (enum CFileExistsNotification::OverwriteAction)(m_pOptions->GetOptionVal(OPTION_FILEEXISTS_DOWNLOAD));
    1212    switch (dlAction)
    1313    {
    14     case 1:
     14    case CFileExistsNotification::overwrite:
    1515        SetRCheck(XRCID("ID_DL_OVERWRITE"), true, failure);
    1616        break;
    17     case 2:
     17    case CFileExistsNotification::overwriteNewer:
    1818        SetRCheck(XRCID("ID_DL_OVERWRITEIFNEWER"), true, failure);
    1919        break;
    20     case 3:
     20    case CFileExistsNotification::resume:
    2121        SetRCheck(XRCID("ID_DL_RESUME"), true, failure);
    2222        break;
    23     case 4:
     23    case CFileExistsNotification::rename:
    2424        SetRCheck(XRCID("ID_DL_RENAME"), true, failure);
    2525        break;
    26     case 5:
     26    case CFileExistsNotification::skip:
    2727        SetRCheck(XRCID("ID_DL_SKIP"), true, failure);
    2828        break;
    2929    default:
     
    3131        break;
    3232    };
    3333
    34     const int ulAction = m_pOptions->GetOptionVal(OPTION_FILEEXISTS_UPLOAD);
     34    const enum CFileExistsNotification::OverwriteAction ulAction = (enum CFileExistsNotification::OverwriteAction)(m_pOptions->GetOptionVal(OPTION_FILEEXISTS_UPLOAD));
    3535    switch (ulAction)
    3636    {
    37     case 1:
     37    case CFileExistsNotification::overwrite:
    3838        SetRCheck(XRCID("ID_UL_OVERWRITE"), true, failure);
    3939        break;
    40     case 2:
     40    case CFileExistsNotification::overwriteNewer:
    4141        SetRCheck(XRCID("ID_UL_OVERWRITEIFNEWER"), true, failure);
    4242        break;
    43     case 3:
     43    case CFileExistsNotification::resume:
    4444        SetRCheck(XRCID("ID_UL_RESUME"), true, failure);
    4545        break;
    46     case 4:
     46    case CFileExistsNotification::rename:
    4747        SetRCheck(XRCID("ID_UL_RENAME"), true, failure);
    4848        break;
    49     case 5:
     49    case CFileExistsNotification::skip:
    5050        SetRCheck(XRCID("ID_UL_SKIP"), true, failure);
    5151        break;
    5252    default:
     
    6161
    6262bool COptionsPageFileExists::SavePage()
    6363{
    64     int value;
     64    enum CFileExistsNotification::OverwriteAction value;
    6565    if (GetRCheck(XRCID("ID_DL_OVERWRITE")))
    66         value = 1;
     66        value = CFileExistsNotification::overwrite;
    6767    else if (GetRCheck(XRCID("ID_DL_OVERWRITEIFNEWER")))
    68         value = 2;
     68        value = CFileExistsNotification::overwriteNewer;
    6969    else if (GetRCheck(XRCID("ID_DL_RESUME")))
    70         value = 3;
     70        value = CFileExistsNotification::resume;
    7171    else if (GetRCheck(XRCID("ID_DL_RENAME")))
    72         value = 4;
     72        value = CFileExistsNotification::rename;
    7373    else if (GetRCheck(XRCID("ID_DL_SKIP")))
    74         value = 5;
     74        value = CFileExistsNotification::skip;
    7575    else
    76         value = 0;
     76        value = CFileExistsNotification::ask;
    7777    m_pOptions->SetOption(OPTION_FILEEXISTS_DOWNLOAD, value);
    7878
    7979    if (GetRCheck(XRCID("ID_UL_OVERWRITE")))
    80         value = 1;
     80        value = CFileExistsNotification::overwrite;
    8181    else if (GetRCheck(XRCID("ID_UL_OVERWRITEIFNEWER")))
    82         value = 2;
     82        value = CFileExistsNotification::overwriteNewer;
    8383    else if (GetRCheck(XRCID("ID_UL_RESUME")))
    84         value = 3;
     84        value = CFileExistsNotification::resume;
    8585    else if (GetRCheck(XRCID("ID_UL_RENAME")))
    86         value = 4;
     86        value = CFileExistsNotification::rename;
    8787    else if (GetRCheck(XRCID("ID_UL_SKIP")))
    88         value = 5;
     88        value = CFileExistsNotification::skip;
    8989    else
    90         value = 0;
     90        value = CFileExistsNotification::ask;
    9191    m_pOptions->SetOption(OPTION_FILEEXISTS_UPLOAD, value);
    9292
    9393    m_pOptions->SetOption(OPTION_ASCIIRESUME, GetCheck(XRCID("ID_ASCIIRESUME")));
  • src/interface/asyncrequestqueue.cpp

     
    142142                action = (enum CFileExistsNotification::OverwriteAction)option;
    143143        }
    144144
    145         if (!action)
     145        if (action == CFileExistsNotification::ask)
    146146        {
    147147            CFileExistsDlg dlg(pNotification);
    148148            dlg.Create(m_pMainFrame);