Skip to content

Commit

Permalink
Replace QVector with QList
Browse files Browse the repository at this point in the history
In Qt6 it's an alias
  • Loading branch information
gfgit committed Feb 28, 2024
1 parent b682f1e commit 4343a79
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion panel/lxqtpanelapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ LXQtPanelApplicationPrivate::LXQtPanelApplicationPrivate(LXQtPanelApplication *q
ILXQtPanel::Position LXQtPanelApplicationPrivate::computeNewPanelPosition(const LXQtPanel *p, const int screenNum)
{
Q_Q(LXQtPanelApplication);
QVector<bool> screenPositions(4, false); // false means not occupied
QList<bool> screenPositions(4, false); // false means not occupied

for (int i = 0; i < q->mPanels.size(); ++i) {
if (p != q->mPanels.at(i)) {
Expand Down
6 changes: 3 additions & 3 deletions panel/lxqtpanellayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class LayoutItemGrid
void moveItem(int from, int to);

private:
QVector<LayoutItemInfo> mInfoItems;
QList<LayoutItemInfo> mInfoItems;
int mColCount;
int mUsedColCount;
int mRowCount;
Expand Down Expand Up @@ -648,7 +648,7 @@ void LXQtPanelLayout::setGeometryHoriz(const QRect &geometry)
}

// Calc baselines for plugins like button.
QVector<int> baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount()));
QList<int> baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount()));
const int bh = geometry.height() / baseLines.count();
const int base_center = bh >> 1;
const int height_remain = 0 < bh ? geometry.height() % baseLines.size() : 0;
Expand Down Expand Up @@ -787,7 +787,7 @@ void LXQtPanelLayout::setGeometryVert(const QRect &geometry)
}

// Calc baselines for plugins like button.
QVector<int> baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount()));
QList<int> baseLines(qMax(mLeftGrid->colCount(), mRightGrid->colCount()));
const int bw = geometry.width() / baseLines.count();
const int base_center = bw >> 1;
const int width_remain = 0 < bw ? geometry.width() % baseLines.size() : 0;
Expand Down
6 changes: 3 additions & 3 deletions plugin-fancymenu/lxqtfancymenuappmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ LXQtFancyMenuAppMap::AppItem *LXQtFancyMenuAppMap::getAppAt(int index)
return *mCachedIterator;
}

QVector<const LXQtFancyMenuAppMap::AppItem *> LXQtFancyMenuAppMap::getMatchingApps(const QString &query) const
QList<const LXQtFancyMenuAppMap::AppItem *> LXQtFancyMenuAppMap::getMatchingApps(const QString &query) const
{
QVector<const AppItem *> byName;
QVector<const AppItem *> byKeyword;
QList<const AppItem *> byName;
QList<const AppItem *> byKeyword;

//TODO: implement some kind of score to get better matches on top

Expand Down
8 changes: 4 additions & 4 deletions plugin-fancymenu/lxqtfancymenuappmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define LXQTFANCYMENUAPPMAP_H

#include <QMap>
#include <QVector>
#include <QList>
#include <QStringList>
#include <QIcon>

Expand Down Expand Up @@ -74,7 +74,7 @@ class LXQtFancyMenuAppMap
LXQtFancyMenuItemType type = LXQtFancyMenuItemType::AppItem;
};

QVector<Item> apps;
QList<Item> apps;
LXQtFancyMenuItemType type;
};

Expand Down Expand Up @@ -108,7 +108,7 @@ class LXQtFancyMenuAppMap

AppItem *getAppAt(int index);

QVector<const AppItem *> getMatchingApps(const QString& query) const;
QList<const AppItem *> getMatchingApps(const QString& query) const;

private:
void parseMenu(const QDomElement& menu, const QString &topLevelCategory);
Expand All @@ -121,7 +121,7 @@ class LXQtFancyMenuAppMap
typedef QMap<QString, AppItem *> AppMap;
AppMap mAppSortedByDesktopFile;
AppMap mAppSortedByName;
QVector<Category> mCategories;
QList<Category> mCategories;

// Cache sort by name map access
AppMap::const_iterator mCachedIterator;
Expand Down
4 changes: 2 additions & 2 deletions plugin-fancymenu/lxqtfancymenuappmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ bool LXQtFancyMenuAppModel::dropMimeData(const QMimeData *data_, Qt::DropAction
return false; // No-op

// realRow is needed because beginMoveRows() behaves differenlty than
// QVector<...>::move() on index counting.
// QList<...>::move() on index counting.
beginMoveRows(QModelIndex(), oldRow, oldRow, QModelIndex(), realRow);

mAppMap->moveFavoriteItem(oldRow, row);
Expand Down Expand Up @@ -208,7 +208,7 @@ void LXQtFancyMenuAppModel::setCurrentCategory(int category)
endResetModel();
}

void LXQtFancyMenuAppModel::showSearchResults(const QVector<const LXQtFancyMenuAppItem *> &matches)
void LXQtFancyMenuAppModel::showSearchResults(const QList<const LXQtFancyMenuAppItem *> &matches)
{
beginResetModel();
mSearchMatches = matches;
Expand Down
4 changes: 2 additions & 2 deletions plugin-fancymenu/lxqtfancymenuappmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LXQtFancyMenuAppModel : public QAbstractListModel

void reloadAppMap(bool end);
void setCurrentCategory(int category);
void showSearchResults(const QVector<const LXQtFancyMenuAppItem *> &matches);
void showSearchResults(const QList<const LXQtFancyMenuAppItem *> &matches);
void endSearch();

LXQtFancyMenuAppMap *appMap() const;
Expand All @@ -77,7 +77,7 @@ class LXQtFancyMenuAppModel : public QAbstractListModel
LXQtFancyMenuAppMap *mAppMap;
int mCurrentCategory;

QVector<const LXQtFancyMenuAppItem *> mSearchMatches;
QList<const LXQtFancyMenuAppItem *> mSearchMatches;
bool mInSearch;
};

Expand Down
2 changes: 1 addition & 1 deletion plugin-taskbar/lxqttaskgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ void LXQtTaskGroup::wheelEvent(QWheelEvent* event)
bool LXQtTaskGroup::onWindowChanged(WId window, NET::Properties prop, NET::Properties2 prop2)
{ // returns true if the class is preserved
bool needsRefreshVisibility{false};
QVector<LXQtTaskButton *> buttons;
QList<LXQtTaskButton *> buttons;
if (mButtonHash.contains(window))
buttons.append(mButtonHash.value(window));

Expand Down
4 changes: 2 additions & 2 deletions plugin-tray/snidbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <QDBusArgument>
#include <QImage>
#include <QString>
#include <QVector>
#include <QList>

// Custom message type for DBus
struct KDbusImageStruct {
Expand All @@ -41,7 +41,7 @@ struct KDbusImageStruct {
QByteArray data;
};

typedef QVector<KDbusImageStruct> KDbusImageVector;
typedef QList<KDbusImageStruct> KDbusImageVector;

struct KDbusToolTipStruct {
QString icon;
Expand Down
2 changes: 1 addition & 1 deletion plugin-tray/xcbutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <xcb/xcb_event.h>

#include <memory>
#include <QVector>
#include <QList>

/** XEMBED messages */
#define XEMBED_EMBEDDED_NOTIFY 0
Expand Down

0 comments on commit 4343a79

Please sign in to comment.