mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-17 20:08:28 +00:00
- Some case of unwanted settings folders creation : When calling settings paths from SettingsModel, we checked on default in all cases. That lead to create folders to be writable.
=> Check for default only if path has not been overwritten in linphonerc. - Replace black thumbnails that contains transparency by white color. Thumbnails are in jpg where there is no transparency. By default, transparency is replaced by black color because not background color has been defined. => Set background image in white.
This commit is contained in:
parent
8054fa8f5b
commit
5a49cbcc35
4 changed files with 32 additions and 23 deletions
|
|
@ -11,11 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- File viewer in chats (Image/Animated Image/Video/Texts) with the option to export the file.
|
||||
- Accept/decline CLI commands.
|
||||
|
||||
## 5.0.12 - 2023-02-28
|
||||
## 5.0.12 - 2023-03-01
|
||||
|
||||
## Fixed
|
||||
- Some case of unwanted settings folders creation.
|
||||
- Replace black thumbnails that contains transparency by white color.
|
||||
- Unusable Contact sheet.
|
||||
- Update SDK to 5.2.28 (cleanup orphan NAT sections and race condition on MSTicker threads)
|
||||
- Update SDK to 5.2.28 (cleanup orphan NAT sections and race condition on MSTicker threads).
|
||||
|
||||
## 5.0.11 - 2023-02-24
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include <QDesktopServices>
|
||||
#include <QImageReader>
|
||||
#include <QMessageBox>
|
||||
#include <QPainter>
|
||||
|
||||
#include "app/App.hpp"
|
||||
#include "app/paths/Paths.hpp"
|
||||
|
|
@ -163,20 +164,26 @@ void ContentModel::createThumbnail (const bool& force) {
|
|||
if(!appdata.mData.contains(path)
|
||||
|| !QFileInfo(QString::fromStdString(Paths::getThumbnailsDirPath())+appdata.mData[path]).isFile()){
|
||||
// File don't exist. Create the thumbnail
|
||||
QImage originalImage(path);
|
||||
|
||||
QImage image(path);
|
||||
if( image.isNull()){// Try to determine format from headers
|
||||
if( originalImage.isNull()){// Try to determine format from headers
|
||||
QImageReader reader(path);
|
||||
reader.setDecideFormatFromContent(true);
|
||||
QByteArray format = reader.format();
|
||||
if(!format.isEmpty())
|
||||
image = QImage(path, format);
|
||||
originalImage = QImage(path, format);
|
||||
}
|
||||
if (!image.isNull()){
|
||||
if (!originalImage.isNull()){
|
||||
int rotation = 0;
|
||||
QExifImageHeader exifImageHeader;
|
||||
if (exifImageHeader.loadFromJpeg(path))
|
||||
rotation = int(exifImageHeader.value(QExifImageHeader::ImageTag::Orientation).toShort());
|
||||
// Fill with color to replace transparency with white color instead of black (default).
|
||||
QImage image(originalImage.size(), originalImage.format());
|
||||
image.fill(QColor(Qt::white).rgb());
|
||||
QPainter painter(&image);
|
||||
painter.drawImage(0, 0, originalImage);
|
||||
//--------------------
|
||||
QImage thumbnail = image.scaled(
|
||||
Constants::ThumbnailImageFileWidth, Constants::ThumbnailImageFileHeight,
|
||||
Qt::KeepAspectRatio, Qt::SmoothTransformation
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ void RecorderModel::start(){
|
|||
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss-zzz"));
|
||||
const QString safeFilePath = Utils::getSafeFilePath(
|
||||
QStringLiteral("%1%2")
|
||||
.arg(Utils::coreStringToAppString(Paths::getCapturesDirPath()))
|
||||
.arg(CoreManager::getInstance()->getSettingsModel()->getSavedCallsFolder())
|
||||
.arg(filename),
|
||||
&soFarSoGood
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1436,11 +1436,10 @@ void SettingsModel::setTextMessageFontSize(const int& size){
|
|||
}
|
||||
|
||||
QString SettingsModel::getSavedScreenshotsFolder () const {
|
||||
return QDir::cleanPath(
|
||||
Utils::coreStringToAppString(
|
||||
mConfig->getString(UiSection, "saved_screenshots_folder", Paths::getCapturesDirPath())
|
||||
)
|
||||
) + QDir::separator();
|
||||
auto path = mConfig->getString(UiSection, "saved_screenshots_folder", "");
|
||||
if(path == "")
|
||||
path = Paths::getCapturesDirPath();
|
||||
return QDir::cleanPath(Utils::coreStringToAppString(path)) + QDir::separator();
|
||||
}
|
||||
|
||||
void SettingsModel::setSavedScreenshotsFolder (const QString &folder) {
|
||||
|
|
@ -1452,15 +1451,17 @@ void SettingsModel::setSavedScreenshotsFolder (const QString &folder) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
static inline string getLegacySavedCallsFolder (const shared_ptr<linphone::Config> &config) {
|
||||
return config->getString(SettingsModel::UiSection, "saved_videos_folder", Paths::getCapturesDirPath());
|
||||
auto path = config->getString(SettingsModel::UiSection, "saved_videos_folder", "");
|
||||
if(path == "")// Avoid to call default function if exist because calling Path:: will create a folder to be writable.
|
||||
path = Paths::getCapturesDirPath();
|
||||
return path;
|
||||
}
|
||||
|
||||
QString SettingsModel::getSavedCallsFolder () const {
|
||||
return QDir::cleanPath(
|
||||
Utils::coreStringToAppString(
|
||||
mConfig->getString(UiSection, "saved_calls_folder", getLegacySavedCallsFolder(mConfig))
|
||||
)
|
||||
) + QDir::separator();
|
||||
auto path = mConfig->getString(UiSection, "saved_calls_folder", "");// Avoid to call default function if exist.
|
||||
if(path == "")
|
||||
path = getLegacySavedCallsFolder(mConfig);
|
||||
return QDir::cleanPath(Utils::coreStringToAppString(path)) + QDir::separator();
|
||||
}
|
||||
|
||||
void SettingsModel::setSavedCallsFolder (const QString &folder) {
|
||||
|
|
@ -1472,11 +1473,10 @@ void SettingsModel::setSavedCallsFolder (const QString &folder) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
QString SettingsModel::getDownloadFolder () const {
|
||||
return QDir::cleanPath(
|
||||
Utils::coreStringToAppString(
|
||||
mConfig->getString(UiSection, "download_folder", Paths::getDownloadDirPath())
|
||||
)
|
||||
) + QDir::separator();
|
||||
auto path = mConfig->getString(UiSection, "download_folder", "");// Avoid to call default function if exist because calling Path:: will create a folder to be writable.
|
||||
if(path == "" )
|
||||
path = Paths::getDownloadDirPath();
|
||||
return QDir::cleanPath(Utils::coreStringToAppString(path)) + QDir::separator();
|
||||
}
|
||||
|
||||
void SettingsModel::setDownloadFolder (const QString &folder) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue