~lubuntu-dev/lxde/qps

« back to all changes in this revision

Viewing changes to src/infobar.cpp

  • Committer: Alf Gaida
  • Author(s): Luís Pereira
  • Date: 2018-04-02 21:08:20 UTC
  • Revision ID: git-v1:0ddce0ecdaa7c4d678ffc5a1e2a3b5c0e16b8000
Drop Qt foreach

foreach will be deprecated and removed.
Qt 5.7.1 required. We use qAsConst.

Show diffs side-by-side

added added

removed removed

Lines of Context:
806
806
QString doHistory(SysHistory *sysh)
807
807
{
808
808
    QString str;
809
 
    Procinfo *p;
810
809
    int max = 0;
811
810
 
812
811
    char buf[128];
820
819
    // qsort(ps->data(), ps->size(), sizeof(Procinfo *),(compare_func)
821
820
    // compare_backwards);
822
821
 
823
 
    foreach (p, sysh->procs)
 
822
    for (const auto *p : qAsConst(sysh->procs))
824
823
    {
825
824
        if (p->pcpu == 0)
826
825
            continue;
835
834
QString GraphBase::doHistoryTXT(SysHistory *sysh)
836
835
{
837
836
    QString str;
838
 
    Procinfo *p;
839
837
    int max = 0;
840
838
 
841
839
    char buf[128];
842
840
    // sprintf(buf,"miniHistory /* %.02f%%",sysh->load_cpu*100);
843
841
    sprintf(buf, "%%CPU miniHistory test");
844
842
    str += QString::fromLatin1(buf);
845
 
    foreach (p, sysh->procs)
 
843
    for (const auto *p : qAsConst(sysh->procs))
846
844
    {
847
845
        if (p->pcpu == 0)
848
846
            continue;
906
904
QString IO_Graph::doHistoryTXT(SysHistory *sysh)
907
905
{
908
906
    QString str;
909
 
    Procinfo *p;
910
907
    int max = 0;
911
908
 
912
909
    char buf[64], mem_str[64];
914
911
    sprintf(buf, "miniHistory IO");
915
912
    str += QString::fromLatin1(buf);
916
913
 
917
 
    foreach (p, sysh->procs)
 
914
    for (const auto *p : qAsConst(sysh->procs))
918
915
    {
919
916
        if (p->io_read_KBps == 0 and p->io_write_KBps == 0)
920
917
            continue;