Unset URL handlers on exit( as specified by Qt).

Fix uppercase avatar initials.
This commit is contained in:
Julien Wadel 2023-02-23 10:23:14 +01:00
parent 073f159485
commit 21965cc9a2
4 changed files with 11 additions and 4 deletions

View file

@ -84,6 +84,8 @@ public:
return mImageListModel;
}
QLocale getLocale () const;
//static ColorListModel *getColorListModel () const {
//return App::getInstance()-getColorListModel();
//}
@ -142,8 +144,6 @@ private:
QString getConfigLocale () const;
void setConfigLocale (const QString &locale);
QLocale getLocale () const;
QVariantList getAvailableLocales () const {
return mAvailableLocales;
}

View file

@ -31,6 +31,11 @@ UrlHandlers::UrlHandlers (QObject *parent) : QObject(parent) {
QDesktopServices::setUrlHandler("sips", this, "handleSip");
}
UrlHandlers::~UrlHandlers(){
QDesktopServices::unsetUrlHandler("sips");
QDesktopServices::unsetUrlHandler("sip");
}
void UrlHandlers::handleSip (const QUrl &url) {
emit sip(SipAddressesModel::interpretSipAddress(url));
}

View file

@ -26,10 +26,11 @@
// =============================================================================
class UrlHandlers : public QObject {
Q_OBJECT;
Q_OBJECT
public:
UrlHandlers (QObject *parent = Q_NULLPTR);
~UrlHandlers();
public slots:
void handleSip (const QUrl &url);

View file

@ -32,6 +32,7 @@
#include "config.h"
#include "Utils.hpp"
#include "UriTools.hpp"
#include "app/App.hpp"
#include "components/core/CoreManager.hpp"
#include "components/contacts/ContactsListModel.hpp"
#include "components/contact/ContactModel.hpp"
@ -138,7 +139,7 @@ QString Utils::getInitials(const QString& username){
initials << QString::fromStdU32String(char32);
}
}
return initials.join("");
return App::getInstance()->getLocale().toUpper(initials.join(""));
}
QString Utils::toString(const LinphoneEnums::TunnelMode& mode){