mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Fix SendFilesWay radiobuttons when adding media.
Also add /LTCG flag for static libraries Release builds on Windows.
This commit is contained in:
@@ -1329,6 +1329,7 @@ SendFilesBox::SendFilesBox(
|
||||
Storage::PreparedList &&list,
|
||||
CompressConfirm compressed)
|
||||
: _list(std::move(list))
|
||||
, _compressConfirmInitial(compressed)
|
||||
, _compressConfirm(compressed) {
|
||||
}
|
||||
|
||||
@@ -1434,15 +1435,7 @@ void SendFilesBox::prepare() {
|
||||
}
|
||||
|
||||
void SendFilesBox::initSendWay() {
|
||||
_albumVideosCount = _list.albumIsPossible
|
||||
? ranges::count(
|
||||
_list.files,
|
||||
Storage::PreparedFile::AlbumType::Video,
|
||||
[](const Storage::PreparedFile &file) { return file.type; })
|
||||
: 0;
|
||||
_albumPhotosCount = _list.albumIsPossible
|
||||
? (_list.files.size() - _albumVideosCount)
|
||||
: 0;
|
||||
refreshAlbumMediaCount();
|
||||
const auto value = [&] {
|
||||
if (_compressConfirm == CompressConfirm::None) {
|
||||
return SendFilesWay::Files;
|
||||
@@ -1475,6 +1468,18 @@ void SendFilesBox::initSendWay() {
|
||||
});
|
||||
}
|
||||
|
||||
void SendFilesBox::refreshAlbumMediaCount() {
|
||||
_albumVideosCount = _list.albumIsPossible
|
||||
? ranges::count(
|
||||
_list.files,
|
||||
Storage::PreparedFile::AlbumType::Video,
|
||||
[](const Storage::PreparedFile &file) { return file.type; })
|
||||
: 0;
|
||||
_albumPhotosCount = _list.albumIsPossible
|
||||
? (_list.files.size() - _albumVideosCount)
|
||||
: 0;
|
||||
}
|
||||
|
||||
void SendFilesBox::preparePreview() {
|
||||
if (_list.files.size() == 1) {
|
||||
prepareSingleFilePreview();
|
||||
@@ -1636,6 +1641,9 @@ bool SendFilesBox::addFiles(not_null<const QMimeData*> data) {
|
||||
return false;
|
||||
} else if (_list.files.size() > 1 && !_albumPreview) {
|
||||
return false;
|
||||
} else if (_list.files.front().type
|
||||
== Storage::PreparedFile::AlbumType::None) {
|
||||
return false;
|
||||
}
|
||||
applyAlbumOrder();
|
||||
delete base::take(_preview);
|
||||
@@ -1646,6 +1654,9 @@ bool SendFilesBox::addFiles(not_null<const QMimeData*> data) {
|
||||
_sendWay->setValue(SendFilesWay::Album);
|
||||
}
|
||||
_list.mergeToEnd(std::move(list));
|
||||
|
||||
_compressConfirm = _compressConfirmInitial;
|
||||
refreshAlbumMediaCount();
|
||||
preparePreview();
|
||||
updateControlsGeometry();
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user