Ticket #2838: mythshutdown-wakeupcmd.diff

File mythshutdown-wakeupcmd.diff, 1.1 KB (added by devel@…, 17 years ago)

Mythshutdown shutdown command logic

  • programs/mythshutdown/main.cpp

     
    413413        if (dtCurrent.secsTo(dtWakeupTime) > 15 * 60)
    414414        {
    415415            QString nvramCommand = gContext->GetSetting("MythShutdownNvramCmd",
    416                      "/usr/bin/nvram-wakeup");
    417             nvramCommand += QString(" --settime %1")
    418                             .arg(dtWakeupTime.toTime_t());
     416                     "/usr/bin/nvram-wakeup --settime $time");
    419417
     418            QString wakeup_timeformat = gContext->GetSetting("WakeupTimeFormat");
     419       
     420            if (wakeup_timeformat == "time_t")
     421            {
     422                QString time_ts;
     423                nvramCommand.replace("$time", time_ts.setNum(dtWakeupTime.toTime_t()));
     424            }
     425            else
     426                nvramCommand.replace("$time", dtWakeupTime.toString(wakeup_timeformat));
     427           
     428
    420429            VERBOSE(VB_IMPORTANT, QString("sending command to set time in bios\n\t\t\t%1")
    421430                            .arg(nvramCommand));