This commit is contained in:
pjx206 2021-05-30 15:33:45 +08:00
parent a4993abcc1
commit 9bddd607d8
3 changed files with 8 additions and 7 deletions

View file

@ -455,7 +455,7 @@ int FolderModel::count() const
return rowCount(); return rowCount();
} }
int FolderModel::selectionCound() const int FolderModel::selectionCount() const
{ {
return m_selectionModel->selectedIndexes().size(); return m_selectionModel->selectedIndexes().size();
} }
@ -944,7 +944,7 @@ void FolderModel::selectionChanged(const QItemSelection &selected, const QItemSe
updateActions(); updateActions();
emit selectionCoundChanged(); emit selectionCountChanged();
} }
void FolderModel::dragSelectedInternal(int x, int y) void FolderModel::dragSelectedInternal(int x, int y)

View file

@ -50,7 +50,7 @@ class FolderModel : public QSortFilterProxyModel, public QQmlParserStatus
Q_PROPERTY(bool dragging READ dragging NOTIFY draggingChanged) Q_PROPERTY(bool dragging READ dragging NOTIFY draggingChanged)
Q_PROPERTY(QObject *viewAdapter READ viewAdapter WRITE setViewAdapter NOTIFY viewAdapterChanged) Q_PROPERTY(QObject *viewAdapter READ viewAdapter WRITE setViewAdapter NOTIFY viewAdapterChanged)
Q_PROPERTY(bool isDesktop READ isDesktop WRITE setIsDesktop NOTIFY isDesktopChanged) Q_PROPERTY(bool isDesktop READ isDesktop WRITE setIsDesktop NOTIFY isDesktopChanged)
Q_PROPERTY(int selectionCound READ selectionCound NOTIFY selectionCoundChanged) Q_PROPERTY(int selectionCount READ selectionCount NOTIFY selectionCountChanged)
Q_PROPERTY(int count READ count NOTIFY countChanged) Q_PROPERTY(int count READ count NOTIFY countChanged)
public: public:
@ -131,7 +131,7 @@ public:
KFileItem rootItem() const; KFileItem rootItem() const;
int count() const; int count() const;
int selectionCound() const; int selectionCount() const;
Q_INVOKABLE QString homePath() const; Q_INVOKABLE QString homePath() const;
Q_INVOKABLE QString desktopPath() const; Q_INVOKABLE QString desktopPath() const;
@ -193,7 +193,7 @@ signals:
void draggingChanged(); void draggingChanged();
void viewAdapterChanged(); void viewAdapterChanged();
void isDesktopChanged(); void isDesktopChanged();
void selectionCoundChanged(); void selectionCountChanged();
void countChanged(); void countChanged();
private slots: private slots:
@ -224,6 +224,7 @@ private:
bool m_complete; bool m_complete;
bool m_isDesktop; bool m_isDesktop;
bool m_suffixVisible;
KActionCollection m_actionCollection; KActionCollection m_actionCollection;
QHash<int, DragImage *> m_dragImages; QHash<int, DragImage *> m_dragImages;

View file

@ -150,8 +150,8 @@ Item {
Label { Label {
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
font.pointSize: 10 font.pointSize: 10
text: qsTr("%1 selected").arg(dirModel.selectionCound) text: qsTr("%1 selected").arg(dirModel.selectionCount)
visible: dirModel.selectionCound >= 1 visible: dirModel.selectionCount >= 1
} }
Item { Item {