VirtualBox

Changeset 12286 in vbox for trunk/src


Ignore:
Timestamp:
Sep 9, 2008 11:29:49 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: Added counter & the revision to the update check.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDefs.h

    r10439 r12286  
    172172    static const char* GUI_UpdateDlgWinID;
    173173    static const char* GUI_UpdateDate;
     174    static const char* GUI_UpdateCheckCount;
    174175    static const char* GUI_LastVMSelected;
    175176    static const char* GUI_InfoDlgState;
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDefs.cpp

    r10439 r12286  
    4040const char* VBoxDefs::GUI_UpdateDlgWinID = "GUI/UpdateDlgWinID";
    4141const char* VBoxDefs::GUI_UpdateDate = "GUI/UpdateDate";
     42const char* VBoxDefs::GUI_UpdateCheckCount = "GUI/UpdateCheckCount";
    4243const char* VBoxDefs::GUI_LastVMSelected = "GUI/LastVMSelected";
    4344const char* VBoxDefs::GUI_InfoDlgState = "GUI/InfoDlgState";
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxUpdateDlg.cpp

    r11466 r12286  
    295295             SLOT (onNetError (const QString&)));
    296296
     297    int count = 1;
     298    bool ok = false;
     299    QString sc = vboxGlobal().virtualBox().GetExtraData (VBoxDefs::GUI_UpdateCheckCount);
     300    if (!sc.isEmpty())
     301    {
     302        int c = sc.toLongLong(&ok);
     303        if (ok)
     304            count = c;
     305    }
    297306    QString package = vboxGlobal().virtualBox().GetPackageType();
    298307    QString version = vboxGlobal().virtualBox().GetVersion();
     308    QString revision = QString::number (vboxGlobal().virtualBox().GetRevision());
    299309    package = QUrl::toPercentEncoding (package);
    300310    version = QUrl::toPercentEncoding (version);
     311    revision = QUrl::toPercentEncoding (revision);
    301312    QString body;
    302313    body += QString ("platform=%1").arg (package);
    303     body += QString ("&version=%1").arg (version);
     314    body += QString ("&version=%1_%2").arg (version).arg (revision);
     315    body += QString ("&count=%1").arg (count);
    304316
    305317    QStringList header ("User-Agent");
     
    436448        }
    437449    }
    438 }
    439 
     450
     451    int count = 1;
     452    bool ok = false;
     453    QString sc = vboxGlobal().virtualBox().GetExtraData (VBoxDefs::GUI_UpdateCheckCount);
     454    if (!sc.isEmpty())
     455        count = sc.toLongLong(&ok);
     456    vboxGlobal().virtualBox().SetExtraData (VBoxDefs::GUI_UpdateCheckCount,
     457                                            QString ("%1").arg ((qulonglong) count + 1));
     458}
     459
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette