Commit bb1ff89b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QVector here

parent b52f8a51
......@@ -63,7 +63,7 @@ void LogViewWidgetItem::toggleToolTip(bool displayed)
bool LogViewWidgetItem::operator<(const QTreeWidgetItem &other) const
{
int sortedColumn = treeWidget()->sortColumn();
const int sortedColumn = treeWidget()->sortColumn();
// If we sort items by date (always the first column)
if (sortedColumn == 0) {
......
......@@ -56,9 +56,9 @@ void JournaldConfiguration::setEntriesType(JournaldConfiguration::EntriesType en
mEntriesType = entriesType;
}
QList<JournalAddress> JournaldConfiguration::remoteJournals() const
QVector<JournalAddress> JournaldConfiguration::remoteJournals() const
{
QList<JournalAddress> journals;
QVector<JournalAddress> journals;
for (const QString &addressItem : qAsConst(mRemoteJournals)) {
JournalAddress addressInfo;
addressInfo.address = addressItem.section(QChar::fromLatin1('|'), 0, 0);
......@@ -70,7 +70,7 @@ QList<JournalAddress> JournaldConfiguration::remoteJournals() const
return journals;
}
void JournaldConfiguration::setRemoteJournals(const QList<JournalAddress> &remoteJournals)
void JournaldConfiguration::setRemoteJournals(const QVector<JournalAddress> &remoteJournals)
{
mRemoteJournals.clear();
for (const JournalAddress &addressInfo : remoteJournals) {
......
......@@ -51,8 +51,8 @@ public:
EntriesType entriesType();
void setEntriesType(EntriesType entriesType);
QList<JournalAddress> remoteJournals() const;
void setRemoteJournals(const QList<JournalAddress> &remoteJournals);
QVector<JournalAddress> remoteJournals() const;
void setRemoteJournals(const QVector<JournalAddress> &remoteJournals);
private:
bool mDisplayCurrentBootOnly;
......
......@@ -60,7 +60,7 @@ void JournaldConfigurationWidget::saveConfig()
configuration->setDisplayCurrentBootOnly(lastBootOnly->isChecked());
configuration->setEntriesType((JournaldConfiguration::EntriesType)entriesTypeComboBox->currentIndex());
QList<JournalAddress> remoteJournals;
QVector<JournalAddress> remoteJournals;
for (int row = 0; row < remoteJournalsListWidget->rowCount(); row++) {
QTableWidgetItem *addressItem = remoteJournalsListWidget->item(row, 0);
QTableWidgetItem *portItem = remoteJournalsListWidget->item(row, 1);
......@@ -91,7 +91,7 @@ void JournaldConfigurationWidget::readConfig()
remoteJournalsListWidget->removeRow(0);
}
const QList<JournalAddress> remoteJournals = configuration->remoteJournals();
const QVector<JournalAddress> remoteJournals = configuration->remoteJournals();
for (const JournalAddress &addressInfo : remoteJournals) {
if (haveJournalAddress(addressInfo.address, QString::number(addressInfo.port), addressInfo.https)) {
continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment