Skip to content

Commit

Permalink
Merge branch 'master' into update-changelog-20241220
Browse files Browse the repository at this point in the history
  • Loading branch information
pengfeixx authored Dec 20, 2024
2 parents 1f042c7 + 0decfa0 commit 5c3e9f3
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 13 deletions.
10 changes: 8 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
deepin-album (6.0.13) unstable; urgency=medium
deepin-album (6.0.14) unstable; urgency=medium

* chore: New version 6.0.13.
* chore: New version 6.0.14.

-- xiepengfei <[email protected]> Fri, 20 Dec 2024 11:51:44 +0800

deepin-album (6.0.13) unstable; urgency=medium

* update version to 6.0.13

-- renbin <[email protected]> Sat, 14 Dec 2024 11:56:30 +0800

deepin-album (6.0.12) unstable; urgency=medium

Expand Down
13 changes: 7 additions & 6 deletions src/qml/Control/ListView/ThumbnailListViewTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ function executeViewImageCutSwitch() {
var indexes = thumbnailModel.selectedIndexes
if (indexes.length > 0) {
var url = thumbnailModel.data(indexes[0], "url").toString()
var allUrls = thumbnailModel.allUrls()
menuItemStates.executeViewImageCutSwitch(url, allUrls)
var allPicUrls = thumbnailModel.allPictureUrls()
menuItemStates.executeViewImageCutSwitch(url, allPicUrls)
}
}
}
Expand All @@ -20,12 +20,13 @@ function executeViewImage(x, y, w, h) {
var indexes = thumbnailModel.selectedIndexes
if (indexes.length > 0) {
var url = thumbnailModel.data(indexes[0], "url").toString()
var allUrls = thumbnailModel.allUrls()
if (FileControl.isVideo(url)) {
var allUrls = thumbnailModel.allUrls()
menuItemStates.executeViewImageCutSwitch(url, allUrls)
} else {
var allPicUrls = thumbnailModel.allPictureUrls()
GStatus.enteringImageViewer = true
menuItemStates.executeViewImageCutSwitch(url, allUrls)
menuItemStates.executeViewImageCutSwitch(url, allPicUrls)
GStatus.sigMoveCenter(x, y, w, h)
GStatus.sigShowToolBar()
}
Expand All @@ -47,7 +48,7 @@ function executeDelete() {
// 执行全屏预览
function executeFullScreen() {
if (window.visibility !== Window.FullScreen && selectedUrls.length > 0) {
var allUrls = thumbnailModel.allUrls()
var allUrls = thumbnailModel.allPictureUrls()
var indexes = thumbnailModel.selectedIndexes
if (indexes.length > 0) {
menuItemStates.executeFullScreen(allUrls[indexes[0]], allUrls)
Expand All @@ -63,7 +64,7 @@ function executePrint() {
// 执行幻灯片放映
function excuteSlideShow() {
if (selectedUrls.length > 0) {
var allUrls = thumbnailModel.allUrls()
var allUrls = thumbnailModel.allPictureUrls()
menuItemStates.excuteSlideShow(allUrls)
//stackControl.startMainSliderShow(allUrls, allUrls.indexOf(selectedUrls[0]))
}
Expand Down
10 changes: 8 additions & 2 deletions src/src/albumControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2108,8 +2108,14 @@ void AlbumControl::openDeepinMovie(const QString &path)
const int osMajor = DSysInfo::majorVersion().toInt();
if (osMajor >= kMinimalOsVersion) {
qInfo() << "trying start detached ll-cli run deepin-movie";
arguments << "run" << "org.deepin.movie" << "--" << "deepin-movie" << path;
trylinglongSucc = process->startDetached("ll-cli", arguments);
// check if current installed org.deepin.movie
process->start("ll-cli", {"list"});
process->waitForFinished();
QByteArray output = process->readAllStandardOutput();
if (output.contains("org.deepin.movie")) {
arguments << "run" << "org.deepin.movie" << "--" << "deepin-movie" << path;
trylinglongSucc = process->startDetached("ll-cli", arguments);
}
}

if (!trylinglongSucc) {
Expand Down
4 changes: 4 additions & 0 deletions src/src/thumbnailview/imagedatamodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ QVariant ImageDataModel::data(const QModelIndex &index, int role) const
return "other";
}
}

case Roles::ItemTypeFlagRole: {
return info.itemType;
}
}

return {};
Expand Down
19 changes: 16 additions & 3 deletions src/src/thumbnailview/roles.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,22 @@ class Roles : public QObject
public:
using QObject::QObject;
~Roles() = default;
enum RoleNames { BlankRole = Qt::UserRole + 1, DBImgInfoRole, Thumbnail, ReloadThumbnail, ItemTypeRole, SelectedRole, SourceIndex
, ModelTypeRole, FileNameRole, UrlRole, FilePathRole, PathHashRole, RemainDaysRole
};
enum RoleNames {
BlankRole = Qt::UserRole + 1,
DBImgInfoRole,
Thumbnail,
ReloadThumbnail,
ItemTypeRole,
SelectedRole,
SourceIndex,
ModelTypeRole,
FileNameRole,
UrlRole,
FilePathRole,
PathHashRole,
RemainDaysRole,
ItemTypeFlagRole,
};
};

#endif
13 changes: 13 additions & 0 deletions src/src/thumbnailview/thumbnailmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,19 @@ QJsonArray ThumbnailModel::allUrls()
return arr;
}

QStringList ThumbnailModel::allPictureUrls()
{
QStringList pictureUrls;
for (int row = 0; row < rowCount(); row++) {
QModelIndex idx = index(row, 0);
if (ItemTypePic == idx.data(Roles::ItemTypeFlagRole).toInt()) {
pictureUrls.append(idx.data(Roles::UrlRole).toString());
}
}

return pictureUrls;
}

QJsonArray ThumbnailModel::allPaths()
{
QJsonArray arr;
Expand Down
1 change: 1 addition & 0 deletions src/src/thumbnailview/thumbnailmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class ThumbnailModel : public QSortFilterProxyModel
Q_INVOKABLE int proxyIndex(const int &indexValue);
Q_INVOKABLE int sourceIndex(const int &indexValue);
Q_INVOKABLE QJsonArray allUrls();
Q_INVOKABLE QStringList allPictureUrls();
Q_INVOKABLE QJsonArray allPaths();
Q_INVOKABLE QJsonArray selectedUrls();
Q_INVOKABLE QJsonArray selectedPaths();
Expand Down

0 comments on commit 5c3e9f3

Please sign in to comment.