forked from qt-creator/qt-creator
Git: Avoid usage of deprecated QDateTime::fromTime_t
Change-Id: I37ce617990ee385e37261624d847a0aef757d283 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
f350c4d1d4
commit
6296e7bb38
@@ -593,7 +593,7 @@ QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModel
|
|||||||
VcsCommand::SuppressCommandLogging)) {
|
VcsCommand::SuppressCommandLogging)) {
|
||||||
const QStringList values = output.split(' ');
|
const QStringList values = output.split(' ');
|
||||||
startSha = values[0];
|
startSha = values[0];
|
||||||
branchDateTime = QDateTime::fromTime_t(values[1].toUInt());
|
branchDateTime = QDateTime::fromSecsSinceEpoch(values[1].toLongLong());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -677,8 +677,8 @@ void BranchModel::parseOutputLine(const QString &line)
|
|||||||
if (strDateTime.isEmpty())
|
if (strDateTime.isEmpty())
|
||||||
strDateTime = lineParts.at(4);
|
strDateTime = lineParts.at(4);
|
||||||
if (!strDateTime.isEmpty()) {
|
if (!strDateTime.isEmpty()) {
|
||||||
const uint timeT = strDateTime.leftRef(strDateTime.indexOf(' ')).toUInt();
|
const qint64 timeT = strDateTime.leftRef(strDateTime.indexOf(' ')).toLongLong();
|
||||||
dateTime = QDateTime::fromTime_t(timeT);
|
dateTime = QDateTime::fromSecsSinceEpoch(timeT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_oldBranchesIncluded && !current && dateTime.isValid()) {
|
if (!m_oldBranchesIncluded && !current && dateTime.isValid()) {
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ static GerritChangePtr parseSshOutput(const QJsonObject &object)
|
|||||||
change->branch = object.value("branch").toString();
|
change->branch = object.value("branch").toString();
|
||||||
change->status = object.value("status").toString();
|
change->status = object.value("status").toString();
|
||||||
if (const int timeT = object.value("lastUpdated").toInt())
|
if (const int timeT = object.value("lastUpdated").toInt())
|
||||||
change->lastUpdated = QDateTime::fromTime_t(uint(timeT));
|
change->lastUpdated = QDateTime::fromSecsSinceEpoch(timeT);
|
||||||
// Read out dependencies
|
// Read out dependencies
|
||||||
const QJsonValue dependsOnValue = object.value("dependsOn");
|
const QJsonValue dependsOnValue = object.value("dependsOn");
|
||||||
if (dependsOnValue.isArray()) {
|
if (dependsOnValue.isArray()) {
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ void GerritPushDialog::initRemoteBranches()
|
|||||||
continue;
|
continue;
|
||||||
const QString ref = entries.at(0).mid(remotesPrefix.size());
|
const QString ref = entries.at(0).mid(remotesPrefix.size());
|
||||||
int refBranchIndex = ref.indexOf('/');
|
int refBranchIndex = ref.indexOf('/');
|
||||||
unsigned int timeT = entries.at(1).leftRef(entries.at(1).indexOf(' ')).toUInt();
|
qint64 timeT = entries.at(1).leftRef(entries.at(1).indexOf(' ')).toLongLong();
|
||||||
BranchDate bd(ref.mid(refBranchIndex + 1), QDateTime::fromTime_t(timeT).date());
|
BranchDate bd(ref.mid(refBranchIndex + 1), QDateTime::fromSecsSinceEpoch(timeT).date());
|
||||||
m_remoteBranches.insertMulti(ref.left(refBranchIndex), bd);
|
m_remoteBranches.insertMulti(ref.left(refBranchIndex), bd);
|
||||||
}
|
}
|
||||||
m_ui->remoteComboBox->updateRemotes(false);
|
m_ui->remoteComboBox->updateRemotes(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user